code
stringlengths
4
1.01M
language
stringclasses
2 values
#include <stdio.h> #include <stdlib.h> static void foo() { throw 123; } int main(int argc, char *argv[]) { int count = argc == 1 ? 10000 : atoi(argv[ 1 ]); int n = 0; for(int i = 0; i < count; ++i) { try { foo(); } catch(...) { ++n; } } printf("%d\n", n); return 0; }
Java
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------------------------------------------- ''' ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- import logging # isort:skip log = logging.getLogger(__name__) #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Bokeh imports from .notebook import run_notebook_hook from .state import curstate #----------------------------------------------------------------------------- # Globals and constants #----------------------------------------------------------------------------- __all__ = ( 'output_file', 'output_notebook', 'reset_output', ) #----------------------------------------------------------------------------- # General API #----------------------------------------------------------------------------- def output_file(filename, title="Bokeh Plot", mode=None, root_dir=None): '''Configure the default output state to generate output saved to a file when :func:`show` is called. Does not change the current ``Document`` from ``curdoc()``. File and notebook output may be active at the same time, so e.g., this does not clear the effects of ``output_notebook()``. Args: filename (str) : a filename for saving the HTML document title (str, optional) : a title for the HTML document (default: "Bokeh Plot") mode (str, optional) : how to include BokehJS (default: ``'cdn'``) One of: ``'inline'``, ``'cdn'``, ``'relative(-dev)'`` or ``'absolute(-dev)'``. See :class:`bokeh.resources.Resources` for more details. root_dir (str, optional) : root directory to use for 'absolute' resources. (default: None) This value is ignored for other resource types, e.g. ``INLINE`` or ``CDN``. Returns: None .. note:: Generally, this should be called at the beginning of an interactive session or the top of a script. .. warning:: This output file will be overwritten on every save, e.g., each time show() or save() is invoked. ''' curstate().output_file( filename, title=title, mode=mode, root_dir=root_dir ) def output_notebook(resources=None, verbose=False, hide_banner=False, load_timeout=5000, notebook_type='jupyter'): ''' Configure the default output state to generate output in notebook cells when :func:`show` is called. Note that, :func:`show` may be called multiple times in a single cell to display multiple objects in the output cell. The objects will be displayed in order. Args: resources (Resource, optional) : How and where to load BokehJS from (default: CDN) verbose (bool, optional) : whether to display detailed BokehJS banner (default: False) hide_banner (bool, optional): whether to hide the Bokeh banner (default: False) load_timeout (int, optional) : Timeout in milliseconds when plots assume load timed out (default: 5000) notebook_type (string, optional): Notebook type (default: jupyter) Returns: None .. note:: Generally, this should be called at the beginning of an interactive session or the top of a script. ''' # verify notebook_type first in curstate().output_notebook curstate().output_notebook(notebook_type) run_notebook_hook(notebook_type, 'load', resources, verbose, hide_banner, load_timeout) def reset_output(state=None): ''' Clear the default state of all output modes. Returns: None ''' curstate().reset() #----------------------------------------------------------------------------- # Dev API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Private API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Code #-----------------------------------------------------------------------------
Java
module Main where import Build_doctests (flags, pkgs, module_sources) import Data.Foldable (traverse_) import Test.DocTest (doctest) main :: IO () main = do traverse_ putStrLn args doctest args where args = ["-XOverloadedStrings"] ++ flags ++ pkgs ++ module_sources
Java
require './test_common.rb' require '../lib/crocus/minibloom' class TestMiniBloom < Test::Unit::TestCase def test_single_push results = [] mb = MiniBloom.new mb.source('p1',1) mb.p1.pro {|i| results << [2*i[0]]} mb.p1 << [2] assert_equal([4], results.pop) end def test_single_table results = [] mb = MiniBloom.new mb.table('p1',{[:key]=>[:val]}) mb.p1 << [1,2] mb.p1.pro {|i| results << [2*i[0]]} keys = mb.p1.keys vals = mb.p1.values mb.tick assert_equal([[2]], results) assert_equal([[1]], keys) assert_equal([[2]], vals) end def test_join_tables results = [] mb = MiniBloom.new mb.table('rel1',{[:key]=>[:val]}) mb.table('p2',{[:key]=>[:val]}) mb.rel1 <= [[:alpha,1], [:beta,2]] mb.p2 <= [[:alpha,3], [:beta,4]] (mb.rel1 * mb.p2).pairs([0]=>[0]){|x,y| results << [x[0],x[1],y[1]]} mb.tick assert_equal([[:alpha, 1, 3], [:beta, 2, 4]], results) end def test_join results = [] mb = MiniBloom.new mb.run_bg mb.source('rel1',2) mb.source('rel2',2) (mb.rel1*mb.rel2).pairs([1]=>[1]) {|i,j| results << [i[0], j[0], j[1]]} mb.rel1 <= [['a',1], ['c', 3]] mb.rel2 << ['b',1] mb.stop assert_equal(['a', 'b', 1], results.pop) assert_equal([], results) end def test_cross_product results = [] mb = MiniBloom.new mb.run_bg mb.source('rel1',2) mb.source('rel2',2) (mb.rel1*mb.rel2).pairs {|i,j| results << i+j} mb.rel1 <= [['a',1], ['c', 3]] mb.rel2 << ['b',1] mb.stop assert_equal([['a', 1, 'b', 1],['c',3, 'b',1]], results.sort) end def test_two_joins outs = [] mb = MiniBloom.new mb.run_bg mb.source('rel1',2) mb.source('rel2',2) mb.source('rel3',2) ((mb.rel1*mb.rel2).pairs([0]=>[0]){|i,j| i+j} * mb.rel3).pairs([2]=>[0]).pro do |i,j| outs << i+j end mb.rel1 <= [[1,:a],[2,:a]] mb.rel2 <= [[1,:b],[2,:b]] mb.rel3 <= [[1,:c],[2,:c]] mb.stop assert_equal([[1, :a, 1, :b, 1, :c], [2, :a, 2, :b, 2, :c]], outs.sort) end require 'set' def test_recursion outs = Set.new links = Set.new mb = MiniBloom.new mb.run_bg mb.source('link', 2) mb.source('path', 2) mb.path <= mb.link mb.path <= (mb.link*mb.path).pairs([1]=>[0]) do |i,j| tup = [i[0], j[1]] unless outs.include? tup outs << tup tup else nil end end [[1,2],[2,3],[3,4],[6,7],[2,7]].each{|i| links << i} mb.link <= links mb.stop assert_equal([[1,2],[1,3],[1,4],[1,7],[2,3],[2,4],[2,7],[3,4],[6,7]], (outs+links).to_a.sort) end def test_group_by outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.group([1], Crocus::sum(0)) {|i| outs << i unless i.nil?} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([['a', 3],['c', 2]], outs.sort) end def test_agg_nogroup outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.group([], Crocus::sum(0)) {|i| outs << i unless i.nil?} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([[5]], outs.sort) end def test_argagg agg_outs = [] max_outs = [] min_outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.argagg([1], Crocus::min(0)) {|i| agg_outs << i unless i.nil?} mb.r.argmin([1], 0) {|i| min_outs << i unless i.nil?} mb.r.argmax([1], 0) {|i| max_outs << i unless i.nil?} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([[1,'a'],[2,'c']], agg_outs.sort) assert_equal([[1,'a'],[2,'c']], min_outs.sort) assert_equal([[2,'a'],[2,'c']], max_outs.sort) end def test_argagg_nogroup outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.argagg([], Crocus::min(0)) {|i| outs << i unless i.nil?} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([[1,'a']], outs) end def test_preds mb = MiniBloom.new mb.run_bg mb.source('r',2) ex_outs = false inc_outs = false fail_outs = false mb.r.on_exists? {ex_outs = true} mb.r.on_include?([1,'a']) {inc_outs = true} mb.r.on_include?(['joe']) {fail_outs = true} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal(true, ex_outs) assert_equal(true, inc_outs) assert_equal(false, fail_outs) end def test_inspected outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.inspected.pro {|i| outs << i} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([[1,'a'],[2,'a'],[2,'c']].map{|i| [i.inspect]}, outs) end end
Java
<!-- %BD_HTML%/SearchResult.htm --> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=windows-1255"> <TITLE>úåöàú àéðèøðè - Takanot File</TITLE> </HEAD> <style> <!-- TR.A_Table {font-color:#3e6ea6; background-color: #f7f9fb; font-size:11;font-family: Arial,} TR.B_Table {font-color:#3e6ea6; background-color: #ecf1f6; font-size:11;font-family: Arial,} TR.C {font-color:#1e4a7a; background-color: #A9CAEF;font-weight:bold; font-size:11;font-family: Arial,} TR.clear { font-color:#1e4a7a; background-color: #FFFFFF;} H5 { font-family:Arial, Helvetica, sans-serif; font-size: 14px;} H3 { font-family:Arial, Helvetica, sans-serif; font-size: 16px;} TD.A_Row { font-family: Arial, Helvetica, sans-serif; font-weight:bold; font-style: normal; color: #093300; font-size: 10px} .defaultFont { color:#1f4a7b;font-family: Arial, Helvetica, sans-serif; font-size: 12px} --> </style> <BODY dir=rtl class="defaultFont"> <CENTER> <IMG src="/budget/Images/title1.jpg" align=bottom alt="ú÷öéá äîãéðä"> <TABLE align="center" border=0 cellspacing=0 cellpadding=0> <TR align="center"> <TD><H3>úåöàú çéôåù ìùðú 2005</H3></TD> </TR> <TR align="center"> <!--<TD><H3>ðúåðé áéöåò ðëåðéí ìñåó çåãù 08/2006</H3></TD>--> <TD><H3>ðúåðé áéöåò ëôé ùðøùîå áñôøé äðäìú äçùáåðåú ùì äîùøãéí - 08/2006<br></H3></TD> </TR> </TR align="center"> <TD><H3>àéï àçéãåú áéï äñòéôéí ìâáé îåòã òãëåï äðúåðéí</H3></TD> </TR> </TABLE> <H5>äñëåîéí äéðí ùì çå÷ äú÷öéá äî÷åøé åáàìôé ù÷ìéí <BR> </H5> </CENTER> <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#8fbcee"> <TR class="C" align="center"> <TD valign=top width=50>ñòéó</TD> <TD valign=top align="right" width=120>ùí ñòéó</TD> <TD valign=top width=65>äåöàä ðèå</TD> <TD valign=top width=65>äåöàä îåúðéú áäëðñä</TD> <TD valign=top width=65>ñä"ë äåöàä</TD> <TD valign=top width=65>äøùàä ìäúçééá</TD> <TD valign=top width=65>ùéà ë"à</TD> <TD valign=top width=40>ñä"ë ðåöì</TD> <TD valign=top width=40>àçåæ ðåöì</TD> </TR> </TABLE> <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#8fbcee"> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;73</TD> <TD valign=top align="right" width=120>&nbsp;îôòìé îéí</TD> <TD valign=top width=65>&nbsp; 655,551</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 655,551</TD> <TD valign=top width=65>&nbsp; 510,481</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 544,800</TD> <TD valign=top width=40>&nbsp; 83.11</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7304</TD> <TD valign=top align="right" width=120>&nbsp;àùøàé ìñô÷é îéí</TD> <TD valign=top width=65>&nbsp; 1,943</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1,943</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 699</TD> <TD valign=top width=40>&nbsp; 35.98</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;730401</TD> <TD valign=top align="right" width=120>&nbsp;àùøàé ìñô÷é îéí</TD> <TD valign=top width=65>&nbsp; 1,943</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1,943</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 699</TD> <TD valign=top width=40>&nbsp; 35.98</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7312</TD> <TD valign=top align="right" width=120>&nbsp;ðöéáåú äîéí ôòåìåú åøëéùåú</TD> <TD valign=top width=65>&nbsp; 25,421</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 25,421</TD> <TD valign=top width=65>&nbsp; 17,834</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 14,537</TD> <TD valign=top width=40>&nbsp; 57.19</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731202</TD> <TD valign=top align="right" width=120>&nbsp;îçùåá</TD> <TD valign=top width=65>&nbsp; 6,756</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 6,756</TD> <TD valign=top width=65>&nbsp; 6,282</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 3,954</TD> <TD valign=top width=40>&nbsp; 58.53</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;731203</TD> <TD valign=top align="right" width=120>&nbsp;àéëåú îéí, ðéèåø åîãéãåú</TD> <TD valign=top width=65>&nbsp; 18,665</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 18,665</TD> <TD valign=top width=65>&nbsp; 11,552</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 10,583</TD> <TD valign=top width=40>&nbsp; 56.70</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731204</TD> <TD valign=top align="right" width=120>&nbsp;îç÷øé äô÷ä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7314</TD> <TD valign=top align="right" width=120>&nbsp;îôòìé îéí áéäåãä ùåîøåï åòæä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731403</TD> <TD valign=top align="right" width=120>&nbsp;îôòìé îéí áéäåãä ùåîøåï åòæä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7318</TD> <TD valign=top align="right" width=120>&nbsp;úëðåï ìáéöåò îôòìé îéí</TD> <TD valign=top width=65>&nbsp; 9,404</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 9,404</TD> <TD valign=top width=65>&nbsp; 12,723</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 13,516</TD> <TD valign=top width=40>&nbsp;143.73</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731801</TD> <TD valign=top align="right" width=120>&nbsp;úëðåï ëåìì åúëðåï îôåøè-ä÷ãîåú úëðåï</TD> <TD valign=top width=65>&nbsp; 9,404</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 9,404</TD> <TD valign=top width=65>&nbsp; 12,723</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 13,516</TD> <TD valign=top width=40>&nbsp;143.73</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7319</TD> <TD valign=top align="right" width=120>&nbsp;ôéúåç î÷åøåú îéí</TD> <TD valign=top width=65>&nbsp; 121,809</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 121,809</TD> <TD valign=top width=65>&nbsp; 54,075</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 103,154</TD> <TD valign=top width=40>&nbsp; 84.69</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731903</TD> <TD valign=top align="right" width=120>&nbsp;ôéúåç îôòìé ÷åìçéï ìäîøä, èéåá áàøåú åäçãøú îéí</TD> <TD valign=top width=65>&nbsp; 108,195</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 108,195</TD> <TD valign=top width=65>&nbsp; 38,975</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 97,990</TD> <TD valign=top width=40>&nbsp; 90.57</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;731904</TD> <TD valign=top align="right" width=120>&nbsp;ééòåì äùéîåù áîéí</TD> <TD valign=top width=65>&nbsp; 13,614</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 13,614</TD> <TD valign=top width=65>&nbsp; 15,100</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 5,165</TD> <TD valign=top width=40>&nbsp; 37.94</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;7320</TD> <TD valign=top align="right" width=120>&nbsp;ôòåìåú ðé÷åæ</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 11,768</TD> <TD valign=top width=40>&nbsp;******</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732002</TD> <TD valign=top align="right" width=120>&nbsp;ðçìéí àøöééí</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 9,685</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732003</TD> <TD valign=top align="right" width=120>&nbsp;ðé÷åæ - ôøåéé÷èéí îéåçãéí</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 1,434</TD> <TD valign=top width=40>&nbsp;159.33</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732004</TD> <TD valign=top align="right" width=120>&nbsp;äñãøú øùåéåú ðé÷åæ</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 649</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;7321</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò ìúàâéãé ôééìåè ìîéí åìáéåá</TD> <TD valign=top width=65>&nbsp; 58,240</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 58,240</TD> <TD valign=top width=65>&nbsp; 30,871</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 7,259</TD> <TD valign=top width=40>&nbsp; 12.46</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732101</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò ìúàâéãé ôééìåè ìîéí åìáéåá</TD> <TD valign=top width=65>&nbsp; 58,240</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 58,240</TD> <TD valign=top width=65>&nbsp; 30,871</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 7,259</TD> <TD valign=top width=40>&nbsp; 12.46</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;7322</TD> <TD valign=top align="right" width=120>&nbsp;îôòìé áéåá</TD> <TD valign=top width=65>&nbsp; 417,840</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 417,840</TD> <TD valign=top width=65>&nbsp; 394,078</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 393,867</TD> <TD valign=top width=40>&nbsp; 94.26</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732202</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò øâéì 96 åàéìê</TD> <TD valign=top width=65>&nbsp; 243,312</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 243,312</TD> <TD valign=top width=65>&nbsp; 251,738</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 165,865</TD> <TD valign=top width=40>&nbsp; 68.17</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732203</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò ìúàâéã éøåùìéí 96 åàéìê</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732204</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò áúðàéí îéåçãéí</TD> <TD valign=top width=65>&nbsp; 16,870</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 16,870</TD> <TD valign=top width=65>&nbsp; 22,290</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 32,579</TD> <TD valign=top width=40>&nbsp;193.12</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732205</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò îéåçã ì÷å òéîåú</TD> <TD valign=top width=65>&nbsp; 32,609</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 32,609</TD> <TD valign=top width=65>&nbsp; 19,125</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 38,002</TD> <TD valign=top width=40>&nbsp;116.54</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732206</TD> <TD valign=top align="right" width=120>&nbsp;îòð÷éí</TD> <TD valign=top width=65>&nbsp; 506</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 506</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 3,178</TD> <TD valign=top width=40>&nbsp;628.06</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732207</TD> <TD valign=top align="right" width=120>&nbsp;úëðåï îôòìé áéåá</TD> <TD valign=top width=65>&nbsp; 612</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 612</TD> <TD valign=top width=65>&nbsp; 431</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 257</TD> <TD valign=top width=40>&nbsp; 41.99</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732208</TD> <TD valign=top align="right" width=120>&nbsp;äùúúôåéåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732209</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò îéåçã ìùãøåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 20,634</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732210</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò îéåçã ìéùåáé îâæø äîéòåèéí ùðú 2001 åàéìê</TD> <TD valign=top width=65>&nbsp; 90,405</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 90,405</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 97,146</TD> <TD valign=top width=40>&nbsp;107.46</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732211</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò îéåçã ìéùåáé "èéôåì ð÷åãúé" ùðú 2001 åàéìê</TD> <TD valign=top width=65>&nbsp; 33,526</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 33,526</TD> <TD valign=top width=65>&nbsp; 79,860</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 56,840</TD> <TD valign=top width=40>&nbsp;169.54</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7323</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä ìäúéé÷øåéåú</TD> <TD valign=top width=65>&nbsp; 19,994</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 19,994</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732301</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä ìäúéé÷øåéåú</TD> <TD valign=top width=65>&nbsp; 19,994</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 19,994</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> </TABLE> </CENTER> <BR> <CENTER> <table border="0" cellspacing="1" cellpadding="3" bgcolor="#8fbcee" dir="rtl"> <TR class="C" align="center"> <TD class="A_Row" valign=top width=80>ñéëåí ãå"ç</TD> <TD class="A_Row" valign=top width=60>äåöàä ðèå</TD> <TD class="A_Row" valign=top width=60>äåöàä îåúðéú áäëðñä</TD> <TD class="A_Row" valign=top width=60>ñä"ë äåöàä</TD> <TD class="A_Row" valign=top width=60>äøùàä ìäúçééá</TD> <TD class="A_Row" valign=top width=60>ùéà ë"à</TD> <TD class="A_Row" valign=top width=50>ñä"ë ðåöì</TD> <TD class="A_Row" valign=top width=50>àçåæ ðåöì</TD> </TR> <TR class="clear" align="center"> <TD class="A_Row" valign=top width=80>&nbsp;ú÷öéá î÷åøé</TD> <TD class="A_Row" valign=top width=60>&nbsp; 655,551</TD> <TD class="A_Row" valign=top width=60>&nbsp; 0</TD> <TD class="A_Row" valign=top width=60>&nbsp; 655,551</TD> <TD class="A_Row" valign=top width=60>&nbsp; 510,481</TD> <TD class="A_Row" valign=top width=60>&nbsp; 0</TD> <TD class="A_Row" valign=top width=50>&nbsp;</TD> <TD class="A_Row" valign=top width=50>&nbsp;</TD> </TR> <!--<TR class="clear" align="center"> <TD class="A_Row" valign=top width=80>&nbsp;ú÷öéá òì ùéðåééå</TD> <TD class="A_Row" valign=top width=60>&nbsp; 1,418,999</TD> <TD class="A_Row" valign=top width=60>&nbsp; 300</TD> <TD class="A_Row" valign=top width=60>&nbsp; 1,419,299</TD> <TD class="A_Row" valign=top width=60>&nbsp; 854,241</TD> <TD class="A_Row" valign=top width=60>&nbsp; 0</TD> <TD class="A_Row" valign=top width=50>&nbsp; 544,801</TD> <TD class="A_Row" valign=top width=50>&nbsp; 83.11</TD> </TR>--> </TABLE> <CENTER> <TABLE WIDTH="100" > <TR> <TD align="center" nowrap> <IMG SRC="/budget/Images/semel.gif" HEIGHT=37 WIDTH=30 border = "0"><BR> <FONT SIZE=-2> <A HREF="http://www.mof.gov.il/rights.htm"> ëì äæëåéåú &copy; .ùîåøåú,2005,îãéðú éùøàì<BR></A> ðùîç ì÷áì àú äòøåúéëí åäöòåúéëí ìëúåáú: </FONT> <FONT SIZE=-2 dir=ltr> <A HREF="mailto:Webmaster@mof.gov.il">Webmaster@mof.gov.il</A><BR> </FONT> </TD> </TR> </TABLE> </CENTER> </CENTER> </BODY> </HTML>
Java
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "media/audio/mac/audio_low_latency_output_mac.h" #include <CoreServices/CoreServices.h> #include "base/basictypes.h" #include "base/command_line.h" #include "base/logging.h" #include "base/mac/mac_logging.h" #include "media/audio/audio_util.h" #include "media/audio/mac/audio_manager_mac.h" #include "media/base/media_switches.h" namespace media { static std::ostream& operator<<(std::ostream& os, const AudioStreamBasicDescription& format) { os << "sample rate : " << format.mSampleRate << std::endl << "format ID : " << format.mFormatID << std::endl << "format flags : " << format.mFormatFlags << std::endl << "bytes per packet : " << format.mBytesPerPacket << std::endl << "frames per packet : " << format.mFramesPerPacket << std::endl << "bytes per frame : " << format.mBytesPerFrame << std::endl << "channels per frame: " << format.mChannelsPerFrame << std::endl << "bits per channel : " << format.mBitsPerChannel; return os; } static AudioObjectPropertyAddress kDefaultOutputDeviceAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; // Overview of operation: // 1) An object of AUAudioOutputStream is created by the AudioManager // factory: audio_man->MakeAudioStream(). // 2) Next some thread will call Open(), at that point the underlying // default output Audio Unit is created and configured. // 3) Then some thread will call Start(source). // Then the Audio Unit is started which creates its own thread which // periodically will call the source for more data as buffers are being // consumed. // 4) At some point some thread will call Stop(), which we handle by directly // stopping the default output Audio Unit. // 6) The same thread that called stop will call Close() where we cleanup // and notify the audio manager, which likely will destroy this object. AUAudioOutputStream::AUAudioOutputStream( AudioManagerMac* manager, const AudioParameters& params) : manager_(manager), source_(NULL), output_unit_(0), output_device_id_(kAudioObjectUnknown), volume_(1), hardware_latency_frames_(0), stopped_(false), audio_bus_(AudioBus::Create(params)) { // We must have a manager. DCHECK(manager_); // A frame is one sample across all channels. In interleaved audio the per // frame fields identify the set of n |channels|. In uncompressed audio, a // packet is always one frame. format_.mSampleRate = params.sample_rate(); format_.mFormatID = kAudioFormatLinearPCM; format_.mFormatFlags = kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsSignedInteger; format_.mBitsPerChannel = params.bits_per_sample(); format_.mChannelsPerFrame = params.channels(); format_.mFramesPerPacket = 1; format_.mBytesPerPacket = (format_.mBitsPerChannel * params.channels()) / 8; format_.mBytesPerFrame = format_.mBytesPerPacket; format_.mReserved = 0; DVLOG(1) << "Desired ouput format: " << format_; // Calculate the number of sample frames per callback. number_of_frames_ = params.GetBytesPerBuffer() / format_.mBytesPerPacket; DVLOG(1) << "Number of frames per callback: " << number_of_frames_; const AudioParameters parameters = manager_->GetDefaultOutputStreamParameters(); CHECK_EQ(number_of_frames_, static_cast<size_t>(parameters.frames_per_buffer())); } AUAudioOutputStream::~AUAudioOutputStream() { } bool AUAudioOutputStream::Open() { // Obtain the current input device selected by the user. UInt32 size = sizeof(output_device_id_); OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &kDefaultOutputDeviceAddress, 0, 0, &size, &output_device_id_); if (result != noErr || output_device_id_ == kAudioObjectUnknown) { OSSTATUS_DLOG(WARNING, result) << "Could not get default audio output device."; return false; } // Open and initialize the DefaultOutputUnit. AudioComponent comp; AudioComponentDescription desc; desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; comp = AudioComponentFindNext(0, &desc); if (!comp) return false; result = AudioComponentInstanceNew(comp, &output_unit_); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioComponentInstanceNew() failed."; return false; } result = AudioUnitInitialize(output_unit_); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioUnitInitialize() failed."; return false; } hardware_latency_frames_ = GetHardwareLatency(); return Configure(); } bool AUAudioOutputStream::Configure() { // Set the render callback. AURenderCallbackStruct input; input.inputProc = InputProc; input.inputProcRefCon = this; OSStatus result = AudioUnitSetProperty( output_unit_, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Global, 0, &input, sizeof(input)); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioUnitSetProperty(kAudioUnitProperty_SetRenderCallback) failed."; return false; } // Set the stream format. result = AudioUnitSetProperty( output_unit_, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &format_, sizeof(format_)); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioUnitSetProperty(kAudioUnitProperty_StreamFormat) failed."; return false; } // Set the buffer frame size. // WARNING: Setting this value changes the frame size for all audio units in // the current process. It's imperative that the input and output frame sizes // be the same as the frames_per_buffer() returned by // GetDefaultOutputStreamParameters. // See http://crbug.com/154352 for details. UInt32 buffer_size = number_of_frames_; result = AudioUnitSetProperty( output_unit_, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Output, 0, &buffer_size, sizeof(buffer_size)); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioUnitSetProperty(kAudioDevicePropertyBufferFrameSize) failed."; return false; } return true; } void AUAudioOutputStream::Close() { if (output_unit_) AudioComponentInstanceDispose(output_unit_); // Inform the audio manager that we have been closed. This can cause our // destruction. manager_->ReleaseOutputStream(this); } void AUAudioOutputStream::Start(AudioSourceCallback* callback) { DCHECK(callback); if (!output_unit_) { DLOG(ERROR) << "Open() has not been called successfully"; return; } stopped_ = false; { base::AutoLock auto_lock(source_lock_); source_ = callback; } AudioOutputUnitStart(output_unit_); } void AUAudioOutputStream::Stop() { if (stopped_) return; AudioOutputUnitStop(output_unit_); base::AutoLock auto_lock(source_lock_); source_ = NULL; stopped_ = true; } void AUAudioOutputStream::SetVolume(double volume) { if (!output_unit_) return; volume_ = static_cast<float>(volume); // TODO(crogers): set volume property } void AUAudioOutputStream::GetVolume(double* volume) { if (!output_unit_) return; *volume = volume_; } // Pulls on our provider to get rendered audio stream. // Note to future hackers of this function: Do not add locks here because this // is running on a real-time thread (for low-latency). OSStatus AUAudioOutputStream::Render(UInt32 number_of_frames, AudioBufferList* io_data, const AudioTimeStamp* output_time_stamp) { // Update the playout latency. double playout_latency_frames = GetPlayoutLatency(output_time_stamp); AudioBuffer& buffer = io_data->mBuffers[0]; uint8* audio_data = reinterpret_cast<uint8*>(buffer.mData); uint32 hardware_pending_bytes = static_cast<uint32> ((playout_latency_frames + 0.5) * format_.mBytesPerFrame); // Unfortunately AUAudioInputStream and AUAudioOutputStream share the frame // size set by kAudioDevicePropertyBufferFrameSize above on a per process // basis. What this means is that the |number_of_frames| value may be larger // or smaller than the value set during Configure(). In this case either // audio input or audio output will be broken, so just output silence. // TODO(crogers): Figure out what can trigger a change in |number_of_frames|. // See http://crbug.com/154352 for details. if (number_of_frames != static_cast<UInt32>(audio_bus_->frames())) { memset(audio_data, 0, number_of_frames * format_.mBytesPerFrame); return noErr; } int frames_filled = 0; { // Render() shouldn't be called except between AudioOutputUnitStart() and // AudioOutputUnitStop() calls, but crash reports have shown otherwise: // http://crbug.com/178765. We use |source_lock_| to prevent races and // crashes in Render() when |source_| is cleared. base::AutoLock auto_lock(source_lock_); if (!source_) { memset(audio_data, 0, number_of_frames * format_.mBytesPerFrame); return noErr; } frames_filled = source_->OnMoreData( audio_bus_.get(), AudioBuffersState(0, hardware_pending_bytes)); } // Note: If this ever changes to output raw float the data must be clipped and // sanitized since it may come from an untrusted source such as NaCl. audio_bus_->ToInterleaved( frames_filled, format_.mBitsPerChannel / 8, audio_data); uint32 filled = frames_filled * format_.mBytesPerFrame; // Perform in-place, software-volume adjustments. media::AdjustVolume(audio_data, filled, audio_bus_->channels(), format_.mBitsPerChannel / 8, volume_); return noErr; } // DefaultOutputUnit callback OSStatus AUAudioOutputStream::InputProc(void* user_data, AudioUnitRenderActionFlags*, const AudioTimeStamp* output_time_stamp, UInt32, UInt32 number_of_frames, AudioBufferList* io_data) { AUAudioOutputStream* audio_output = static_cast<AUAudioOutputStream*>(user_data); if (!audio_output) return -1; return audio_output->Render(number_of_frames, io_data, output_time_stamp); } int AUAudioOutputStream::HardwareSampleRate() { // Determine the default output device's sample-rate. AudioDeviceID device_id = kAudioObjectUnknown; UInt32 info_size = sizeof(device_id); OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &kDefaultOutputDeviceAddress, 0, 0, &info_size, &device_id); if (result != noErr || device_id == kAudioObjectUnknown) { OSSTATUS_DLOG(WARNING, result) << "Could not get default audio output device."; return 0; } Float64 nominal_sample_rate; info_size = sizeof(nominal_sample_rate); AudioObjectPropertyAddress nominal_sample_rate_address = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; result = AudioObjectGetPropertyData(device_id, &nominal_sample_rate_address, 0, 0, &info_size, &nominal_sample_rate); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "Could not get default sample rate for device: " << device_id; return 0; } return static_cast<int>(nominal_sample_rate); } double AUAudioOutputStream::GetHardwareLatency() { if (!output_unit_ || output_device_id_ == kAudioObjectUnknown) { DLOG(WARNING) << "Audio unit object is NULL or device ID is unknown"; return 0.0; } // Get audio unit latency. Float64 audio_unit_latency_sec = 0.0; UInt32 size = sizeof(audio_unit_latency_sec); OSStatus result = AudioUnitGetProperty(output_unit_, kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0, &audio_unit_latency_sec, &size); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "Could not get audio unit latency"; return 0.0; } // Get output audio device latency. AudioObjectPropertyAddress property_address = { kAudioDevicePropertyLatency, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster }; UInt32 device_latency_frames = 0; size = sizeof(device_latency_frames); result = AudioObjectGetPropertyData(output_device_id_, &property_address, 0, NULL, &size, &device_latency_frames); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "Could not get audio unit latency"; return 0.0; } return static_cast<double>((audio_unit_latency_sec * format_.mSampleRate) + device_latency_frames); } double AUAudioOutputStream::GetPlayoutLatency( const AudioTimeStamp* output_time_stamp) { // Ensure mHostTime is valid. if ((output_time_stamp->mFlags & kAudioTimeStampHostTimeValid) == 0) return 0; // Get the delay between the moment getting the callback and the scheduled // time stamp that tells when the data is going to be played out. UInt64 output_time_ns = AudioConvertHostTimeToNanos( output_time_stamp->mHostTime); UInt64 now_ns = AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()); // Prevent overflow leading to huge delay information; occurs regularly on // the bots, probably less so in the wild. if (now_ns > output_time_ns) return 0; double delay_frames = static_cast<double> (1e-9 * (output_time_ns - now_ns) * format_.mSampleRate); return (delay_frames + hardware_latency_frames_); } } // namespace media
Java
<?php use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\ComputerVih */ $this->title = Yii::t('app', 'Create Computer Vih'); $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Computer Vihs'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="computer-vih-create"> <h1><?= Html::encode($this->title) ?></h1> <?= $this->render('_form', [ 'model' => $model, ]) ?> </div>
Java
<?php /** * CmsModule class file. * @author Christoffer Niska <christoffer.niska@nordsoftware.com> * @copyright Copyright &copy; 2011, Nord Software Ltd * @license http://www.opensource.org/licenses/bsd-license.php New BSD License * @package cms */ class CmsModule extends CWebModule { /** * @var string the name of the default controller */ public $defaultController = 'admin'; /** * Initializes the module. */ public function init() { // Register module imports. $this->setImport(array( 'cms.components.*', 'cms.models.*', 'ext.bootstrap.widgets.*' )); } /** * Performs access check to this module. * @param CController $controller the controller to be accessed * @param CAction $action the action to be accessed * @return boolean whether the action should be executed */ public function beforeControllerAction($controller, $action) { if (parent::beforeControllerAction($controller, $action)) { $route = $controller->id.'/'.$action->id; if (!Yii::app()->cms->checkAccess() && $route !== 'node/page') throw new CHttpException(403, Yii::t('CmsModule.core', 'You are not allowed to access this page.')); $publicPages = array('node/page'); if (Yii::app()->user->isGuest && !in_array($route, $publicPages)) Yii::app()->user->loginRequired(); else return true; } return false; } public function getVersion() { return '0.9.1'; } }
Java
// SDLRegisterAppInterface.h // #import "SDLRPCRequest.h" #import "SDLAppHMIType.h" #import "SDLLanguage.h" @class SDLAppInfo; @class SDLDeviceInfo; @class SDLLifecycleConfiguration; @class SDLSyncMsgVersion; @class SDLTemplateColorScheme; @class SDLTTSChunk; /** * Registers the application's interface with SDL. The `RegisterAppInterface` RPC declares the properties of the app, including the messaging interface version, the app name, etc. The mobile application must establish its interface registration with SDL before any other interaction with SDL can take place. The registration lasts until it is terminated either by the application calling the `SDLUnregisterAppInterface` method, or by SDL sending an `SDLOnAppInterfaceUnregistered` notification, or by loss of the underlying transport connection, or closing of the underlying message transmission protocol RPC session. * * Until the application receives its first `SDLOnHMIStatus` notification, its `SDLHMILevel` is assumed to be `NONE`, the `SDLAudioStreamingState` is assumed to be `NOT_AUDIBLE`, and the `SDLSystemContext` is assumed to be `MAIN`. * * All SDL resources which the application creates or uses (e.g. choice sets, command menu, etc.) are associated with the application's interface registration. Therefore, when the interface registration ends, the SDL resources associated with the application are disposed of. As a result, even though the application itself may continue to run on its host platform (e.g. mobile device) after the interface registration terminates, the application will not be able to use the SDL HMI without first establishing a new interface registration and re-creating its required SDL resources. That is, SDL resources created by (or on behalf of) an application do not persist beyond the life-span of the interface registration. Resources and settings whose lifespan is tied to the duration of an application's interface registration include: choice sets, command menus, and the media clock timer display value * * If the application intends to stream audio it is important to indicate so via the `isMediaApp` parameter. When set to true, audio will reliably stream without any configuration required by the user. When not set, audio may stream, depending on what the user might have manually configured as a media source on SDL. * * @since SDL 1.0 * * @see SDLUnregisterAppInterface, SDLOnAppInterfaceUnregistered */ NS_ASSUME_NONNULL_BEGIN @interface SDLRegisterAppInterface : SDLRPCRequest /** * Convenience init for registering the application with a lifecycle configuration. * * @param lifecycleConfiguration Configuration options for SDLManager */ - (instancetype)initWithLifecycleConfiguration:(SDLLifecycleConfiguration *)lifecycleConfiguration; /** * Convenience init for registering the application. * * @param appName The mobile application's name * @param appId An appId used to validate app with policy table entries * @param languageDesired The language the application intends to use for user interaction * @return A SDLRegisterAppInterface object */ - (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage)languageDesired; /** * Convenience init for registering the application. * * @param appName The mobile application's name * @param appId An appId used to validate app with policy table entries * @param languageDesired The language the application intends to use for user interaction * @param isMediaApp Indicates if the application is a media or a non-media application * @param appTypes A list of all applicable app types stating which classifications to be given to the app * @param shortAppName An abbreviated version of the mobile application's name * @return A SDLRegisterAppInterface object */ - (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage)languageDesired isMediaApp:(BOOL)isMediaApp appTypes:(NSArray<SDLAppHMIType> *)appTypes shortAppName:(nullable NSString *)shortAppName __deprecated_msg(("Use initWithAppName:appId:fullAppId:languageDesired:isMediaApp:appTypes:shortAppName:ttsName:vrSynonyms:hmiDisplayLanguageDesired:resumeHash:dayColorScheme:nightColorScheme: instead")); /** * Convenience init for registering the application. * * @param appName The mobile application's name * @param appId An appId used to validate app with policy table entries * @param languageDesired The language the application intends to use for user interaction * @param isMediaApp Indicates if the application is a media or a non-media application * @param appTypes A list of all applicable app types stating which classifications to be given to the app * @param shortAppName An abbreviated version of the mobile application's name * @param ttsName TTS string for VR recognition of the mobile application name * @param vrSynonyms Additional voice recognition commands * @param hmiDisplayLanguageDesired Current app's expected VR+TTS language * @param resumeHash ID used to uniquely identify current state of all app data that can persist through connection cycles * @return A SDLRegisterAppInterface object */ - (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage)languageDesired isMediaApp:(BOOL)isMediaApp appTypes:(NSArray<SDLAppHMIType> *)appTypes shortAppName:(nullable NSString *)shortAppName ttsName:(nullable NSArray<SDLTTSChunk *> *)ttsName vrSynonyms:(nullable NSArray<NSString *> *)vrSynonyms hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired resumeHash:(nullable NSString *)resumeHash __deprecated_msg(("Use initWithAppName:appId:fullAppId:languageDesired:isMediaApp:appTypes:shortAppName:ttsName:vrSynonyms:hmiDisplayLanguageDesired:resumeHash:dayColorScheme:nightColorScheme: instead")); /** * Convenience init for registering the application with all possible options. * * @param appName The mobile application's name * @param appId An appId used to validate app with policy table entries * @param fullAppId A full UUID appID used to validate app with policy table entries. * @param languageDesired The language the application intends to use for user interaction * @param isMediaApp Indicates if the application is a media or a non-media application * @param appTypes A list of all applicable app types stating which classifications to be given to the app * @param shortAppName An abbreviated version of the mobile application's name * @param ttsName TTS string for VR recognition of the mobile application name * @param vrSynonyms Additional voice recognition commands * @param hmiDisplayLanguageDesired Current app's expected VR+TTS language * @param resumeHash ID used to uniquely identify current state of all app data that can persist through connection cycles * @param dayColorScheme The color scheme to be used on a head unit using a "light" or "day" color scheme. * @param nightColorScheme The color scheme to be used on a head unit using a "dark" or "night" color scheme * @return A SDLRegisterAppInterface object */ - (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId fullAppId:(nullable NSString *)fullAppId languageDesired:(SDLLanguage)languageDesired isMediaApp:(BOOL)isMediaApp appTypes:(NSArray<SDLAppHMIType> *)appTypes shortAppName:(nullable NSString *)shortAppName ttsName:(nullable NSArray<SDLTTSChunk *> *)ttsName vrSynonyms:(nullable NSArray<NSString *> *)vrSynonyms hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired resumeHash:(nullable NSString *)resumeHash dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme; /** * The version of the SDL interface * * Required */ @property (strong, nonatomic) SDLSyncMsgVersion *syncMsgVersion; /** * The mobile application's name. This name is displayed in the SDL Mobile Applications menu. It also serves as the unique identifier of the application for SmartDeviceLink. * * 1. Needs to be unique over all applications. Applications with the same name will be rejected. * 2. May not be empty. * 3. May not start with a new line character. * 4. May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands). * * Required, Max length 100 chars */ @property (strong, nonatomic) NSString *appName; /** * TTS string for VR recognition of the mobile application name. * * @discussion Meant to overcome any failing on speech engine in properly pronouncing / understanding app name. * 1. Needs to be unique over all applications. * 2. May not be empty. * 3. May not start with a new line character. * * Optional, Array of SDLTTSChunk, Array size 1 - 100 * * @since SDL 2.0 * @see SDLTTSChunk */ @property (nullable, strong, nonatomic) NSArray<SDLTTSChunk *> *ttsName; /** * A String representing an abbreviated version of the mobile application's name (if necessary) that will be displayed on the media screen. * * @discussion If not provided, the appName is used instead (and will be truncated if too long) * * Optional, Max length 100 chars */ @property (nullable, strong, nonatomic) NSString *ngnMediaScreenAppName; /** * Defines additional voice recognition commands * * @discussion May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands). * * Optional, Array of Strings, Array length 1 - 100, Max String length 40 */ @property (nullable, strong, nonatomic) NSArray<NSString *> *vrSynonyms; /** * Indicates if the application is a media or a non-media application. * * @discussion Only media applications will be able to stream audio to head units that is audible outside of the BT media source. * * Required, Boolean */ @property (strong, nonatomic) NSNumber<SDLBool> *isMediaApplication; /** * A Language enumeration indicating what language the application intends to use for user interaction (TTS and VR). * * @discussion If there is a mismatch with the head unit, the app will be able to change this registration with changeRegistration prior to app being brought into focus. * * Required */ @property (strong, nonatomic) SDLLanguage languageDesired; /** * An enumeration indicating what language the application intends to use for user interaction (Display). * * @discussion If there is a mismatch with the head unit, the app will be able to change this registration with changeRegistration prior to app being brought into focus. * * Required * * @since SDL 2.0 */ @property (strong, nonatomic) SDLLanguage hmiDisplayLanguageDesired; /** * A list of all applicable app types stating which classifications to be given to the app. * * Optional, Array of SDLAppHMIType, Array size 1 - 100 * * @since SDL 2.0 * @see SDLAppHMIType */ @property (nullable, strong, nonatomic) NSArray<SDLAppHMIType> *appHMIType; /** * ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles). * * @discussion This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece. If omitted, then the previous state of an app's commands, etc. will not be restored. * * When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.). * * Optional, max length 100 chars */ @property (nullable, strong, nonatomic) NSString *hashID; /** * Information about the connecting device * * Optional */ @property (nullable, strong, nonatomic) SDLDeviceInfo *deviceInfo; /** * ID used to validate app with policy table entries * * Required, max length 100 * * @see `fullAppID` * * @since SDL 2.0 */ @property (strong, nonatomic) NSString *appID; /** * A full UUID appID used to validate app with policy table entries. * * Optional * * @discussion The `fullAppId` is used to authenticate apps that connect with head units that implement SDL Core v.5.0 and newer. If connecting with older head units, the `fullAppId` can be truncated to create the required `appId` needed to register the app. The `appId` is the first 10 non-dash ("-") characters of the `fullAppID` (e.g. if you have a `fullAppId` of 123e4567-e89b-12d3-a456-426655440000, the `appId` will be 123e4567e8). */ @property (nullable, strong, nonatomic) NSString *fullAppID; /** * Information about the application running * * Optional */ @property (nullable, strong, nonatomic) SDLAppInfo *appInfo; /** * The color scheme to be used on a head unit using a "light" or "day" color scheme. The OEM may only support this theme if their head unit only has a light color scheme. * * Optional */ @property (strong, nonatomic, nullable) SDLTemplateColorScheme *dayColorScheme; /** * The color scheme to be used on a head unit using a "dark" or "night" color scheme. The OEM may only support this theme if their head unit only has a dark color scheme. * * Optional */ @property (strong, nonatomic, nullable) SDLTemplateColorScheme *nightColorScheme; @end NS_ASSUME_NONNULL_END
Java
<style> .buy-tickets__title{margin: 10px; width: 6%; margin-left: 0px;} .buy-tickets__title.ticket-title{width: 50%;} .buy-tickets__title.flash{width: 15%;} .buy-tickets__title.flash-price{width: 11%;} .form .input__number .input__number-control.sold-out{ width: 80px;height: 10px;margin: 5px;} p.error{display: none; color: #ff0000;text-align: center;margin: 10px;} .buy-tickets{ display:none } .hidden-div{ display:none; margin-bottom:0;} </style> <button onclick="getElementById('hidden-div').style.display = 'block'" style="margin-bottom: 1px"> Buy Tickets Now </button> <div class="hidden-div" id="hidden-div" style="height: 100%;"><?php echo $eventbrite;?></div> <br><br><br><br><br>
Java
// Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // These tests check that Torque-generated verifier functions crash the process // when encountering data that doesn't fit the Torque type definitions. #include "src/api/api-inl.h" #include "src/objects/descriptor-array.h" #include "src/objects/map-inl.h" #include "test/cctest/cctest.h" #include "torque-generated/class-verifiers.h" namespace v8 { namespace internal { // Defines a pair of tests with similar code. The goal is to test that a // specific action causes a failure, but that everything else in the test case // succeeds. The general pattern should be: // // TEST_PAIR(Something) { // do_setup_steps_that_always_succeed(); // if (should_fail) { // do_the_step_that_fails(); // } // do_teardown_steps_that_always_succeed(); // } // // A corresponding entry in cctest.status specifies that all Fail* tests in this // file must fail. #define TEST_PAIR(Name) \ static void Name(bool should_fail); \ TEST(Pass##Name) { Name(false); } \ TEST(Fail##Name) { Name(true); } \ static void Name(bool should_fail) #ifdef VERIFY_HEAP TEST_PAIR(TestWrongTypeInNormalField) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("({a: 3, b: 4})"); Handle<JSObject> o = Handle<JSObject>::cast(v8::Utils::OpenHandle(*v)); Handle<Object> original_elements( TaggedField<Object>::load(*o, JSObject::kElementsOffset), i_isolate); CHECK(original_elements->IsFixedArrayBase()); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Elements must be FixedArrayBase according to the Torque definition, so a // JSObject should cause a failure. TaggedField<Object>::store(*o, JSObject::kElementsOffset, *o); if (should_fail) { TorqueGeneratedClassVerifiers::JSObjectVerify(*o, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*o, JSObject::kElementsOffset, *original_elements); } TEST_PAIR(TestWrongStrongTypeInIndexedStructField) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("({a: 3, b: 4})"); Handle<Object> o = v8::Utils::OpenHandle(*v); Handle<Map> map(Handle<HeapObject>::cast(o)->map(), i_isolate); Handle<DescriptorArray> descriptors(map->instance_descriptors(kRelaxedLoad), i_isolate); int offset = DescriptorArray::OffsetOfDescriptorAt(1) + DescriptorArray::kEntryKeyOffset; Handle<Object> original_key(TaggedField<Object>::load(*descriptors, offset), i_isolate); CHECK(original_key->IsString()); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Key must be Name|Undefined according to the Torque definition, so a // JSObject should cause a failure. TaggedField<Object>::store(*descriptors, offset, *o); if (should_fail) { TorqueGeneratedClassVerifiers::DescriptorArrayVerify(*descriptors, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*descriptors, offset, *original_key); } TEST_PAIR(TestWrongWeakTypeInIndexedStructField) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("({a: 3, b: 4})"); Handle<Object> o = v8::Utils::OpenHandle(*v); Handle<Map> map(Handle<HeapObject>::cast(o)->map(), i_isolate); Handle<DescriptorArray> descriptors(map->instance_descriptors(kRelaxedLoad), i_isolate); int offset = DescriptorArray::OffsetOfDescriptorAt(0) + DescriptorArray::kEntryValueOffset; Handle<Object> original_value(TaggedField<Object>::load(*descriptors, offset), i_isolate); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Value can be JSAny, which includes JSObject, and it can be Weak<Map>, but // it can't be Weak<JSObject>. TaggedField<Object>::store(*descriptors, offset, *o); TorqueGeneratedClassVerifiers::DescriptorArrayVerify(*descriptors, i_isolate); MaybeObject weak = MaybeObject::MakeWeak(MaybeObject::FromObject(*o)); TaggedField<MaybeObject>::store(*descriptors, offset, weak); if (should_fail) { TorqueGeneratedClassVerifiers::DescriptorArrayVerify(*descriptors, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*descriptors, offset, *original_value); } TEST_PAIR(TestWrongOddball) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("new Date()"); Handle<JSDate> date = Handle<JSDate>::cast(v8::Utils::OpenHandle(*v)); Handle<Object> original_hour( TaggedField<Object>::load(*date, JSDate::kHourOffset), i_isolate); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Hour is Undefined|Smi|NaN. Other oddballs like null should cause a failure. TaggedField<Object>::store(*date, JSDate::kHourOffset, *i_isolate->factory()->null_value()); if (should_fail) { TorqueGeneratedClassVerifiers::JSDateVerify(*date, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*date, JSDate::kHourOffset, *original_hour); } TEST_PAIR(TestWrongNumber) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("new Date()"); Handle<JSDate> date = Handle<JSDate>::cast(v8::Utils::OpenHandle(*v)); Handle<Object> original_hour( TaggedField<Object>::load(*date, JSDate::kHourOffset), i_isolate); v8::Local<v8::Value> v2 = CompileRun("1.1"); Handle<Object> float_val = v8::Utils::OpenHandle(*v2); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Hour is Undefined|Smi|NaN. Other doubles like 1.1 should cause a failure. TaggedField<Object>::store(*date, JSDate::kHourOffset, *float_val); if (should_fail) { TorqueGeneratedClassVerifiers::JSDateVerify(*date, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*date, JSDate::kHourOffset, *original_hour); } #endif // VERIFY_HEAP #undef TEST_PAIR } // namespace internal } // namespace v8
Java
from django import template from django.utils.safestring import mark_safe from mezzanine.conf import settings from mezzanine_developer_extension.utils import refactor_html register = template.Library() # Checking settings.TEMPLATE_STYLE. # Possible values are: # - mezzanine_developer_extension.styles.macos # - mezzanine_developer_extension.styles.ubuntu # - mezzanine_developer_extension.styles.windows _prefix = "mezzanine_developer_extension.styles" try: if settings.TERMINAL_STYLE not in \ ["%s.macos" % _prefix, "%s.ubuntu" % _prefix, "%s.windows" % _prefix]: # If the user has specified a wrong terminal styling format, we # raise an exception warning about this. msg = "Wrong terminal style format. Check the value of TERMINAL_STYLE"\ " in your settings.py file." raise Exception(msg) except AttributeError: msg = "You have not specified a terminal output format. You have to"\ " define the attribute TERMINAL_STYLE in your settings.py" raise Exception(msg) @register.filter(name='safe_developer') def safe_developer(content, style="macos"): """ Renders content without cleaning the original. Replaces the terminal divs for a more complext html layout. """ new_content = refactor_html(content, style) return mark_safe(new_content)
Java
#pragma once //=====================================================================// /*! @file @brief R8C グループ・コンパレーター I/O 制御 @author 平松邦仁 (hira@rvf-rc45.net) @copyright Copyright (C) 2015, 2017 Kunihito Hiramatsu @n Released under the MIT license @n https://github.com/hirakuni45/R8C/blob/master/LICENSE */ //=====================================================================// #include "common/vect.h" #include "M120AN/system.hpp" #include "M120AN/intr.hpp" #include "M120AN/comp.hpp" namespace device { //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// /*! @brief コンパレーター・フィルター */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// enum class comp_filter { none, ///< 無し f1, f8, f32 }; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// /*! @brief コンパレーター・エッジ */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// enum class comp_edge { a_lt_r, ///< アナログ入力が基準入力より低い時 a_gt_r, ///< アナログ入力が基準入力より高い時 ltgt = 3, ///< 低いおよび高い時 }; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// /*! @brief コンパレーター I/O 制御クラス @param[in] TASK1 コンパレーター1割り込み処理 @param[in] TASK3 コンパレーター3割り込み処理 */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// template <class TASK1, class TASK3> class comp_io { static TASK1 task1_; static TASK3 task3_; public: static inline void itask1() { task1_(); WCB1INTR.WCB1F = 0; } static inline void itask3() { task3_(); WCB3INTR.WCB3F = 0; } public: //-----------------------------------------------------------------// /*! @brief コンストラクター */ //-----------------------------------------------------------------// comp_io() { } //-----------------------------------------------------------------// /*! @brief チャネル1開始 @param[in] et 比較モード @para,[in] fl フィルター */ //-----------------------------------------------------------------// void start1(comp_edge eg = comp_edge::ltgt, comp_filter fl = comp_filter::none, uint8_t ir_lvl = 0) const { WCMPR.WCB1M0 = 1; ILVL2.B01 = ir_lvl; if(ir_lvl) { WCB1INTR.WCB1FL = static_cast<uint8_t>(fl); WCB1INTR.WCB1S = static_cast<uint8_t>(eg); WCB1INTR.WCB1INTEN = 1; } else { WCB1INTR.WCB1INTEN = 0; } } //-----------------------------------------------------------------// /*! @brief チャネル3開始 @param[in] et 比較モード @para,[in] fl フィルター */ //-----------------------------------------------------------------// void start3(comp_edge eg = comp_edge::ltgt, comp_filter fl = comp_filter::none, uint8_t ir_lvl = 0) const { WCMPR.WCB3M0 = 1; ILVL2.B45 = ir_lvl; if(ir_lvl) { WCB3INTR.WCB3FL = static_cast<uint8_t>(fl); WCB3INTR.WCB3S = static_cast<uint8_t>(eg); WCB3INTR.WCB3INTEN = 1; } else { WCB3INTR.WCB3INTEN = 0; } } //-----------------------------------------------------------------// /*! @brief チャネル1出力を取得 @return チャネル1出力 */ //-----------------------------------------------------------------// bool get_value1() const { return WCMPR.WCB1OUT(); } //-----------------------------------------------------------------// /*! @brief チャネル3出力を取得 @return チャネル3出力 */ //-----------------------------------------------------------------// bool get_value3() const { return WCMPR.WCB3OUT(); } }; }
Java
./scidb2postgres -i data/fromSciDBIntDoubleString.bin -o data/toPostgresIntDoubleString.bin -f'int32_t,int32_t null,double,double null,string,string null'
Java
To update Mongo to Version 4.0 you must first upgrade to 3.6 then to version 4.0 as follows 1. Install 3.6 Binary 2. Close mongo and mongod 3. Start mongo and mongod in 3.6 bin folder 4. run command db.adminCommand({setFeatureCompatibilityVersion: "3.6"}) 1. Install 4.0 Binary 2. Close mongo and mongod 3. Start mongo and mongod in 3.6 bin folder 4. run command db.adminCommand({setFeatureCompatibilityVersion: "4.0"})
Java
/* Copyright (c) 2003-2014, Arvid Norberg All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <vector> #include <list> #include <cctype> #include <algorithm> #include "libtorrent/config.hpp" #include "libtorrent/gzip.hpp" #include "libtorrent/socket_io.hpp" #ifdef _MSC_VER #pragma warning(push, 1) #endif #include <boost/bind.hpp> #ifdef _MSC_VER #pragma warning(pop) #endif #include "libtorrent/tracker_manager.hpp" #include "libtorrent/http_tracker_connection.hpp" #include "libtorrent/http_connection.hpp" #include "libtorrent/entry.hpp" #include "libtorrent/bencode.hpp" #include "libtorrent/torrent.hpp" #include "libtorrent/io.hpp" #include "libtorrent/socket.hpp" #include "libtorrent/aux_/session_impl.hpp" #include "libtorrent/broadcast_socket.hpp" // for is_local using namespace libtorrent; namespace libtorrent { #if TORRENT_USE_I2P // defined in torrent_info.cpp bool is_i2p_url(std::string const& url); #endif http_tracker_connection::http_tracker_connection( io_service& ios , connection_queue& cc , tracker_manager& man , tracker_request const& req , boost::weak_ptr<request_callback> c , aux::session_impl& ses , std::string const& auth #if TORRENT_USE_I2P , i2p_connection* i2p_conn #endif ) : tracker_connection(man, req, ios, c) , m_man(man) , m_ses(ses) , m_cc(cc) , m_ios(ios) #if TORRENT_USE_I2P , m_i2p_conn(i2p_conn) #endif {} void http_tracker_connection::start() { // TODO: 0 support authentication (i.e. user name and password) in the URL std::string url = tracker_req().url; if (tracker_req().kind == tracker_request::scrape_request) { // find and replace "announce" with "scrape" // in request std::size_t pos = url.find("announce"); if (pos == std::string::npos) { tracker_connection::fail(error_code(errors::scrape_not_available)); return; } url.replace(pos, 8, "scrape"); } #if TORRENT_USE_I2P bool i2p = is_i2p_url(url); #else static const bool i2p = false; #endif aux::session_settings const& settings = m_ses.settings(); // if request-string already contains // some parameters, append an ampersand instead // of a question mark size_t arguments_start = url.find('?'); if (arguments_start != std::string::npos) url += "&"; else url += "?"; if (tracker_req().kind == tracker_request::announce_request) { const char* event_string[] = {"completed", "started", "stopped", "paused"}; char str[1024]; const bool stats = tracker_req().send_stats; snprintf(str, sizeof(str) , "info_hash=%s" "&peer_id=%s" "&port=%d" "&uploaded=%" PRId64 "&downloaded=%" PRId64 "&left=%" PRId64 "&corrupt=%" PRId64 "&key=%08X" "%s%s" // event "&numwant=%d" "&compact=1" "&no_peer_id=1" , escape_string((const char*)&tracker_req().info_hash[0], 20).c_str() , escape_string((const char*)&tracker_req().pid[0], 20).c_str() // the i2p tracker seems to verify that the port is not 0, // even though it ignores it otherwise , i2p ? 1 : tracker_req().listen_port , stats ? tracker_req().uploaded : 0 , stats ? tracker_req().downloaded : 0 , stats ? tracker_req().left : 0 , stats ? tracker_req().corrupt : 0 , tracker_req().key , (tracker_req().event != tracker_request::none) ? "&event=" : "" , (tracker_req().event != tracker_request::none) ? event_string[tracker_req().event - 1] : "" , tracker_req().num_want); url += str; #ifndef TORRENT_DISABLE_ENCRYPTION if (m_ses.settings().get_int(settings_pack::in_enc_policy) != settings_pack::pe_disabled && m_ses.settings().get_bool(settings_pack::announce_crypto_support)) url += "&supportcrypto=1"; #endif if (stats && m_ses.settings().get_bool(settings_pack::report_redundant_bytes)) { url += "&redundant="; url += to_string(tracker_req().redundant).elems; } if (!tracker_req().trackerid.empty()) { std::string id = tracker_req().trackerid; url += "&trackerid="; url += escape_string(id.c_str(), id.length()); } #if TORRENT_USE_I2P if (i2p) { url += "&ip="; url += escape_string(m_i2p_conn->local_endpoint().c_str() , m_i2p_conn->local_endpoint().size()); url += ".i2p"; } else #endif if (!m_ses.settings().get_bool(settings_pack::anonymous_mode)) { std::string announce_ip = settings.get_str(settings_pack::announce_ip); if (!announce_ip.empty()) { url += "&ip=" + escape_string(announce_ip.c_str(), announce_ip.size()); } else if (m_ses.settings().get_bool(settings_pack::announce_double_nat) && is_local(m_ses.listen_address())) { // only use the global external listen address here // if it turned out to be on a local network // since otherwise the tracker should use our // source IP to determine our origin url += "&ip=" + print_address(m_ses.listen_address()); } } } m_tracker_connection.reset(new http_connection(m_ios, m_cc, m_ses.m_host_resolver , boost::bind(&http_tracker_connection::on_response, self(), _1, _2, _3, _4) , true, settings.get_int(settings_pack::max_http_recv_buffer_size) , boost::bind(&http_tracker_connection::on_connect, self(), _1) , boost::bind(&http_tracker_connection::on_filter, self(), _1, _2) #ifdef TORRENT_USE_OPENSSL , tracker_req().ssl_ctx #endif )); int timeout = tracker_req().event==tracker_request::stopped ?settings.get_int(settings_pack::stop_tracker_timeout) :settings.get_int(settings_pack::tracker_completion_timeout); // when sending stopped requests, prefer the cached DNS entry // to avoid being blocked for slow or failing responses. Chances // are that we're shutting down, and this should be a best-effort // attempt. It's not worth stalling shutdown. proxy_settings ps = m_ses.proxy(); m_tracker_connection->get(url, seconds(timeout) , tracker_req().event == tracker_request::stopped ? 2 : 1 , &ps, 5, settings.get_bool(settings_pack::anonymous_mode) ? "" : settings.get_str(settings_pack::user_agent) , bind_interface() , tracker_req().event == tracker_request::stopped ? resolver_interface::prefer_cache : 0 #if TORRENT_USE_I2P , m_i2p_conn #endif ); // the url + 100 estimated header size sent_bytes(url.size() + 100); #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) boost::shared_ptr<request_callback> cb = requester(); if (cb) { cb->debug_log("==> TRACKER_REQUEST [ url: %s ]", url.c_str()); } #endif } void http_tracker_connection::close() { if (m_tracker_connection) { m_tracker_connection->close(); m_tracker_connection.reset(); } tracker_connection::close(); } void http_tracker_connection::on_filter(http_connection& c, std::vector<tcp::endpoint>& endpoints) { if (tracker_req().apply_ip_filter == false) return; // remove endpoints that are filtered by the IP filter for (std::vector<tcp::endpoint>::iterator i = endpoints.begin(); i != endpoints.end();) { if (m_ses.m_ip_filter.access(i->address()) == ip_filter::blocked) i = endpoints.erase(i); else ++i; } #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) boost::shared_ptr<request_callback> cb = requester(); if (cb) { cb->debug_log("*** TRACKER_FILTER"); } #endif if (endpoints.empty()) fail(error_code(errors::banned_by_ip_filter)); } void http_tracker_connection::on_connect(http_connection& c) { error_code ec; tcp::endpoint ep = c.socket().remote_endpoint(ec); m_tracker_ip = ep.address(); boost::shared_ptr<request_callback> cb = requester(); } void http_tracker_connection::on_response(error_code const& ec , http_parser const& parser, char const* data, int size) { // keep this alive boost::intrusive_ptr<http_tracker_connection> me(this); if (ec && ec != asio::error::eof) { fail(ec); return; } if (!parser.header_finished()) { fail(asio::error::eof); return; } if (parser.status_code() != 200) { fail(error_code(parser.status_code(), get_http_category()) , parser.status_code(), parser.message().c_str()); return; } if (ec && ec != asio::error::eof) { fail(ec, parser.status_code()); return; } received_bytes(size + parser.body_start()); // handle tracker response error_code ecode; boost::shared_ptr<request_callback> cb = requester(); if (!cb) { close(); return; } tracker_response resp = parse_tracker_response(data, size, ecode , tracker_req().kind == tracker_request::scrape_request , tracker_req().info_hash); if (!resp.warning_message.empty()) cb->tracker_warning(tracker_req(), resp.warning_message); if (ecode) { fail(ecode, parser.status_code()); close(); return; } if (!resp.failure_reason.empty()) { fail(error_code(errors::tracker_failure), parser.status_code() , resp.failure_reason.c_str(), resp.interval, resp.min_interval); close(); return; } // do slightly different things for scrape requests if (tracker_req().kind == tracker_request::scrape_request) { cb->tracker_scrape_response(tracker_req(), resp.complete , resp.incomplete, resp.downloaded, resp.downloaders); } else { std::list<address> ip_list; if (m_tracker_connection) { error_code ec; ip_list.push_back( m_tracker_connection->socket().remote_endpoint(ec).address()); std::vector<tcp::endpoint> const& epts = m_tracker_connection->endpoints(); for (std::vector<tcp::endpoint>::const_iterator i = epts.begin() , end(epts.end()); i != end; ++i) { ip_list.push_back(i->address()); } } cb->tracker_response(tracker_req(), m_tracker_ip, ip_list, resp); } close(); } bool extract_peer_info(lazy_entry const& info, peer_entry& ret, error_code& ec) { // extract peer id (if any) if (info.type() != lazy_entry::dict_t) { ec.assign(errors::invalid_peer_dict, get_libtorrent_category()); return false; } lazy_entry const* i = info.dict_find_string("peer id"); if (i != 0 && i->string_length() == 20) { std::copy(i->string_ptr(), i->string_ptr()+20, ret.pid.begin()); } else { // if there's no peer_id, just initialize it to a bunch of zeroes std::fill_n(ret.pid.begin(), 20, 0); } // extract ip i = info.dict_find_string("ip"); if (i == 0) { ec.assign(errors::invalid_tracker_response, get_libtorrent_category()); return false; } ret.hostname = i->string_value(); // extract port i = info.dict_find_int("port"); if (i == 0) { ec.assign(errors::invalid_tracker_response, get_libtorrent_category()); return false; } ret.port = (unsigned short)i->int_value(); return true; } tracker_response parse_tracker_response(char const* data, int size, error_code& ec , bool scrape_request, sha1_hash scrape_ih) { tracker_response resp; lazy_entry e; int res = lazy_bdecode(data, data + size, e, ec); if (ec) return resp; if (res != 0 || e.type() != lazy_entry::dict_t) { ec.assign(errors::invalid_tracker_response, get_libtorrent_category()); return resp; } int interval = int(e.dict_find_int_value("interval", 0)); // if no interval is specified, default to 30 minutes if (interval == 0) interval = 1800; int min_interval = int(e.dict_find_int_value("min interval", 30)); resp.interval = interval; resp.min_interval = min_interval; lazy_entry const* tracker_id = e.dict_find_string("tracker id"); if (tracker_id) resp.trackerid = tracker_id->string_value(); // parse the response lazy_entry const* failure = e.dict_find_string("failure reason"); if (failure) { resp.failure_reason = failure->string_value(); ec.assign(errors::tracker_failure, get_libtorrent_category()); return resp; } lazy_entry const* warning = e.dict_find_string("warning message"); if (warning) resp.warning_message = warning->string_value(); if (scrape_request) { lazy_entry const* files = e.dict_find_dict("files"); if (files == 0) { ec.assign(errors::invalid_files_entry, get_libtorrent_category()); return resp; } lazy_entry const* scrape_data = files->dict_find_dict( scrape_ih.to_string()); if (scrape_data == 0) { ec.assign(errors::invalid_hash_entry, get_libtorrent_category()); return resp; } resp.complete = int(scrape_data->dict_find_int_value("complete", -1)); resp.incomplete = int(scrape_data->dict_find_int_value("incomplete", -1)); resp.downloaded = int(scrape_data->dict_find_int_value("downloaded", -1)); resp.downloaders = int(scrape_data->dict_find_int_value("downloaders", -1)); return resp; } // look for optional scrape info resp.complete = int(e.dict_find_int_value("complete", -1)); resp.incomplete = int(e.dict_find_int_value("incomplete", -1)); resp.downloaded = int(e.dict_find_int_value("downloaded", -1)); lazy_entry const* peers_ent = e.dict_find("peers"); if (peers_ent && peers_ent->type() == lazy_entry::string_t) { char const* peers = peers_ent->string_ptr(); int len = peers_ent->string_length(); resp.peers4.reserve(len / 6); for (int i = 0; i < len; i += 6) { if (len - i < 6) break; ipv4_peer_entry p; error_code ec; p.ip = detail::read_v4_address(peers).to_v4().to_bytes(); p.port = detail::read_uint16(peers); resp.peers4.push_back(p); } } else if (peers_ent && peers_ent->type() == lazy_entry::list_t) { int len = peers_ent->list_size(); resp.peers.reserve(len); error_code parse_error; for (int i = 0; i < len; ++i) { peer_entry p; if (!extract_peer_info(*peers_ent->list_at(i), p, parse_error)) continue; resp.peers.push_back(p); } // only report an error if all peer entries are invalid if (resp.peers.empty() && parse_error) { ec = parse_error; return resp; } } else { peers_ent = 0; } #if TORRENT_USE_IPV6 lazy_entry const* ipv6_peers = e.dict_find_string("peers6"); if (ipv6_peers) { char const* peers = ipv6_peers->string_ptr(); int len = ipv6_peers->string_length(); resp.peers6.reserve(len / 18); for (int i = 0; i < len; i += 18) { if (len - i < 18) break; ipv6_peer_entry p; p.ip = detail::read_v6_address(peers).to_v6().to_bytes(); p.port = detail::read_uint16(peers); resp.peers6.push_back(p); } } else { ipv6_peers = 0; } #else lazy_entry const* ipv6_peers = 0; #endif /* // if we didn't receive any peers. We don't care if we're stopping anyway if (peers_ent == 0 && ipv6_peers == 0 && tracker_req().event != tracker_request::stopped) { ec.assign(errors::invalid_peers_entry, get_libtorrent_category()); return resp; } */ lazy_entry const* ip_ent = e.dict_find_string("external ip"); if (ip_ent) { char const* p = ip_ent->string_ptr(); if (ip_ent->string_length() == int(address_v4::bytes_type().size())) resp.external_ip = detail::read_v4_address(p); #if TORRENT_USE_IPV6 else if (ip_ent->string_length() == int(address_v6::bytes_type().size())) resp.external_ip = detail::read_v6_address(p); #endif } return resp; } }
Java
<?php /** * Gem - File Uploading for Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE. * * @category Gem * @package Gem_Manipulator * @copyright Copyright (c) 2008 Johan Nilsson. (http://www.markupartist.com) * @license New BSD License */ require_once 'Gem/Manipulator/Adapter/Interface.php'; require_once 'Gem/Manipulator/Adapter/Exception.php'; /** * @category Gem * @package Gem_Manipulator */ class Gem_Manipulator_Adapter_Thumbnail implements Gem_Manipulator_Adapter_Interface { /** * Perfoms manipulation * * @param string $from * @param string $to * @param string $options * @return void */ public function manipulate($from, $to, $options) { if (false === class_exists('Thumbnail')) { throw new Gem_Manipulator_Adapter_Exception('Class Thumbnail could not be loaded'); } if (!isset($options['geometry'])) { throw new Gem_Manipulator_Adapter_Exception('Thumbnail requires the \'geometry\' option to be set'); } $matches = array(); preg_match('/(c)?([0-9]+)x([0-9]+)/', $options['geometry'], $matches); $crop = empty($matches[1]) ? false : true; $width = $matches[2]; $height = $matches[3]; if (empty($matches[2])) { throw new Gem_Manipulator_Adapter_Exception('Invalid geometry pattern \'' . $options['geometry'] . '\''); } if (empty($matches[3])) { throw new Gem_Manipulator_Adapter_Exception('Invalid geometry pattern \'' . $options['geometry'] . '\''); } $thumbnail = new Thumbnail($from); // TODO: Fix error handling around this... $quality = 80; if (false == $crop) { $thumbnail->resize($width, $height); $quality = 100; } else if ($width == $height) { // Well works for now... the crop for ImageTransform is a bit better // but who cares? $thumbnail->cropFromCenter($width); } else { $thumbnail->crop(0, 0, $width, $height); } $thumbnail->save($to, $quality); } }
Java
<?php use yii\helpers\Url; ?> <div class="bjui-pageContent"> <form action="<?= Url::toRoute([$model?'update':'create','name'=>$model?$model->name:'']) ?>" id="user_form" data-toggle="validate" data-alertmsg="false"> <input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>"> <table class="table table-condensed table-hover" width="100%"> <tbody> <tr> <td><label for="name" class="control-label x120">规则名称:</label> <input type="text" name="name" id="name" value="<?= $model?$model->name:''; ?>" data-rule="required" size="20"></td> </tr> <tr> <td><label for="class" class="control-label x120">规则类名:</label> <input type="text" name="class" id="class" value="<?= $model?$model::className():''; ?>" data-rule="required" size="35"></td> </tr> </tbody> </table> </form> </div> <div class="bjui-pageFooter"> <ul> <li> <button type="button" class="btn-close" data-icon="close">取消</button> </li> <li> <button type="submit" class="btn-default" data-icon="save">保存</button> </li> </ul> </div>
Java
// // BenthosLibraryTableCell.h // SeafloorExplore // // Modified from Brad Larson's Molecules Project in 2011-2012 for use in The SeafloorExplore Project // // Copyright (C) 2012 Matthew Johnson-Roberson // // See COPYING for license details // // Molecules // // The source code for Molecules is available under a BSD license. See COPYING for details. // // Created by Brad Larson on 4/30/2011. // #import <UIKit/UIKit.h> #import <QuartzCore/QuartzCore.h> @interface BenthosLibraryTableCell : UITableViewCell { CAGradientLayer *highlightGradientLayer; BOOL isSelected; } @property(assign, nonatomic) CAGradientLayer *highlightGradientLayer; @property(assign, nonatomic) BOOL isSelected; @end
Java
--- --- # Migration Guide 2.x to 3.0 ## General ### Removed ui object The `ui` object (`tabris.ui`) and `Ui` class no longer exist. All properties formerly hosted by `ui` are now directly attached to the `tabris` object/namespace. Example: Tabris 2.x ```js import {ui} from 'tabris'; ui.contentView.background = 'red'; ui.drawer.background = 'red'; ui.statusBar.background = 'red'; ui.navigationBar.background = 'red'; ``` Tabris 3.0 ```js import {contentView, drawer, statusBar, navigationBar} from 'tabris'; contentView.background = 'red'; drawer.background = 'red'; statusBar.background = 'red'; navigationBar.background = 'red'; ``` ### Removed `get("prop")` and `set("prop", value)` This concerns all instances of `NativeObject` (including widgets) and `WidgetCollection`. The `set` method still exists, but now only takes one argument (the properties object). The `get` method has been removed entirely. #### Alternatives for `set("prop", value)`: On both `NativeObject` and `WidgetCollection`, `obj.set('foo', baz)` can be replaced with `obj.set({foo: baz})`, and `obj.set(bar, baz)` can be replaced with `obj.set({[foo]: baz})`. On `NativeObject` only, `obj.set('foo', baz)` can be replaced with `obj.foo = baz`, and `obj.set(bar, baz)` can be replaced with `obj[bar] = baz`. #### Alternatives for `get("prop")`: On `NativeObject`, `bar = obj.get('foo')` can be replaced with `bar = obj.foo`, and `baz = obj.get(bar)` can be replaced with `baz = obj[bar]`. On `WidgetCollection`, `bar = wc.get('foo');` can be replaced with `bar = wc.first().foo`, and `baz = wc.get(bar)` can be replaced with `baz = wc.first()[bar]`. ### app.installPatch removed You can no longer patch your application using this method. ### AlertDialog textInputs property is now a ContentView Instead of assigning `TextInputs` widgets to that property they need to be appended: Old: ```js alertDialog.textInputs = [new TextInput()]; ``` New: ```js alertDialog.textInputs.append(new TextInput()); ``` Alternatively JSX my be used: ```jsx <AlertDialog> <TextInput/> </AlertDialog> ``` ### Removed properties "placementPriority" of Action and "navigationAction" of NavigationView These properties are replaced by a new property `placement` on the `Action` widget. It accepts the values `'default'` (same as `placementPriority = 'normal'`), `'overflow'` (same as a `placementPriority = 'low'`) and `'navigation'`, which puts the action in the place usually reserved by the drawer icon. ### Removed property `topToolbarHeight` and `bottomToolbarHeight` on `NavigationView` On iOS a toolbar at the bottom of a `NavigationView` has been used for actions with low priority. With the introduction of the new `Action` `placement` property the bottom toolbar has been removed along with the respective properties `topToolbarHeight` and `bottomToolbarHeight`. In their place a new property `toolbarHeight` has been added. ### Removed widgetCollection.find This method has been removed due to its ambiguous nature. This does not affect `composite.find` which still exists. ### "trigger" object/eventObject parameter is now cloned **This is relevant only if in your application you are passing values to `trigger` of types other than `Object` or `EventObject`.** Examples would be passing primitives (e.g. `trigger('select', selectionIndex);`) or instances of classes other than `Object` (e.g. `trigger('select', someArray);`). If you do that you need to change this to pass an object that references the value instead (e.g. `trigger('select', {selectionIndex});`) Previously the second parameter of the `trigger` method was directly passed on to all listeners in all cases. However, we want to ensure that listeners can always expect to be called with a valid `EventObject` instance. For that reason the values of the `trigger` parameter are now copied to a new event object, *unless* the given parameter is already an instance of `EventObject` and has not been initialized yet. ### Color properties All color properties are now of the type `ColorValue`. While these properties still accept the same string values as in 2.x, they will return a "Color" class instance instead of a string. The exception is CanvasContext, where color properties still return a string for W3C compatibility. ### Widget.background property Widget background setter now also accepts `ColorValue`, `ImageValue`, and `LinearGradientValue` values and the getter will return instances of the "Color", "Image" and "LinearGradient" classes. ### Widget.backgroundImage property removed You can now set images directly on the `background` property. ### alignment properties All widget `alignment` properties (on `Button`, `TextInput`, `TextView` and `ToggleButton`) now expect `centerX` instead of `center`. ### TabFolder.textColor property replaced with more flexible properties The `TabFolder.textColor` property has been replaced with a set of new properties which provide more control over the appearance of the TabFolder tabs: - `tabTintColor` - `selectedTabTintColor` - `tabBarBackground` - `selectedTabIndicatorTintColor` In addition the `TabFolder` gained the property `tabBarElevation` which is applicable on Android. ### Tab.badge property changed to be of type number instead of string With the added support for `badge` on Android, the type of the `badge` property has been updated to be a number: ```js tab.badge = 10 ``` ### CollectionView select event removed The collectionView no longer provides a select event. Interactions with a cell have to be handled directly by listeners attached to the cell. A new method `itemIndex` may be used to determine the index associated with a cell: ```js collectionView.createCell = () => { const cell = new SomeWidget(); cell.onTap(() => { const index = cell.parent(CollectionView).itemIndex(cell); // do something with the item... }); return cell; } ``` ### Picker allows empty state with "message" property as placeholder The `Picker` now allows to show an (initial) empty state. This unselected state can be filled with a `message` text similar to a `TextInput`. The initial `selectionIndex` is therefore `-1`. It can also be set to `-1` which shows the empty state or the `message` respectively. To recreate the previous behavior the `selectionIndex` could be set to `0`. ### Picker property "fillColor" removed With the introduction of the new `style` property on `Picker`, the iOS only property `fillColor` became redundant. Previously the `fillColor` was required to separate the Android underline colorization from the ios picker background color. Setting the `Picker` `style` to _underline_ on Android now ignores the background and only applies the `borderColor` property. ### Font properties All font properties are now of the type "FontValue". While these properties still accept the same string values as in 2.x, they will return a "Font" class instance instead of a string. The exception is CanvasContext, where font properties still return a string for W3C compatibility. ### Image properties All image properties are now of the type "ImageValue". While these properties still accept the same string values as in 2.x, they will return an "Image" class instance instead of a string. ### Gesture event "longpress" renamed to "longPress" To be consistent with the event naming scheme of gesture events, the event "longpress" has been renamed to "longPress". ### TextInput property "fillColor" removed With the introduction of the new `style` property on `TextInput`, the iOS only property `fillColor` became redundant. Previously the `fillColor` was required to separate the Android underline colorization from the ios input background color. Setting the `TextInput` `style` to _underline_ on Android now ignores the background and only applies the `borderColor` property. ## TypeScript ### Properties interfaces removed The `tabris` module no longer exports a separate properties interfaces for every built-in type. These can be replaced with the generic `Properties` type: `CompositeProperties` `=>` `Properties<Composite>` ### "tsProperties" property no longer supported It is no longer necessary or supported to create a property `tsProperties` on classes inheriting from `Widget` to control the properties accepted by the `set` method. In most cases public properties are recognized by `set` automatically. That excludes methods/functions. When called on `this` the supported properties can not be inferred. To fix this the `set` method can be overwritten/re-declared, or it may be called with the appropriate generic type like this: `this.set<MyComponent>({propA: valueA});` ### type "Partial" The helper type `Partial<T, U>` was removed to avoid confusion with the `Partial` type built in to newer TypeScript versions. It can be replaced with `Partial<Pick<T, U>>`. ### CollectionView is generic The `CollectionView` is now a generic type `CollectionView<Cell extends Widget>`, where `Cell` is the type of widget returned by the `createCell` callback. All occurrences of `CollectionView` as a type should be replaced with the appropriate generic version, e.g. `CollectionView<Composite>`. ### types "dimension" and "offset" Types "dimension" and "offset" have been renamed to start with an upper case. Type "margin" has been replaced with "ConstraintValue", which includes the former "margin" type. ### LayoutData and related properties The `layoutData` property is now of the type `LayoutDataValue`. The values that were accepted in 2.x are still accepted, with one exception: It was previously possible to give a percentage as a number type within a `margin` (now `ConstraintValue`) type array, i.e. `[number, number]`. However, this was an undocumented feature, as the documentation stated: > "All **percentages** are provided as strings with a percent suffix, e.g. `"50%"`." All percentages are now of the `PercentValue` type, i.e. a string like `"50%"`, an instance of the `Percent` class, or a `Percent`-like object, e.g. `{percent: 50}`. The return value of the `layoutData` property is now always an instance of the `LayoutData` class instead of a plain object. The shorthand properties to `layoutData` now also return the normalized types used in the `LayoutData` class, i.e. an instance of `Constraint` (for `left`, `right`, `top` and `bottom`) or `SiblingReference` (for `baseline`), a number (for `width`, `height`, `centerX` and `centerY`), or `"auto"` (the default for all of these). In 2.x, negative edge offsets were previously supported on some platforms. To prevent inconsistent layouts among platforms, they are not supported anymore. ### Event handling The methods `on` and `once` no longer have widget-specific parameters, meaning they are not type-safe anymore. Strictly speaking this is not a breaking change, but it is strongly recommended to switch to the new (type safe) `Listeners` API as soon as possible. Some examples: `widget.on('resize', listener)` and `widget.on({resize: listener})` become `widget.onResize(listener)`. `widget.off('resize', listener)` becomes `widget.onResize.removeListener(listener)`. `widget.once('resize', listener)` becomes `widget.onResize.once(listener)`. ## JSX ### Elements need to be imported Tabris no longer provides "intrinsic" elements. This means that instead of creating a built-in widget via a lowercase element it has to be done by referencing the actual widget class. Example: This... ```jsx import { ui } from 'tabris'; ui.contentView.append(<textView text='foo'/>); ``` has to be changed to: ```jsx import { contentView, TextView } from 'tabris'; contentView.append(<TextView text='foo' />); ``` Only widgets actually supporting different fonts now have a font property. Most applications should not have to adjust to this change. ### jsxProperties It used to be necessary to declare this property to add JSX attributes to a custom component. This now happens automatically. The mechanism itself is still present, but the property is now named `jsxAttributes` to make it distinct from the properties of the created object. Declaring `jsxAttributes` may sometimes be be necessary because properties that are either functions or are marked as readonly are not available as JSX attributes by default. ## Cordova plugins The Cordova CLI dependency has been updated from `6.5.0` to `8.1.2`. The Cordova CLI will now use the system `npm` to install plugins. This has following implications: * Plugins need to provide a `package.json` in their root directory. * Plugins in package [subdirectories](https://cordova.apache.org/docs/en/6.x/reference/cordova-cli/index.html#plugin-spec) are not supported anymore. ## Android custom theme Creating a custom theme follows the same approach as in 2.x but the paths to the theme.xml file has been changed slightly due to the migration to cordova-android 8.0. Declared theme.xml resource files need to be prefixed with with `app/src/main/`, e.g.: ``` <resource-file src="res/android/values/my_theme.xml" target="res/values/my_theme.xml" /> ``` should be changed to: ``` <resource-file src="res/android/values/my_theme.xml" target="app/src/main/res/values/my_theme.xml" /> ``` For more details on Android custom themes see: https://docs.tabris.com/3.0/theming-android.html
Java
/* Copyright (C) 2011 uberspot * * Compiling: znc-buildmod urlbuffer.cpp * Dependencies: curl, wget, sed and a unix environment. * * 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 (http://www.gnu.org/licenses/gpl.txt). */ #include "main.h" #include "User.h" #include "Nick.h" #include "Modules.h" #include "Chan.h" #include "FileUtils.h" #include <pthread.h> #include <climits> #define MAX_EXTS 6 #define MAX_CHARS 16 class CUrlBufferModule : public CModule { private: VCString lastUrls, nicks; unsigned int linkNum; CString target; static const string supportedExts[MAX_EXTS]; static const char unSupportedChars[MAX_CHARS]; static inline CString getStdoutFromCommand(const CString& cmd); inline void LoadDefaults(); inline CString convertTime(const CString& str) { time_t curtime; tm* timeinfo; char buffer[1024]; time(&curtime); curtime += (time_t) (m_pUser->GetTimezoneOffset() * 60 * 60); timeinfo = localtime(&curtime); if (!strftime(buffer, sizeof(buffer), str.c_str(), timeinfo)) { return ""; } return CString(buffer); } inline bool isValidExtension(CString ext) { ext.MakeLower(); for(int i=0; i< MAX_EXTS; i++) { if( ext == supportedExts[i]) return true; } return false; } inline bool isValidDir(const string& dir) { for(int i=0; i< MAX_CHARS; i++) { if (dir.find(unSupportedChars[i]) !=string::npos) return false; } return true; } static void* sendLinks(void *ptr); inline void CheckLineForLink(const CString& sMessage, const CString& sOrigin); inline void CheckLineForTrigger(const CString& sMessage, const CString& sTarget); public: MODCONSTRUCTOR(CUrlBufferModule) {} bool OnLoad(const CString& sArgs, CString& sErrorMsg); ~CUrlBufferModule(); EModRet OnUserMsg(CString& sTarget, CString& sMessage); EModRet OnPrivMsg(CNick& Nick, CString& sMessage); EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage); void OnModCommand(const CString& sCommand); }; const string CUrlBufferModule::supportedExts[MAX_EXTS] = {"jpg", "png", "gif", "jpeg", "bmp", "tiff"} ; const char CUrlBufferModule::unSupportedChars[MAX_CHARS] = {'|', ';', '!', '@', '#', '(', ')', '<', '>', '"', '\'', '`', '~', '=', '&', '^'}; bool CUrlBufferModule::OnLoad(const CString& sArgs, CString& sErrorMsg) { LoadDefaults(); return true; } CUrlBufferModule::~CUrlBufferModule() {} CUrlBufferModule::EModRet CUrlBufferModule::OnUserMsg(CString& sTarget, CString& sMessage) { CheckLineForLink(sMessage, ""); CheckLineForTrigger(sMessage, m_pUser->GetIRCNick().GetNick()); return CONTINUE; } CUrlBufferModule::EModRet CUrlBufferModule::OnPrivMsg(CNick& Nick, CString& sMessage) { CheckLineForLink(sMessage, Nick.GetNick()); CheckLineForTrigger(sMessage, Nick.GetNick()); return CONTINUE; } CUrlBufferModule::EModRet CUrlBufferModule::OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) { CheckLineForLink(sMessage, Nick.GetNick()); CheckLineForTrigger(sMessage, Nick.GetNick()); return CONTINUE; } void CUrlBufferModule::OnModCommand(const CString& sCommand) { CString command = sCommand.Token(0).AsLower().Trim_n(); if (command == "help") { CTable CmdTable; CmdTable.AddColumn("Command"); CmdTable.AddColumn("Description"); CmdTable.AddRow(); CmdTable.SetCell("Command", "ENABLE"); CmdTable.SetCell("Description", "Activates link buffering."); CmdTable.AddRow(); CmdTable.SetCell("Command", "DISABLE"); CmdTable.SetCell("Description", "Deactivates link buffering."); CmdTable.AddRow(); CmdTable.SetCell("Command", "ENABLELOCAL"); CmdTable.SetCell("Description", "Enables downloading of each link to local directory."); CmdTable.AddRow(); CmdTable.SetCell("Command", "DISABLELOCAL"); CmdTable.SetCell("Description", "Disables downloading of each link to local directory."); CmdTable.AddRow(); CmdTable.SetCell("Command","ENABLEPUBLIC"); CmdTable.SetCell("Description", "Enables the usage of !showlinks publicly, by other users."); CmdTable.AddRow(); CmdTable.SetCell("Command","DISABLEPUBLIC"); CmdTable.SetCell("Description", "Disables the usage of !showlinks publicly, by other users."); CmdTable.AddRow(); CmdTable.SetCell("Command", "DIRECTORY <#directory>"); CmdTable.SetCell("Description", "Sets the local directory where the links will be saved."); CmdTable.AddRow(); CmdTable.SetCell("Command", "CLEARBUFFER"); CmdTable.SetCell("Description", "Empties the link buffer."); CmdTable.AddRow(); CmdTable.SetCell("Command", "BUFFERSIZE <#size>"); CmdTable.SetCell("Description", "Sets the size of the link buffer. Only integers >=0."); CmdTable.AddRow(); CmdTable.SetCell("Command", "SHOWSETTINGS"); CmdTable.SetCell("Description", "Prints all the settings."); CmdTable.AddRow(); CmdTable.SetCell("Command", "BUFFERALLLINKS"); CmdTable.SetCell("Description", "Toggles the buffering of all links or only image links."); CmdTable.AddRow(); CmdTable.SetCell("Command", "SHOWLINKS <#number>"); CmdTable.SetCell("Description", "Prints <#number> or <#buffersize> number of cached links."); CmdTable.AddRow(); CmdTable.SetCell("Command", "HELP"); CmdTable.SetCell("Description", "This help."); PutModule(CmdTable); return; }else if (command == "enable") { SetNV("enable","true",true); PutModule("Enabled buffering"); }else if (command == "disable") { SetNV("enable","false",true); PutModule("Disabled buffering"); }else if (command == "enablelocal") { if(GetNV("directory") == "") { PutModule("Directory is not set. First set a directory and then enable local caching"); return; } SetNV("enablelocal","true",true); PutModule("Enabled local caching"); }else if (command == "disablelocal") { SetNV("enablelocal", "false", true); PutModule("Disabled local caching"); }else if (command == "enablepublic") { SetNV("enablepublic", "true", true); PutModule("Enabled public usage of showlinks."); }else if (command == "disablepublic") { SetNV("enablepublic", "false", true); PutModule("Disabled public usage of showlinks."); }else if (command == "directory") { CString dir=sCommand.Token(1).Replace_n("//", "/").TrimRight_n("/") + "/"; if (!isValidDir(dir)) { PutModule("Error in directory name. Avoid using: | ; ! @ # ( ) < > \" ' ` ~ = & ^ <space> <tab>"); return; } // Check if file exists and is directory if (dir.empty() || !CFile::Exists(dir) || !CFile::IsDir(dir, false)) { PutModule("Invalid path or no write access to ["+ sCommand.Token(1) +"]."); return; } SetNV("directory", dir, true); PutModule("Directory for local caching set to " + GetNV("directory")); }else if (command == "clearbuffer") { lastUrls.clear(); nicks.clear(); }else if (command == "buffersize") { unsigned int bufSize = sCommand.Token(1).ToUInt(); if(bufSize==0 || bufSize==UINT_MAX) { PutModule("Error in buffer size. Use only integers >= 0."); return; } SetNV("buffersize", CString(bufSize), true); PutModule("Buffer size set to " + GetNV("buffersize")); }else if (command == "showsettings") { for(MCString::iterator it = BeginNV(); it != EndNV(); it++) { PutModule(it->first.AsUpper() + " : " + it->second); } }else if(command == "bufferalllinks"){ SetNV("bufferalllinks", CString(!GetNV("bufferalllinks").ToBool()), true); PutModule( CString(GetNV("bufferalllinks").ToBool()?"Enabled":"Disabled") + " buffering of all links."); }else if (command == "showlinks") { if(lastUrls.empty()) PutModule("No links were found..."); else { unsigned int maxLinks = GetNV("buffersize").ToUInt(); unsigned int size = sCommand.Token(1).ToUInt(); if(size!=0 && size<UINT_MAX) //if it was a valid number maxLinks = size; unsigned int maxSize = lastUrls.size()-1; for(unsigned int i=0; i<=maxSize && i< maxLinks; i++) { PutModule(nicks[maxSize-i] + ": " + lastUrls[maxSize-i]); } } }else { PutModule("Unknown command! Try HELP."); } } void CUrlBufferModule::LoadDefaults() { if(GetNV("enable")==""){ SetNV("enable", "true", true); } if(GetNV("enablelocal")==""){ SetNV("enablelocal", "false", true); } if(GetNV("buffersize")== ""){ SetNV("buffersize", "5", true); } if(GetNV("enablepublic")==""){ SetNV("enablepublic", "true", true); } if(GetNV("bufferalllinks")==""){ SetNV("bufferalllinks", "false", true); } } void CUrlBufferModule::CheckLineForLink(const CString& sMessage, const CString& sOrigin) { if(sOrigin != m_pUser->GetIRCNick().GetNick() && GetNV("enable").ToBool() ) { VCString words; CString output; sMessage.Split(" ", words, false, "", "", true, true); for (size_t a = 0; a < words.size(); a++) { CString& word = words[a]; if(word.Left(4) == "http" || word.Left(4) == "www.") { //if you find an image download it, save it in the www directory and keep the new link in buffer VCString tokens; word.Split("/", tokens, false, "", "", true, true); string name = tokens[tokens.size()-1]; word.Split(".", tokens, false, "", "", true, true); //if it's an image link download/upload it else just keep the link if(isValidExtension( tokens[tokens.size()-1] )) { std::stringstream ss; if( GetNV("enablelocal").ToBool()) { CString dir = GetNV("directory") + convertTime("%Y-%m-%d") + "/"; if(!CFile::Exists(dir) && !CFile::IsDir(dir, false)) { CDir::MakeDir(dir, 0755); } ss << "wget -b -O " << dir.c_str() << name <<" -q " << word.c_str() << " 2>&1"; getStdoutFromCommand(ss.str()); } ss.str(""); if (!word.WildCmp("*imgur*")) { ss << "curl -d \"image=" << word.c_str() << "\" -d \"key=5ce86e7f95d8e58b18931bf290f387be\" http://api.imgur.com/2/upload.xml | sed -n 's/.*<original>\\(.*\\)<\\/original>.*/\\1/p' 2>&1"; output = getStdoutFromCommand(ss.str()); lastUrls.push_back(output); }else { lastUrls.push_back(word); } } else if(GetNV("bufferalllinks").ToBool()){ lastUrls.push_back(word); } nicks.push_back( (sOrigin.empty())? m_pUser->GetIRCNick().GetNick() : sOrigin ); } } } } CString CUrlBufferModule::getStdoutFromCommand(const CString& cmd) { string data=""; char buffer[128]; FILE* stream = popen(cmd.c_str(), "r"); if (stream == NULL || !stream || ferror(stream)) { return "Error!"; } while (!feof(stream)) { if (fgets(buffer, 128, stream) != NULL) data.append(buffer); } pclose(stream); return data; } void *CUrlBufferModule::sendLinks(void *ptr) { CUrlBufferModule *caller = static_cast<CUrlBufferModule*> (ptr); VCString links = caller->lastUrls; VCString nicks = caller->nicks; unsigned int maxSize = links.size()-1; for(unsigned int i=0; i<=maxSize && i<caller->linkNum; i++) { sleep(2); caller->PutIRC("PRIVMSG " + caller->target + " :" + nicks[maxSize-i] + ": "+ links[maxSize-i]); } return NULL; } void CUrlBufferModule::CheckLineForTrigger(const CString& sMessage, const CString& sTarget) { if(GetNV("enablepublic").ToBool()) { VCString words; sMessage.Split(" ", words, false, "", "", true, true); for (size_t a = 0; a < words.size(); a++) { CString& word = words[a]; if(word.AsLower() == "!showlinks") { if(lastUrls.empty()) PutIRC("PRIVMSG " + sTarget + " :No links were found..."); else { unsigned int maxLinks = GetNV("buffersize").ToUInt(); if (a+1 < words.size()) { unsigned int size = words[a+1].ToUInt(); if(size!=0 && size<UINT_MAX) //if it was a valid number maxLinks = size; } linkNum = maxLinks; target = sTarget; pthread_t thread; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); pthread_create( &thread, &attr, &sendLinks, this); } } } } } MODULEDEFS(CUrlBufferModule, "Module that caches locally images/links posted on irc channels.")
Java
@extends('layout.master') @section('title','Administração') @section('content') @include('layout.topo') <div class="row"> @include('layout.menu') <div class="col-md-9"> <div class="row"> <div class="col-md-12"> <h1>Cadastro de Textos</h1> </div> </div> <form action="{{Route('admin.gravaTexto')}}" method="POST" enctype="multipart/form-data"> <div class="row"> <div class="col-md-2"><span>Título</span></div> <div class="col-md-10"><input type="text" id="titulo" name="titulo"></div> </div> <div class="row"> <div class="col-md-2"><span>Imagem</span></div> <div class="col-md-10"><input type="file" id="imagem" name="imagem"></div> </div> <div class="row"> <div class="col-md-2"><span>Texto</span></div> <div class="col-md-10"> <?php $oFCKeditor = new FCKeditor('texto'); $oFCKeditor->BasePath = "/fckeditor/"; $oFCKeditor->Height = '300'; echo $oFCKeditor->CreateHtml(); ?> </div> </div> <div class="row"> <div class="col-md-12"><button type="submit" class="btn btn-default">Enviar</button><a href="{{Route('admin.textos')}}" class="btn btn-danger">Cancelar</a></div> </div> </form> </div> </div> @include('layout.rodape') @stop
Java
from datetime import datetime from pymongo.connection import Connection from django.db import models from eventtracker.conf import settings def get_mongo_collection(): "Open a connection to MongoDB and return the collection to use." if settings.RIGHT_MONGODB_HOST: connection = Connection.paired( left=(settings.MONGODB_HOST, settings.MONGODB_PORT), right=(settings.RIGHT_MONGODB_HOST, settings.RIGHT_MONGODB_PORT) ) else: connection = Connection(host=settings.MONGODB_HOST, port=settings.MONGODB_PORT) return connection[settings.MONGODB_DB][settings.MONGODB_COLLECTION] def save_event(collection, event, timestamp, params): "Save the event in MongoDB collection" collection.insert({ 'event': event, 'timestamp': datetime.fromtimestamp(timestamp), 'params': params }) class Event(models.Model): "Dummy model for development." timestamp = models.DateTimeField(auto_now_add=True) event = models.SlugField() params = models.TextField()
Java
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ash/display/display_controller.h" #include <algorithm> #include "ash/ash_switches.h" #include "ash/display/display_manager.h" #include "ash/root_window_controller.h" #include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/property_util.h" #include "ash/wm/window_util.h" #include "base/command_line.h" #include "base/json/json_value_converter.h" #include "base/string_piece.h" #include "base/stringprintf.h" #include "base/values.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/compositor/dip_util.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #if defined(OS_CHROMEOS) #include "ash/display/output_configurator_animation.h" #include "base/chromeos/chromeos_version.h" #include "base/string_number_conversions.h" #include "base/time.h" #include "chromeos/display/output_configurator.h" #include "ui/base/x/x11_util.h" #endif // defined(OS_CHROMEOS) namespace ash { namespace { // Primary display stored in global object as it can be // accessed after Shell is deleted. A separate display instance is created // during the shutdown instead of always keeping two display instances // (one here and another one in display_manager) in sync, which is error prone. int64 primary_display_id = gfx::Display::kInvalidDisplayID; gfx::Display* primary_display_for_shutdown = NULL; // Keeps the number of displays during the shutdown after // ash::Shell:: is deleted. int num_displays_for_shutdown = -1; // The maximum value for 'offset' in DisplayLayout in case of outliers. Need // to change this value in case to support even larger displays. const int kMaxValidOffset = 10000; // The number of pixels to overlap between the primary and secondary displays, // in case that the offset value is too large. const int kMinimumOverlapForInvalidOffset = 100; // Specifies how long the display change should have been disabled // after each display change operations. // |kCycleDisplayThrottleTimeoutMs| is set to be longer to avoid // changing the settings while the system is still configurating // displays. It will be overriden by |kAfterDisplayChangeThrottleTimeoutMs| // when the display change happens, so the actual timeout is much shorter. const int64 kAfterDisplayChangeThrottleTimeoutMs = 500; const int64 kCycleDisplayThrottleTimeoutMs = 4000; const int64 kSwapDisplayThrottleTimeoutMs = 500; bool GetPositionFromString(const base::StringPiece& position, DisplayLayout::Position* field) { if (position == "top") { *field = DisplayLayout::TOP; return true; } else if (position == "bottom") { *field = DisplayLayout::BOTTOM; return true; } else if (position == "right") { *field = DisplayLayout::RIGHT; return true; } else if (position == "left") { *field = DisplayLayout::LEFT; return true; } LOG(ERROR) << "Invalid position value: " << position; return false; } std::string GetStringFromPosition(DisplayLayout::Position position) { switch (position) { case DisplayLayout::TOP: return std::string("top"); case DisplayLayout::BOTTOM: return std::string("bottom"); case DisplayLayout::RIGHT: return std::string("right"); case DisplayLayout::LEFT: return std::string("left"); } return std::string("unknown"); } internal::DisplayManager* GetDisplayManager() { return Shell::GetInstance()->display_manager(); } void SetDisplayPropertiesOnHostWindow(aura::RootWindow* root, const gfx::Display& display) { #if defined(OS_CHROMEOS) // Native window property (Atom in X11) that specifies the display's // rotation and scale factor. They are read and used by // touchpad/mouse driver directly on X (contact adlr@ for more // details on touchpad/mouse driver side). The value of the rotation // is one of 0 (normal), 1 (90 degrees clockwise), 2 (180 degree) or // 3 (270 degrees clockwise). The value of the scale factor is in // percent (100, 140, 200 etc). const char kRotationProp[] = "_CHROME_DISPLAY_ROTATION"; const char kScaleFactorProp[] = "_CHROME_DISPLAY_SCALE_FACTOR"; const char kCARDINAL[] = "CARDINAL"; CommandLine* command_line = CommandLine::ForCurrentProcess(); int rotation = 0; if (command_line->HasSwitch(switches::kAshOverrideDisplayOrientation)) { std::string value = command_line-> GetSwitchValueASCII(switches::kAshOverrideDisplayOrientation); DCHECK(base::StringToInt(value, &rotation)); DCHECK(0 <= rotation && rotation <= 3) << "Invalid rotation value=" << rotation; if (rotation < 0 || rotation > 3) rotation = 0; } gfx::AcceleratedWidget xwindow = root->GetAcceleratedWidget(); ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, rotation); ui::SetIntProperty(xwindow, kScaleFactorProp, kCARDINAL, 100 * display.device_scale_factor()); #endif } } // namespace //////////////////////////////////////////////////////////////////////////////// // DisplayLayout DisplayLayout::DisplayLayout() : position(RIGHT), offset(0) {} DisplayLayout::DisplayLayout(DisplayLayout::Position position, int offset) : position(position), offset(offset) { DCHECK_LE(TOP, position); DCHECK_GE(LEFT, position); // Set the default value to |position| in case position is invalid. DCHECKs // above doesn't stop in Release builds. if (TOP > position || LEFT < position) this->position = RIGHT; DCHECK_GE(kMaxValidOffset, abs(offset)); } DisplayLayout DisplayLayout::Invert() const { Position inverted_position = RIGHT; switch (position) { case TOP: inverted_position = BOTTOM; break; case BOTTOM: inverted_position = TOP; break; case RIGHT: inverted_position = LEFT; break; case LEFT: inverted_position = RIGHT; break; } return DisplayLayout(inverted_position, -offset); } // static bool DisplayLayout::ConvertFromValue(const base::Value& value, DisplayLayout* layout) { base::JSONValueConverter<DisplayLayout> converter; return converter.Convert(value, layout); } // static bool DisplayLayout::ConvertToValue(const DisplayLayout& layout, base::Value* value) { base::DictionaryValue* dict_value = NULL; if (!value->GetAsDictionary(&dict_value) || dict_value == NULL) return false; const std::string position_str = GetStringFromPosition(layout.position); dict_value->SetString("position", position_str); dict_value->SetInteger("offset", layout.offset); return true; } std::string DisplayLayout::ToString() const { const std::string position_str = GetStringFromPosition(position); return StringPrintf("%s, %d", position_str.c_str(), offset); } // static void DisplayLayout::RegisterJSONConverter( base::JSONValueConverter<DisplayLayout>* converter) { converter->RegisterCustomField<Position>( "position", &DisplayLayout::position, &GetPositionFromString); converter->RegisterIntField("offset", &DisplayLayout::offset); } //////////////////////////////////////////////////////////////////////////////// // DisplayChangeLimiter DisplayController::DisplayChangeLimiter::DisplayChangeLimiter() : throttle_timeout_(base::Time::Now()) { } void DisplayController::DisplayChangeLimiter::SetThrottleTimeout( int64 throttle_ms) { throttle_timeout_ = base::Time::Now() + base::TimeDelta::FromMilliseconds(throttle_ms); } bool DisplayController::DisplayChangeLimiter::IsThrottled() const { return base::Time::Now() < throttle_timeout_; } //////////////////////////////////////////////////////////////////////////////// // DisplayController DisplayController::DisplayController() : desired_primary_display_id_(gfx::Display::kInvalidDisplayID), primary_root_window_for_replace_(NULL) { #if defined(OS_CHROMEOS) CommandLine* command_line = CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switches::kAshDisableDisplayChangeLimiter) && base::chromeos::IsRunningOnChromeOS()) limiter_.reset(new DisplayChangeLimiter); #endif // Reset primary display to make sure that tests don't use // stale display info from previous tests. primary_display_id = gfx::Display::kInvalidDisplayID; delete primary_display_for_shutdown; primary_display_for_shutdown = NULL; num_displays_for_shutdown = -1; Shell::GetScreen()->AddObserver(this); } DisplayController::~DisplayController() { DCHECK(primary_display_for_shutdown); } void DisplayController::Shutdown() { DCHECK(!primary_display_for_shutdown); primary_display_for_shutdown = new gfx::Display( GetDisplayManager()->GetDisplayForId(primary_display_id)); num_displays_for_shutdown = GetDisplayManager()->GetNumDisplays(); Shell::GetScreen()->RemoveObserver(this); // Delete all root window controllers, which deletes root window // from the last so that the primary root window gets deleted last. for (std::map<int64, aura::RootWindow*>::const_reverse_iterator it = root_windows_.rbegin(); it != root_windows_.rend(); ++it) { internal::RootWindowController* controller = GetRootWindowController(it->second); DCHECK(controller); delete controller; } } // static const gfx::Display& DisplayController::GetPrimaryDisplay() { DCHECK_NE(primary_display_id, gfx::Display::kInvalidDisplayID); if (primary_display_for_shutdown) return *primary_display_for_shutdown; return GetDisplayManager()->GetDisplayForId(primary_display_id); } // static int DisplayController::GetNumDisplays() { if (num_displays_for_shutdown >= 0) return num_displays_for_shutdown; return GetDisplayManager()->GetNumDisplays(); } // static bool DisplayController::HasPrimaryDisplay() { return primary_display_id != gfx::Display::kInvalidDisplayID; } void DisplayController::InitPrimaryDisplay() { const gfx::Display* primary_candidate = GetDisplayManager()->GetDisplayAt(0); #if defined(OS_CHROMEOS) if (base::chromeos::IsRunningOnChromeOS()) { internal::DisplayManager* display_manager = GetDisplayManager(); // On ChromeOS device, root windows are stacked vertically, and // default primary is the one on top. int count = display_manager->GetNumDisplays(); int y = primary_candidate->bounds_in_pixel().y(); for (int i = 1; i < count; ++i) { const gfx::Display* display = display_manager->GetDisplayAt(i); if (display->IsInternal()) { primary_candidate = display; break; } else if (display->bounds_in_pixel().y() < y) { primary_candidate = display; y = display->bounds_in_pixel().y(); } } } #endif primary_display_id = primary_candidate->id(); AddRootWindowForDisplay(*primary_candidate); UpdateDisplayBoundsForLayout(); } void DisplayController::InitSecondaryDisplays() { internal::DisplayManager* display_manager = GetDisplayManager(); for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { const gfx::Display* display = display_manager->GetDisplayAt(i); if (primary_display_id != display->id()) { aura::RootWindow* root = AddRootWindowForDisplay(*display); Shell::GetInstance()->InitRootWindowForSecondaryDisplay(root); } } CommandLine* command_line = CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kAshSecondaryDisplayLayout)) { std::string value = command_line->GetSwitchValueASCII( switches::kAshSecondaryDisplayLayout); char layout; int offset; if (sscanf(value.c_str(), "%c,%d", &layout, &offset) == 2) { if (layout == 't') default_display_layout_.position = DisplayLayout::TOP; else if (layout == 'b') default_display_layout_.position = DisplayLayout::BOTTOM; else if (layout == 'r') default_display_layout_.position = DisplayLayout::RIGHT; else if (layout == 'l') default_display_layout_.position = DisplayLayout::LEFT; default_display_layout_.offset = offset; } } UpdateDisplayBoundsForLayout(); } void DisplayController::AddObserver(Observer* observer) { observers_.AddObserver(observer); } void DisplayController::RemoveObserver(Observer* observer) { observers_.RemoveObserver(observer); } aura::RootWindow* DisplayController::GetPrimaryRootWindow() { DCHECK(!root_windows_.empty()); return root_windows_[primary_display_id]; } aura::RootWindow* DisplayController::GetRootWindowForDisplayId(int64 id) { return root_windows_[id]; } void DisplayController::CloseChildWindows() { for (std::map<int64, aura::RootWindow*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { aura::RootWindow* root_window = it->second; internal::RootWindowController* controller = GetRootWindowController(root_window); if (controller) { controller->CloseChildWindows(); } else { while (!root_window->children().empty()) { aura::Window* child = root_window->children()[0]; delete child; } } } } std::vector<aura::RootWindow*> DisplayController::GetAllRootWindows() { std::vector<aura::RootWindow*> windows; for (std::map<int64, aura::RootWindow*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { DCHECK(it->second); if (GetRootWindowController(it->second)) windows.push_back(it->second); } return windows; } gfx::Insets DisplayController::GetOverscanInsets(int64 display_id) const { return GetDisplayManager()->GetOverscanInsets(display_id); } void DisplayController::SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip) { GetDisplayManager()->SetOverscanInsets(display_id, insets_in_dip); } std::vector<internal::RootWindowController*> DisplayController::GetAllRootWindowControllers() { std::vector<internal::RootWindowController*> controllers; for (std::map<int64, aura::RootWindow*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { internal::RootWindowController* controller = GetRootWindowController(it->second); if (controller) controllers.push_back(controller); } return controllers; } void DisplayController::SetDefaultDisplayLayout(const DisplayLayout& layout) { CommandLine* command_line = CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switches::kAshSecondaryDisplayLayout) && (default_display_layout_.position != layout.position || default_display_layout_.offset != layout.offset)) { default_display_layout_ = layout; NotifyDisplayConfigurationChanging(); UpdateDisplayBoundsForLayout(); } } void DisplayController::SetLayoutForDisplayId(int64 id, const DisplayLayout& layout) { DisplayLayout& display_for_id = secondary_layouts_[id]; if (display_for_id.position != layout.position || display_for_id.offset != layout.offset) { secondary_layouts_[id] = layout; NotifyDisplayConfigurationChanging(); UpdateDisplayBoundsForLayout(); } } const DisplayLayout& DisplayController::GetLayoutForDisplay( const gfx::Display& display) const { std::map<int64, DisplayLayout>::const_iterator it = secondary_layouts_.find(display.id()); if (it != secondary_layouts_.end()) return it->second; return default_display_layout_; } const DisplayLayout& DisplayController::GetCurrentDisplayLayout() const { DCHECK_EQ(2U, GetDisplayManager()->GetNumDisplays()); if (GetDisplayManager()->GetNumDisplays() > 1) { DisplayController* non_const = const_cast<DisplayController*>(this); return GetLayoutForDisplay(*(non_const->GetSecondaryDisplay())); } // On release build, just fallback to default instead of blowing up. return default_display_layout_; } void DisplayController::CycleDisplayMode() { if (limiter_.get()) { if (limiter_->IsThrottled()) return; limiter_->SetThrottleTimeout(kCycleDisplayThrottleTimeoutMs); } #if defined(OS_CHROMEOS) Shell* shell = Shell::GetInstance(); if (!base::chromeos::IsRunningOnChromeOS()) { internal::DisplayManager::CycleDisplay(); } else if (shell->output_configurator()->connected_output_count() > 1) { internal::OutputConfiguratorAnimation* animation = shell->output_configurator_animation(); animation->StartFadeOutAnimation(base::Bind( base::IgnoreResult(&chromeos::OutputConfigurator::CycleDisplayMode), base::Unretained(shell->output_configurator()))); } #endif } void DisplayController::SwapPrimaryDisplay() { if (limiter_.get()) { if (limiter_->IsThrottled()) return; limiter_->SetThrottleTimeout(kSwapDisplayThrottleTimeoutMs); } if (Shell::GetScreen()->GetNumDisplays() > 1) SetPrimaryDisplay(ScreenAsh::GetSecondaryDisplay()); } void DisplayController::SetPrimaryDisplayId(int64 id) { desired_primary_display_id_ = id; if (desired_primary_display_id_ == primary_display_id) return; internal::DisplayManager* display_manager = GetDisplayManager(); for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { gfx::Display* display = display_manager->GetDisplayAt(i); if (display->id() == id) { SetPrimaryDisplay(*display); break; } } } void DisplayController::SetPrimaryDisplay( const gfx::Display& new_primary_display) { internal::DisplayManager* display_manager = GetDisplayManager(); DCHECK(new_primary_display.is_valid()); DCHECK(display_manager->IsActiveDisplay(new_primary_display)); if (!new_primary_display.is_valid() || !display_manager->IsActiveDisplay(new_primary_display)) { LOG(ERROR) << "Invalid or non-existent display is requested:" << new_primary_display.ToString(); return; } if (primary_display_id == new_primary_display.id() || root_windows_.size() < 2) { return; } aura::RootWindow* non_primary_root = root_windows_[new_primary_display.id()]; LOG_IF(ERROR, !non_primary_root) << "Unknown display is requested in SetPrimaryDisplay: id=" << new_primary_display.id(); if (!non_primary_root) return; gfx::Display old_primary_display = GetPrimaryDisplay(); // Swap root windows between current and new primary display. aura::RootWindow* primary_root = root_windows_[primary_display_id]; DCHECK(primary_root); DCHECK_NE(primary_root, non_primary_root); root_windows_[new_primary_display.id()] = primary_root; primary_root->SetProperty(internal::kDisplayIdKey, new_primary_display.id()); root_windows_[old_primary_display.id()] = non_primary_root; non_primary_root->SetProperty(internal::kDisplayIdKey, old_primary_display.id()); primary_display_id = new_primary_display.id(); desired_primary_display_id_ = primary_display_id; display_manager->UpdateWorkAreaOfDisplayNearestWindow( primary_root, old_primary_display.GetWorkAreaInsets()); display_manager->UpdateWorkAreaOfDisplayNearestWindow( non_primary_root, new_primary_display.GetWorkAreaInsets()); // Update the layout. SetLayoutForDisplayId(old_primary_display.id(), GetLayoutForDisplay(new_primary_display).Invert()); // Update the dispay manager with new display info. std::vector<gfx::Display> displays; displays.push_back(display_manager->GetDisplayForId(primary_display_id)); displays.push_back(*GetSecondaryDisplay()); GetDisplayManager()->set_force_bounds_changed(true); GetDisplayManager()->UpdateDisplays(displays); GetDisplayManager()->set_force_bounds_changed(false); } gfx::Display* DisplayController::GetSecondaryDisplay() { internal::DisplayManager* display_manager = GetDisplayManager(); CHECK_EQ(2U, display_manager->GetNumDisplays()); return display_manager->GetDisplayAt(0)->id() == primary_display_id ? display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0); } void DisplayController::OnDisplayBoundsChanged(const gfx::Display& display) { if (limiter_.get()) limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); NotifyDisplayConfigurationChanging(); UpdateDisplayBoundsForLayout(); aura::RootWindow* root = root_windows_[display.id()]; SetDisplayPropertiesOnHostWindow(root, display); root->SetHostBounds(display.bounds_in_pixel()); } void DisplayController::OnDisplayAdded(const gfx::Display& display) { if (limiter_.get()) limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); NotifyDisplayConfigurationChanging(); if (primary_root_window_for_replace_) { DCHECK(root_windows_.empty()); primary_display_id = display.id(); root_windows_[display.id()] = primary_root_window_for_replace_; primary_root_window_for_replace_->SetProperty( internal::kDisplayIdKey, display.id()); primary_root_window_for_replace_ = NULL; UpdateDisplayBoundsForLayout(); root_windows_[display.id()]->SetHostBounds(display.bounds_in_pixel()); } else { DCHECK(!root_windows_.empty()); aura::RootWindow* root = AddRootWindowForDisplay(display); UpdateDisplayBoundsForLayout(); if (desired_primary_display_id_ == display.id()) SetPrimaryDisplay(display); Shell::GetInstance()->InitRootWindowForSecondaryDisplay(root); } } void DisplayController::OnDisplayRemoved(const gfx::Display& display) { if (limiter_.get()) limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); aura::RootWindow* root_to_delete = root_windows_[display.id()]; DCHECK(root_to_delete) << display.ToString(); NotifyDisplayConfigurationChanging(); // Display for root window will be deleted when the Primary RootWindow // is deleted by the Shell. root_windows_.erase(display.id()); // When the primary root window's display is removed, move the primary // root to the other display. if (primary_display_id == display.id()) { // Temporarily store the primary root window in // |primary_root_window_for_replace_| when replacing the display. if (root_windows_.size() == 0) { primary_display_id = gfx::Display::kInvalidDisplayID; primary_root_window_for_replace_ = root_to_delete; return; } DCHECK_EQ(1U, root_windows_.size()); primary_display_id = GetSecondaryDisplay()->id(); aura::RootWindow* primary_root = root_to_delete; // Delete the other root instead. root_to_delete = root_windows_[primary_display_id]; root_to_delete->SetProperty(internal::kDisplayIdKey, display.id()); // Setup primary root. root_windows_[primary_display_id] = primary_root; primary_root->SetProperty(internal::kDisplayIdKey, primary_display_id); OnDisplayBoundsChanged( GetDisplayManager()->GetDisplayForId(primary_display_id)); } internal::RootWindowController* controller = GetRootWindowController(root_to_delete); DCHECK(controller); controller->MoveWindowsTo(GetPrimaryRootWindow()); // Delete most of root window related objects, but don't delete // root window itself yet because the stack may be using it. controller->Shutdown(); MessageLoop::current()->DeleteSoon(FROM_HERE, controller); } aura::RootWindow* DisplayController::AddRootWindowForDisplay( const gfx::Display& display) { aura::RootWindow* root = GetDisplayManager()->CreateRootWindowForDisplay(display); root_windows_[display.id()] = root; SetDisplayPropertiesOnHostWindow(root, display); #if defined(OS_CHROMEOS) static bool force_constrain_pointer_to_root = CommandLine::ForCurrentProcess()->HasSwitch( switches::kAshConstrainPointerToRoot); if (base::chromeos::IsRunningOnChromeOS() || force_constrain_pointer_to_root) root->ConfineCursorToWindow(); #endif return root; } void DisplayController::UpdateDisplayBoundsForLayout() { if (Shell::GetScreen()->GetNumDisplays() <= 1) return; DCHECK_EQ(2, Shell::GetScreen()->GetNumDisplays()); const gfx::Rect& primary_bounds = GetPrimaryDisplay().bounds(); gfx::Display* secondary_display = GetSecondaryDisplay(); const gfx::Rect& secondary_bounds = secondary_display->bounds(); gfx::Point new_secondary_origin = primary_bounds.origin(); const DisplayLayout& layout = GetLayoutForDisplay(*secondary_display); DisplayLayout::Position position = layout.position; // Ignore the offset in case the secondary display doesn't share edges with // the primary display. int offset = layout.offset; if (position == DisplayLayout::TOP || position == DisplayLayout::BOTTOM) { offset = std::min( offset, primary_bounds.width() - kMinimumOverlapForInvalidOffset); offset = std::max( offset, -secondary_bounds.width() + kMinimumOverlapForInvalidOffset); } else { offset = std::min( offset, primary_bounds.height() - kMinimumOverlapForInvalidOffset); offset = std::max( offset, -secondary_bounds.height() + kMinimumOverlapForInvalidOffset); } switch (position) { case DisplayLayout::TOP: new_secondary_origin.Offset(offset, -secondary_bounds.height()); break; case DisplayLayout::RIGHT: new_secondary_origin.Offset(primary_bounds.width(), offset); break; case DisplayLayout::BOTTOM: new_secondary_origin.Offset(offset, primary_bounds.height()); break; case DisplayLayout::LEFT: new_secondary_origin.Offset(-secondary_bounds.width(), offset); break; } gfx::Insets insets = secondary_display->GetWorkAreaInsets(); secondary_display->set_bounds( gfx::Rect(new_secondary_origin, secondary_bounds.size())); secondary_display->UpdateWorkAreaFromInsets(insets); } void DisplayController::NotifyDisplayConfigurationChanging() { FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanging()); } } // namespace ash
Java
/** * Copyright 5AM Solutions Inc, ESAC, ScenPro & SAIC * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/caintegrator/LICENSE.txt for details. */ package gov.nih.nci.caintegrator.web.action.study.management; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import gov.nih.nci.caintegrator.application.study.LogEntry; import gov.nih.nci.caintegrator.application.study.StudyConfiguration; import gov.nih.nci.caintegrator.application.study.StudyManagementServiceStub; import gov.nih.nci.caintegrator.web.action.AbstractSessionBasedTest; import gov.nih.nci.caintegrator.web.action.study.management.EditStudyLogAction; import java.util.Date; import org.junit.Before; import org.junit.Test; import com.opensymphony.xwork2.Action; /** * */ public class EditStudyLogActionTest extends AbstractSessionBasedTest { private EditStudyLogAction action = new EditStudyLogAction(); private StudyManagementServiceStub studyManagementService; private LogEntry logEntry1; private LogEntry logEntry2; @Override @Before public void setUp() throws Exception { super.setUp(); action.setStudyConfiguration(new StudyConfiguration()); action = new EditStudyLogAction(); studyManagementService = new StudyManagementServiceStub(); action.setStudyManagementService(studyManagementService); action.setWorkspaceService(workspaceService); logEntry1 = new LogEntry(); logEntry1.setTrimSystemLogMessage("message"); logEntry1.setLogDate(new Date()); logEntry1.setTrimDescription("desc"); try { Thread.sleep(20l); } catch (InterruptedException e) { } logEntry2 = new LogEntry(); logEntry2.setSystemLogMessage("message2"); logEntry2.setLogDate(new Date()); logEntry2.setDescription("desc"); action.getStudyConfiguration().getLogEntries().add(logEntry1); action.getStudyConfiguration().getLogEntries().add(logEntry2); } @Test public void testPrepare() throws InterruptedException { action.prepare(); // Verify the most recent ones are sorted first. assertEquals(logEntry2, action.getDisplayableLogEntries().get(0).getLogEntry()); assertEquals(logEntry1, action.getDisplayableLogEntries().get(1).getLogEntry()); assertTrue(studyManagementService.getRefreshedStudyEntityCalled); } @Test public void testSave() { action.prepare(); // logEntry2 is first action.getDisplayableLogEntries().get(0).setDescription("new"); action.getDisplayableLogEntries().get(0).setUpdateDescription(true); // logEntry1 will have a new description, but the checkbox will be false. action.getDisplayableLogEntries().get(1).setDescription("new"); action.getDisplayableLogEntries().get(1).setUpdateDescription(false); assertEquals(Action.SUCCESS, action.save()); assertEquals("new", logEntry2.getDescription()); assertEquals("desc", logEntry1.getDescription()); assertTrue(studyManagementService.saveCalled); } @Test public void testAcceptableParameterName() { assertTrue(action.acceptableParameterName(null)); assertTrue(action.acceptableParameterName("ABC")); assertFalse(action.acceptableParameterName("123")); assertFalse(action.acceptableParameterName("d-123-e")); } }
Java
# AWS SDK for JavaScript [![NPM](https://nodei.co/npm/aws-sdk.svg?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/aws-sdk/) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/aws/aws-sdk-js) [![Version](https://badge.fury.io/js/aws-sdk.svg)](http://badge.fury.io/js/aws-sdk) [![Build Status](https://travis-ci.org/aws/aws-sdk-js.svg?branch=master)](https://travis-ci.org/aws/aws-sdk-js) [![Coverage Status](https://coveralls.io/repos/aws/aws-sdk-js/badge.svg?branch=master)](https://coveralls.io/r/aws/aws-sdk-js?branch=master) The official AWS SDK for JavaScript, available for browsers and mobile devices, or Node.js backends For release notes, see the [CHANGELOG](CHANGELOG.md). Prior to v2.4.8, release notes can be found at http://aws.amazon.com/releasenotes/SDK/JavaScript <p class="note"> If you are upgrading from 1.x to 2.0 of the SDK, please see the {file:UPGRADING.md} notes for information on how to migrate existing code to work with the new major version. </p> ## Installing ### In the Browser To use the SDK in the browser, simply add the following script tag to your HTML pages: <script src="https://sdk.amazonaws.com/js/aws-sdk-2.7.7.min.js"></script> You can also build a custom browser SDK with your specified set of AWS services. This can allow you to reduce the SDK's size, specify different API versions of services, or use AWS services that don't currently support CORS if you are working in an environment that does not enforce CORS. To get started: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/building-sdk-for-browsers.html The AWS SDK is also compatible with [browserify](http://browserify.org). ### In Node.js The preferred way to install the AWS SDK for Node.js is to use the [npm](http://npmjs.org) package manager for Node.js. Simply type the following into a terminal window: ```sh npm install aws-sdk ``` ### Using Bower You can also use [Bower](http://bower.io) to install the SDK by typing the following into a terminal window: ```sh bower install aws-sdk-js ``` ## Usage and Getting Started You can find a getting started guide at: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide ## Usage with TypeScript The AWS SDK for JavaScript bundles TypeScript definition files for use in TypeScript projects and to support tools that can read `.d.ts` files. Our goal is to keep these TypeScript definition files updated with each release for any public api. ### Pre-requisites Before you can begin using these TypeScript definitions with your project, you need to make sure your project meets a few of these requirements: * Use TypeScript v2.x * Includes the TypeScript definitions for node. You can use npm to install this by typing the following into a terminal window: ```sh npm install --save-dev @types/node ``` * Your `tsconfig.json` or `jsconfig.json` includes `'dom'` and `'es2015.promise'` under `compilerOptions.lib`. See [tsconfig.json](./ts/tsconfig.json) for an example. ### In the Browser To use the TypeScript definition files with the global `AWS` object in a front-end project, add the following line to the top of your JavaScript file: ```javascript /// <reference types="aws-sdk" /> ``` This will provide support for the global `AWS` object. ### In Node.js To use the TypeScript definition files within a Node.js project, simply import `aws-sdk` as you normally would. In a TypeScript file: ```javascript // import entire SDK import AWS = require('aws-sdk'); // import AWS object without services import AWS = require('aws-sdk/global'); // import individual service import S3 = require('aws-sdk/clients/s3'); ``` In a JavaScript file: ```javascript // import entire SDK var AWS = require('aws-sdk'); // import AWS object without services var AWS = require('aws-sdk/global'); // import individual service var S3 = require('aws-sdk/clients/s3'); ``` ### Known Limitations There are a few known limitations with the bundled TypeScript definitions at this time: * Service client typings reflect the latest `apiVersion`, regardless of which `apiVersion` is specified when creating a client. * Service-bound parameters use the `any` type. ## Supported Services <p class="note"><strong>Note</strong>: Although all services are supported in the browser version of the SDK, not all of the services are available in the default hosted build (using the script tag provided above). Instructions on how to build a custom version of the SDK with individual services are provided in the "<a href="http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/building-sdk-for-browsers.html">Building the SDK for Browsers</a>" section of the SDK Developer Guide. </p> The SDK currently supports the following services: <table> <thead> <th>Service Name</th> <th>Class Name</th> <th>API Version</th> </thead> <tbody> <tr><td>Amazon API Gateway</td><td>AWS.APIGateway</td><td>2015-07-09</td></tr> <tr><td>Amazon CloudFront</td><td>AWS.CloudFront</td><td>2014-10-21</td></tr> <tr><td>Amazon CloudHSM</td><td>AWS.CloudHSM</td><td>2014-05-30</td></tr> <tr><td>Amazon CloudSearch</td><td>AWS.CloudSearch</td><td>2013-01-01</td></tr> <tr><td>Amazon CloudSearch Domain</td><td>AWS.CloudSearchDomain</td><td>2013-01-01</td></tr> <tr><td>Amazon CloudWatch</td><td>AWS.CloudWatch</td><td>2010-08-01</td></tr> <tr><td>Amazon CloudWatch Events</td><td>AWS.CloudWatchLogs</td><td>2015-10-07</td></tr> <tr><td>Amazon CloudWatch Logs</td><td>AWS.CloudWatchLogs</td><td>2014-03-28</td></tr> <tr><td>Amazon Cognito Identity</td><td>AWS.CognitoIdentity</td><td>2014-06-30</td></tr> <tr><td>Amazon Cognito Sync</td><td>AWS.CognitoSync</td><td>2014-06-30</td></tr> <tr><td>Amazon DynamoDB</td><td>AWS.DynamoDB</td><td>2012-08-10</td></tr> <tr><td>Amazon DynamoDB Streams</td><td>AWS.DynamoDBStreams</td><td>2012-08-10</td></tr> <tr><td>Amazon EC2 Container Registry</td><td>AWS.ECR</td><td>2015-09-21</td></tr> <tr><td>Amazon EC2 Container Service</td><td>AWS.ECS</td><td>2014-11-13</td></tr> <tr><td>Amazon Elastic Compute Cloud</td><td>AWS.EC2</td><td>2014-10-01</td></tr> <tr><td>Amazon Elastic File System</td><td>AWS.EFS</td><td>2015-02-01</td></tr> <tr><td>Amazon Elastic MapReduce</td><td>AWS.EMR</td><td>2009-03-31</td></tr> <tr><td>Amazon Elastic Transcoder</td><td>AWS.ElasticTranscoder</td><td>2012-09-25</td></tr> <tr><td>Amazon ElastiCache</td><td>AWS.ElastiCache</td><td>2014-09-30</td></tr> <tr><td>Amazon Elasticsearch Service</td><td>AWS.ES</td><td>2015-01-01</td></tr> <tr><td>Amazon GameLift</td><td>AWS.GameLift</td><td>2015-10-01</td></tr> <tr><td>Amazon Glacier</td><td>AWS.Glacier</td><td>2012-06-01</td></tr> <tr><td>Amazon Inspector</td><td>AWS.Inspector</td><td>2016-02-16</td></tr> <tr><td>Amazon Kinesis</td><td>AWS.Kinesis</td><td>2013-12-02</td></tr> <tr><td>Amazon Kinesis Analytics</td><td>AWS.KinesisAnalytics</td><td>2015-08-14</td></tr> <tr><td>Amazon Kinesis Firehose</td><td>AWS.Firehose</td><td>2015-08-04</td></tr> <tr><td>Amazon Machine Learning</td><td>AWS.MachineLearning</td><td>2014-12-12</td></tr> <tr><td>Amazon Mobile Analytics</td><td>AWS.MobileAnalytics</td><td>2014-06-05</td></tr> <tr><td>Amazon Redshift</td><td>AWS.Redshift</td><td>2012-12-01</td></tr> <tr><td>Amazon Relational Database Service</td><td>AWS.RDS</td><td>2014-09-01</td></tr> <tr><td>Amazon Route 53</td><td>AWS.Route53</td><td>2013-04-01</td></tr> <tr><td>Amazon Route 53 Domains</td><td>AWS.Route53Domains</td><td>2014-05-15</td></tr> <tr><td>Amazon Simple Email Service</td><td>AWS.SES</td><td>2010-12-01</td></tr> <tr><td>Amazon Simple Notification Service</td><td>AWS.SNS</td><td>2010-03-31</td></tr> <tr><td>Amazon Simple Queue Service</td><td>AWS.SQS</td><td>2012-11-05</td></tr> <tr><td>Amazon Simple Storage Service</td><td>AWS.S3</td><td>2006-03-01</td></tr> <tr><td>Amazon Simple Systems Management Service</td><td>AWS.SSM</td><td>2014-11-06</td></tr> <tr><td>Amazon Simple Workflow Service</td><td>AWS.SWF</td><td>2012-01-25</td></tr> <tr><td>Amazon SimpleDB</td><td>AWS.SimpleDB</td><td>2009-04-15</td></tr> <tr><td>Amazon Snowball</td><td>AWS.Snowball</td><td>2016-06-30</td></tr> <tr><td>Amazon WorkSpaces</td><td>AWS.WorkSpaces</td><td>2015-04-08</td></tr> <tr><td>Auto Scaling</td><td>AWS.AutoScaling</td><td>2011-01-01</td></tr> <tr><td>AWS Certificate Manager</td><td>AWS.ACM</td><td>2015-12-08</td></tr> <tr><td>AWS CloudFormation</td><td>AWS.CloudFormation</td><td>2010-05-15</td></tr> <tr><td>AWS CloudTrail</td><td>AWS.CloudTrail</td><td>2013-11-01</td></tr> <tr><td>AWS CodeCommit</td><td>AWS.CodeCommit</td><td>2015-04-13</td></tr> <tr><td>AWS CodeDeploy</td><td>AWS.CodeDeploy</td><td>2014-10-06</td></tr> <tr><td>AWS CodePipeline</td><td>AWS.CodePipeline</td><td>2015-07-09</td></tr> <tr><td>AWS Config</td><td>AWS.ConfigService</td><td>2014-11-12</td></tr> <tr><td>AWS Data Pipeline</td><td>AWS.DataPipeline</td><td>2012-10-29</td></tr> <tr><td>AWS Database Migration Service</td><td>AWS.DMS</td><td>2016-01-01</td></tr> <tr><td>AWS Device Farm</td><td>AWS.DeviceFarm</td><td>2015-06-23</td></tr> <tr><td>AWS Direct Connect</td><td>AWS.DirectConnect</td><td>2012-10-25</td></tr> <tr><td>AWS Directory Service</td><td>AWS.DirectoryService</td><td>2015-04-16</td></tr> <tr><td>AWS Elastic Beanstalk</td><td>AWS.ElasticBeanstalk</td><td>2010-12-01</td></tr> <tr><td>AWS Identity and Access Management</td><td>AWS.IAM</td><td>2010-05-08</td></tr> <tr><td>AWS Import/Export</td><td>AWS.ImportExport</td><td>2010-06-01</td></tr> <tr><td>AWS IoT</td><td>AWS.Iot</td><td>2015-05-28</td></tr> <tr><td>AWS IoT Data Plane</td><td>AWS.IotData</td><td>2015-05-28</td></tr> <tr><td>AWS Key Management Service</td><td>AWS.KMS</td><td>2014-11-01</td></tr> <tr><td>AWS Lambda</td><td>AWS.Lambda</td><td>2015-03-31</td></tr> <tr><td>AWS Marketplace Commerce Analytics</td><td>AWS.MarketplaceCommerceAnalytics</td><td>2015-07-01</td></tr> <tr><td>AWS Marketplace Metering</td><td>AWS.MarketplaceMetering</td><td>2016-01-14</td></tr> <tr><td>AWS OpsWorks</td><td>AWS.OpsWorks</td><td>2013-02-18</td></tr> <tr><td>AWS Security Token Service</td><td>AWS.STS</td><td>2011-06-15</td></tr> <tr><td>AWS Storage Gateway</td><td>AWS.StorageGateway</td><td>2013-06-30</td></tr> <tr><td>AWS Support</td><td>AWS.Support</td><td>2013-04-15</td></tr> <tr><td>AWS WAF</td><td>AWS.WAF</td><td>2015-08-24</td></tr> <tr><td>Elastic Load Balancing</td><td>AWS.ELB</td><td>2012-06-01</td></tr> <tr><td>Elastic Load Balancing v2</td><td>AWS.ELBv2</td><td>2015-12-01</td></tr> </tbody> </table> ## License This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), see LICENSE.txt and NOTICE.txt for more information.
Java
# encoding: utf-8 import sys sys.path.append(sys.path.insert(0,"../src")) def urlopen(*args, **kwargs): # Only parse one arg: the url return Urls[args[0]] # Provide a simple hashtable to contain the content of the urls and # provide a mock object similar to what will be returned from the # real urlopen() function calls from io import StringIO from time import time import re from nose.tools import with_setup class MockUrlContent(StringIO): def __init__(self, content): super(MockUrlContent, self).__init__(content) self.headers = { 'last-modified': time() } def close(self): pass scheme_re = re.compile(r'file:(/+)?') class MockUrlCache(dict): def __setitem__(self, name, content): super(MockUrlCache, self).__setitem__(name, MockUrlContent(content)) def __getitem__(self, name): if name in self: return super(MockUrlCache, self).__getitem__(name) # Strip off 'file:[///]' from url elif name.startswith('file:'): try: name= scheme_re.sub('', name) return super(MockUrlCache, self).__getitem__(name) except: # Fall through pass # urlopen raises ValueError if unable to load content (not KeyError) raise ValueError("{0}: Cannot find file content".format(name)) Urls = MockUrlCache() def clear_configs(): pass @with_setup(clear_configs) def testImportContent(): "Cannot import content from a file" from xmlconfig import getConfig Urls.clear() Urls["file:file.txt"] = "Content embedded in a file" Urls["config.xml"] = \ u"""<?xml version="1.0" encoding="utf-8"?> <config> <constants> <string key="import" src="file:file.txt"/> </constants> </config> """ conf=getConfig() conf.load("config.xml") assert conf.get("import") == "Content embedded in a file" @with_setup(clear_configs) def testImportConfig(): "Cannot import another config file" from xmlconfig import getConfig Urls.clear() Urls["config2.xml"] = \ """<?xml version="1.0"?> <config> <constants> <string key="key22">This was imported from config2.xml</string> </constants> </config> """ Urls["config.xml"] = \ u"""<?xml version="1.0" encoding="utf-8"?> <config> <constants namespace="import" src="file:config2.xml"/> <constants> <string key="imported">%(import:key22)</string> </constants> </config> """ conf=getConfig() conf.load("config.xml") assert conf.get("imported") == "This was imported from config2.xml" @with_setup(clear_configs) def testCircularImport(): "Property detect circluar importing" from xmlconfig import getConfig Urls.clear() Urls["config2.xml"] = \ """<?xml version="1.0"?> <config> <constants namespace="circular" src="file:config.xml"/> <constants> <string key="key22">This was imported from config2.xml</string> <string key="foreign"> Namespace changed in %(circular:key4.import) </string> </constants> </config> """ Urls["config.xml"] = \ """<?xml version="1.0"?> <config> <constants namespace="import" src="file:config2.xml"/> <constants> <section key="key4"> <string key="key5">value2</string> <string key="import">%(import:key22)</string> </section> </constants> </config> """ conf=getConfig() conf.load("config.xml") assert conf.get("import:foreign") == \ "Namespace changed in This was imported from config2.xml" @with_setup(clear_configs) def testRelativeImport(): """Transfer leading absolute or relative path to the location of documents imported""" from xmlconfig import getConfig Urls["../config/config2.xml"] = \ """<?xml version="1.0"?> <config> <constants> <string key="key22">This was imported from config2.xml</string> </constants> </config> """ Urls["../config/config.xml"] = \ """<?xml version="1.0" encoding="utf-8"?> <config> <constants namespace="import" src="file:config2.xml"/> <constants> <string key="imported">%(import:key22)</string> </constants> </config> """ conf=getConfig() conf.load("../config/config.xml") assert conf.get("imported") == "This was imported from config2.xml"
Java
<!DOCTYPE html> <!-- | Setting the 4 different border widths for 4 directions. border-top-width | would be default width. | https://www.w3.org/TR/css3-background/#border-width --> <html> <head> <style> div { border: solid; border-color: blue; border-left-width: 20px; border-bottom-width: .8em; border-right-width: 10px; background: #ff6363; height: 100px; width: 100px; } </style> </head> <body> <div></div> </body> </html>
Java
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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('.')) cwd = os.getcwd() parent = os.path.dirname(cwd) sys.path.append(parent) import organigrammi # -- 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.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'openpa-organigrammi' copyright = u'2014, Simone Dalla' # 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 = organigrammi.__version__ # The full version, including alpha/beta/rc tags. release = organigrammi.__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 = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # -- 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 = 'default' # 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 = [] # 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 = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # 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 = None # 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 = {} # 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 = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # 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 = 'openpa-organigrammidoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'openpa-organigrammi.tex', u'openpa-organigrammi Documentation', u'Simone Dalla', '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 # 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', 'openpa-organigrammi', u'openpa-organigrammi Documentation', [u'Simone Dalla'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'openpa-organigrammi', u'openpa-organigrammi Documentation', u'Simone Dalla', 'openpa-organigrammi', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False
Java
/* * Copyright (c) 2008, Keith Woodward * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of Keith Woodward nor the names * of its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ package straightedge.geom.vision; import straightedge.geom.*; public class CollinearOverlap{ public KPolygon polygon; public int pointIndex; public int nextPointIndex; public KPolygon polygon2; public int point2Index; public CollinearOverlap(KPolygon polygon, int pointIndex, int nextPointIndex, KPolygon polygon2, int point2Index){ this.polygon = polygon; this.pointIndex = pointIndex; this.nextPointIndex = nextPointIndex; this.polygon2 = polygon2; this.point2Index = point2Index; } public KPolygon getPolygon() { return polygon; } public int getPointIndex() { return pointIndex; } public int getNextPointIndex() { return nextPointIndex; } public KPolygon getPolygon2() { return polygon2; } public int getPoint2Index() { return point2Index; } }
Java
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ return array( 'router' => array( 'routes' => array( 'home' => array( 'type' => 'Zend\Mvc\Router\Http\Literal', 'options' => array( 'route' => '/', 'defaults' => array( 'controller' => 'Application\Controller\Index', 'action' => 'index', ), ), ), // The following is a route to simplify getting started creating // new controllers and actions without needing to create a new // module. Simply drop new controllers in, and you can access them // using the path /application/:controller/:action 'application' => array( 'type' => 'Literal', 'options' => array( 'route' => '/application', 'defaults' => array( '__NAMESPACE__' => 'Application\Controller', 'controller' => 'Index', 'action' => 'index', ), ), 'may_terminate' => true, 'child_routes' => array( 'default' => array( 'type' => 'Segment', 'options' => array( 'route' => '/[:controller[/:action[/:id[/:id2]]]]', 'constraints' => array( //en realidad solo funcionan las minusculas. 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', 'id' => '[0-9-a-z]*', 'id2' => '[0-9-a-z]*' ), 'defaults' => array( // '__NAMESPACE__' => 'Application\Controller', // 'controller' => 'Index', // 'action' => 'index', // ), ), ), ), ), ), ), 'service_manager' => array( 'factories' => array( 'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory', ), ), 'translator' => array( 'locale' => 'en_US', 'translation_file_patterns' => array( array( 'type' => 'gettext', 'base_dir' => __DIR__ . '/../language', 'pattern' => '%s.mo', ), ), ), 'controllers' => array( 'invokables' => array( //Agregar otros controllers aqui Unicamente ejecutar: http://localhost/clase3/public/application/trabajo/otro 'Application\Controller\Index' => 'Application\Controller\IndexController', 'Application\Controller\Trabajo' => 'Application\Controller\TrabajoController' ), ), 'view_manager' => array( 'display_not_found_reason' => true, 'display_exceptions' => true, 'doctype' => 'HTML5', 'not_found_template' => 'error/404', 'exception_template' => 'error/index', 'template_map' => array( 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', 'application/index/index' => __DIR__ . '/../view/application/index/index.phtml', 'error/404' => __DIR__ . '/../view/error/404.phtml', 'error/index' => __DIR__ . '/../view/error/index.phtml', ), 'template_path_stack' => array( __DIR__ . '/../view', ), ), );
Java
// RobotBuilder Version: 2.0 // // This file was generated by RobotBuilder. It contains sections of // code that are automatically generated and assigned by robotbuilder. // These sections will be updated in the future when you export to // Java from RobotBuilder. Do not put any code or make any change in // the blocks indicating autogenerated code or it will be lost on an // update. Deleting the comments indicating the section will prevent // it from being updated in the future. package org.usfirst.frc157.ProtoBot2017; import org.usfirst.frc157.ProtoBot2017.AnalogSelectSwitch; // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=IMPORTS import com.ctre.CANTalon; import edu.wpi.first.wpilibj.Relay; import edu.wpi.first.wpilibj.RobotDrive; // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=IMPORTS import edu.wpi.first.wpilibj.livewindow.LiveWindow; /** * The RobotMap is a mapping from the ports sensors and actuators are wired into * to a variable name. This provides flexibility changing wiring, makes checking * the wiring easier and significantly reduces the number of magic numbers * floating around. */ public class RobotMap { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS public static CANTalon driveFL_Motor; public static CANTalon driveFR_Motor; public static CANTalon driveRL_Motor; public static CANTalon driveRR_Motor; public static RobotDrive driveMechDrive; public static CANTalon gearMotorLeft; public static CANTalon gearMotorRight; public static CANTalon collectMotor; public static CANTalon helixMotorRight; public static CANTalon helixMotorLeft; public static CANTalon shootMotor; public static CANTalon climbMotor; public static Relay leftGateRelay; public static Relay rightGateRelay; public final static int OnboardModeSelectSwitchAnalogInID = 3; public static AnalogSelectSwitch modeSelect; // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS public static void init() { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS modeSelect = new AnalogSelectSwitch(0); // Analog Port 0 driveFL_Motor = new CANTalon(5); // CAN ID 5 LiveWindow.addActuator("Drive", "FL_Motor", driveFL_Motor); driveFR_Motor = new CANTalon(4); // CAN ID 4 LiveWindow.addActuator("Drive", "FR_Motor", driveFR_Motor); driveRL_Motor = new CANTalon(7); // CAN ID 7 LiveWindow.addActuator("Drive", "RL_Motor", driveRL_Motor); driveRR_Motor = new CANTalon(6) ; // CAN ID 6 LiveWindow.addActuator("Drive", "RR_Motor", driveRR_Motor); driveMechDrive = new RobotDrive(driveFL_Motor, driveRL_Motor, driveFR_Motor, driveRR_Motor); driveMechDrive.setSafetyEnabled(true); driveMechDrive.setExpiration(0.5); driveMechDrive.setSensitivity(0.5); driveMechDrive.setMaxOutput(1.0); gearMotorRight = new CANTalon(14); // CAN ID 14 LiveWindow.addActuator("Gear", "gearMotor", gearMotorRight); gearMotorLeft = new CANTalon(12); LiveWindow.addActuator("Gear", "gearMotor", gearMotorLeft); collectMotor = new CANTalon(13); // CAN ID 13 LiveWindow.addActuator("Collect", "collectMotor", collectMotor); helixMotorRight = new CANTalon(9); // CAN ID 9 helixMotorLeft = new CANTalon(8); // CAN ID 8 shootMotor = new CANTalon(11); // CAN ID 11 climbMotor = new CANTalon(10); // CAN ID 10 rightGateRelay = new Relay(0); // Relay Port 0 leftGateRelay = new Relay(1); // Relay Port 1 // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS } }
Java
# -*- encoding : utf-8 -*- require 'test_helper' class Cuenta::CompeticionesControllerTest < ActionController::TestCase test "should_see_configuration_page_of_every_competition" do u = User.find(1) sym_login 1 competitions = [] # Usamos random porque hay 361 combinaciones posibles de competiciones y testearlas todas ralentizaría la fase de testeo [League, Tournament, Ladder].each { |cls| competitions<< cls.find(:first, :conditions => 'state = 0', :order => 'RANDOM() ASC') } [League, Tournament, Ladder].each { |cls| competitions<< cls.find(:first, :conditions => 'state = 1', :order => 'RANDOM() ASC') } [League, Tournament, Ladder].each { |cls| competitions<< cls.find(:first, :conditions => 'state = 2', :order => 'RANDOM() ASC') } [League, Tournament, Ladder].each { |cls| competitions<< cls.find(:first, :conditions => 'state = 3', :order => 'RANDOM() ASC') } competitions.each do |c| c.add_admin(u) u.last_competition_id = c.id u.save get :configuracion assert_response :success end end test "update_tourney_groups" do # TODO end test "update_tourney_seeds" do # TODO end test "add_participants" do test_switch_active_competition # deshabilitamos esto porque a veces se añaden usuarios repetidos y casca # post :add_participants, { :participants_count => 1} assert_response :redirect end test "recreate_matches" do # TODO # test_switch_active_competition # get :recreate_matches # assert_response :redirect end test "index_with_enable_competition_indicator" do test_switch_active_competition assert User.find(1).update_attributes(:enable_competition_indicator => true) get :index assert_response :success end test "remove_all_participants" do test_switch_active_competition get :remove_all_participants assert_response :redirect end test "reselect_maps" do test_switch_active_competition get :reselect_maps assert_response :redirect end test "update_maches_games_maps" do # TODO end test "update_matches_play_on" do # TODO end test "previous_stage" do test_switch_active_competition get :previous_stage assert_response :redirect end test "general" do test_switch_active_competition get :general assert_response :success end test "avanzada" do # TODO end test "add_allowed_participant" do # TODO end test "configuracion" do test_switch_active_competition get :configuracion assert_response :success end test "admins" do test_switch_active_competition get :admins assert_response :success end test "partidas" do test_switch_active_competition get :partidas assert_response :success end test "participantes" do test_switch_active_competition get :participantes assert_response :success end test "eliminar_participante" do # TODO end test "crear_admin" do test_switch_active_competition post :crear_admin, :login => 'panzer' assert_response :redirect assert @c.user_is_admin(User.find_by_login('panzer').id) end test "eliminar_admin" do test_crear_admin post :eliminar_admin, :user_id => User.find_by_login('panzer').id assert_response :redirect assert !@c.user_is_admin(User.find_by_login('panzer').id) end test "crear_supervisor" do test_switch_active_competition post :crear_supervisor, :login => 'panzer' assert_response :redirect assert @c.user_is_supervisor(User.find_by_login('panzer').id) end test "eliminar_supervisor" do test_crear_supervisor post :eliminar_supervisor, :user_id => User.find_by_login('panzer').id assert_response :redirect assert !@c.user_is_supervisor(User.find_by_login('panzer').id) end test "cambiar" do sym_login 1 get :cambiar assert_response :success end test "mis_partidas" do # TODO end test "list" do sym_login 1 get :list assert_response :success end test "new" do sym_login 1 get :new assert_response :success end test "create" do sym_login 1 assert_count_increases(Competition) do post :create, :competition => { :type => 'Ladder', :name => 'mi ladder', :game_id => 1, :competitions_participants_type_id => 1, :competitions_types_options => {}, :timetable_options => {}} end @c = Competition.find(:first, :order => 'id desc') assert_equal @c.id, User.find(1).last_competition_id end test "update" do test_create post :update, { :id => @c.id, :competition => {:description => 'test_update'} } assert_response :redirect @c.reload assert_equal 'test_update', @c.description end test "destroy" do test_switch_active_competition post :destroy assert_response :redirect assert_nil User.find(1).last_competition_id assert_nil Competition.find_by_id(@c.id) end test "change_state" do # TODO end test "switch_active_competition" do @c = Competition.find(1) @c.add_admin(User.find(1)) @c.pro = true assert @c.save sym_login 1 post :switch_active_competition, :id => 1 assert_response :redirect assert_equal 1, User.find(1).last_competition_id end test "sponsors_should_work" do test_switch_active_competition get :sponsors assert_response :success end test "sponsors_new_should_work" do test_switch_active_competition get :sponsors_new assert_response :success end test "sponsors_create_should_work" do test_switch_active_competition assert_count_increases(CompetitionsSponsor) do post :sponsors_create, { :competitions_sponsor => { :name => 'el nombre', :image => fixture_file_upload('files/buddha.jpg', 'image/jpeg')}} end assert_response :redirect @fl = CompetitionsSponsor.find(:first, :order => 'id desc') end test "sponsors_edit_should_work" do test_sponsors_create_should_work get :sponsors_edit, :id => CompetitionsSponsor.find(:first, :order => 'id desc').id assert_response :success end test "sponsors_update_should_work" do test_sponsors_create_should_work assert_not_equal 'succubus', @fl.name post :sponsors_update, :id => @fl.id, :competitions_sponsor => {:name => 'dm-tower', :image => fixture_file_upload('files/babe.jpg', 'image/jpeg')} assert_response :redirect @fl.reload assert_equal 'dm-tower', @fl.name end test "sponsors_destroy" do test_sponsors_create_should_work assert_count_decreases(CompetitionsSponsor) do post :sponsors_destroy, :id => @fl.id end end end
Java
# This file is part of Metasm, the Ruby assembly manipulation suite # Copyright (C) 2006-2009 Yoann GUILLOT # # Licence is LGPL, see LICENCE in the top-level directory require 'metasm/main' require 'metasm/ia32' module Metasm # The x86_64, 64-bit extension of the x86 CPU (x64, em64t, amd64...) class X86_64 < Ia32 # SegReg, Farptr unchanged # no more floating point registers (use sse*) FpReg = nil # Simd extended to 16 regs, xmm only (mmx gone with 80387) class SimdReg < Ia32::SimdReg double_map 128 => (0..15).map { |n| "xmm#{n}" } end # general purpose registers, all sizes # 8 new gprs (r8..r15), set bit R in the REX prefix to reference them (or X/B if in ModRM) # aonethusaontehsanothe with 8bit subreg: with no rex prefix, refers to ah ch dh bh (as usual) # but whenever the prefix is present, those become unavailable and encodie spl..dil (low byte of rsp/rdi) class Reg < Ia32::Reg double_map 8 => %w{ al cl dl bl spl bpl sil dil r8b r9b r10b r11b r12b r13b r14b r15b ah ch dh bh}, 16 => %w{ ax cx dx bx sp bp si di r8w r9w r10w r11w r12w r13w r14w r15w}, 32 => %w{eax ecx edx ebx esp ebp esi edi r8d r9d r10d r11d r12d r13d r14d r15d eip}, 64 => %w{rax rcx rdx rbx rsp rbp rsi rdi r8 r9 r10 r11 r12 r13 r14 r15 rip} Sym = @i_to_s[64].map { |s| s.to_sym } # returns a symbolic representation of the register: # cx => :rcx & 0xffff # ah => (:rax >> 8) & 0xff # XXX in x64, 32bits operations are zero-extended to 64bits (eg mov rax, 0x1234_ffff_ffff ; add eax, 1 => rax == 0 def symbolic(di=nil) s = Sym[@val] s = di.next_addr if s == :rip and di if @sz == 8 and to_s[-1] == ?h Expression[[Sym[@val-16], :>>, 8], :&, 0xff] elsif @sz == 8 Expression[s, :&, 0xff] elsif @sz == 16 Expression[s, :&, 0xffff] elsif @sz == 32 Expression[s, :&, 0xffffffff] else s end end # checks if two registers have bits in common def share?(other) raise 'TODO' # XXX TODO wtf does formula this do ? other.val % (other.sz >> 1) == @val % (@sz >> 1) and (other.sz != @sz or @sz != 8 or other.val == @val) end # returns the part of @val to encode in an instruction field def val_enc if @sz == 8 and @val >= 16; @val-12 # ah, bh, ch, dh elsif @val >= 16 # rip else @val & 7 # others end end # returns the part of @val to encode in an instruction's rex prefix def val_rex if @sz == 8 and @val >= 16 # ah, bh, ch, dh: rex forbidden elsif @val >= 16 # rip else @val >> 3 # others end end end # ModRM represents indirections (eg dword ptr [eax+4*ebx+12h]) # 16bit mode unavailable in x64 # opcodes use 64bit addressing by default, use adsz override (67h) prefix to switch to 32 # immediate values are encoded as :i32 sign-extended to 64bits class ModRM < Ia32::ModRM # mod 0/1/2 m 4 => sib # mod 0 m 5 => rip+imm # sib: i 4 => no index, b 5 => no base end class DbgReg < Ia32::DbgReg simple_map((0..15).map { |i| [i, "dr#{i}"] }) end class CtrlReg < Ia32::CtrlReg simple_map((0..15).map { |i| [i, "cr#{i}"] }) end # Create a new instance of an X86 cpu # arguments (any order) # - instruction set (386, 486, sse2...) [latest] # - endianness [:little] def initialize(*a) super(:latest) @size = 64 a.delete @size @endianness = (a & [:big, :little]).first || :little a.delete @endianness @family = a.pop || :latest raise "Invalid arguments #{a.inspect}" if not a.empty? raise "Invalid X86_64 family #{@family.inspect}" if not respond_to?("init_#@family") end # defines some preprocessor macros to say who we are: # TODO def tune_prepro(pp) super(pp, :itsmeX64) # ask Ia32's to just call super() pp.define_weak('_M_AMD64') pp.define_weak('_M_X64') pp.define_weak('__amd64__') pp.define_weak('__x86_64__') end def str_to_reg(str) # X86_64::Reg != Ia32::Reg Reg.from_str(str) if Reg.s_to_i.has_key? str end def shortname "x64#{'_be' if @endianness == :big}" end end X64 = X86_64 AMD64 = X86_64 end
Java
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains the computed version number. # This file is released into the public domain. Generated by # versioneer-0.19 (https://github.com/python-versioneer/python-versioneer) """Git implementation of _version.py.""" import errno import os import re import subprocess import sys def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). git_refnames = "$Format:%d$" git_full = "$Format:%H$" git_date = "$Format:%ci$" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} return keywords class VersioneerConfig: """Container for Versioneer configuration parameters.""" def get_config(): """Create, populate and return the VersioneerConfig() object.""" # these strings are filled in when 'setup.py versioneer' creates # _version.py cfg = VersioneerConfig() cfg.VCS = "git" cfg.style = "pep440" cfg.tag_prefix = "v" cfg.parentdir_prefix = "" cfg.versionfile_source = "jxl2txt/_version.py" cfg.verbose = False return cfg class NotThisMethod(Exception): """Exception raised if a method is not valid for the current scenario.""" LONG_VERSION_PY = {} HANDLERS = {} def register_vcs_handler(vcs, method): # decorator """Create decorator to mark a method as the handler of a VCS.""" def decorate(f): """Store f in HANDLERS[vcs][method].""" if vcs not in HANDLERS: HANDLERS[vcs] = {} HANDLERS[vcs][method] = f return f return decorate def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): """Call the given command(s).""" assert isinstance(commands, list) p = None for c in commands: try: dispcmd = str([c] + args) # remember shell=False, so use git.cmd on windows, not just git p = subprocess.Popen([c] + args, cwd=cwd, env=env, stdout=subprocess.PIPE, stderr=(subprocess.PIPE if hide_stderr else None)) break except EnvironmentError: e = sys.exc_info()[1] if e.errno == errno.ENOENT: continue if verbose: print("unable to run %s" % dispcmd) print(e) return None, None else: if verbose: print("unable to find command, tried %s" % (commands,)) return None, None stdout = p.communicate()[0].strip().decode() if p.returncode != 0: if verbose: print("unable to run %s (error)" % dispcmd) print("stdout was %s" % stdout) return None, p.returncode return stdout, p.returncode def versions_from_parentdir(parentdir_prefix, root, verbose): """Try to determine the version from the parent directory name. Source tarballs conventionally unpack into a directory that includes both the project name and a version string. We will also support searching up two directory levels for an appropriately named parent directory """ rootdirs = [] for i in range(3): dirname = os.path.basename(root) if dirname.startswith(parentdir_prefix): return {"version": dirname[len(parentdir_prefix):], "full-revisionid": None, "dirty": False, "error": None, "date": None} else: rootdirs.append(root) root = os.path.dirname(root) # up a level if verbose: print("Tried directories %s but none started with prefix %s" % (str(rootdirs), parentdir_prefix)) raise NotThisMethod("rootdir doesn't start with parentdir_prefix") @register_vcs_handler("git", "get_keywords") def git_get_keywords(versionfile_abs): """Extract version information from the given file.""" # the code embedded in _version.py can just fetch the value of these # keywords. When used from setup.py, we don't want to import _version.py, # so we do it with a regexp instead. This function is not used from # _version.py. keywords = {} try: f = open(versionfile_abs, "r") for line in f.readlines(): if line.strip().startswith("git_refnames ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["refnames"] = mo.group(1) if line.strip().startswith("git_full ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["full"] = mo.group(1) if line.strip().startswith("git_date ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["date"] = mo.group(1) f.close() except EnvironmentError: pass return keywords @register_vcs_handler("git", "keywords") def git_versions_from_keywords(keywords, tag_prefix, verbose): """Get version information from git keywords.""" if not keywords: raise NotThisMethod("no keywords at all, weird") date = keywords.get("date") if date is not None: # Use only the last line. Previous lines may contain GPG signature # information. date = date.splitlines()[-1] # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 # -like" string, which we must then edit to make compliant), because # it's been around since git-1.5.3, and it's too difficult to # discover which version we're using, or to work around using an # older one. date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) refnames = keywords["refnames"].strip() if refnames.startswith("$Format"): if verbose: print("keywords are unexpanded, not using") raise NotThisMethod("unexpanded keywords, not a git-archive tarball") refs = set([r.strip() for r in refnames.strip("()").split(",")]) # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of # just "foo-1.0". If we see a "tag: " prefix, prefer those. TAG = "tag: " tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)]) if not tags: # Either we're using git < 1.8.3, or there really are no tags. We use # a heuristic: assume all version tags have a digit. The old git %d # expansion behaves like git log --decorate=short and strips out the # refs/heads/ and refs/tags/ prefixes that would let us distinguish # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and # "stabilization", as well as "HEAD" and "master". tags = set([r for r in refs if re.search(r'\d', r)]) if verbose: print("discarding '%s', no digits" % ",".join(refs - tags)) if verbose: print("likely tags: %s" % ",".join(sorted(tags))) for ref in sorted(tags): # sorting will prefer e.g. "2.0" over "2.0rc1" if ref.startswith(tag_prefix): r = ref[len(tag_prefix):] if verbose: print("picking %s" % r) return {"version": r, "full-revisionid": keywords["full"].strip(), "dirty": False, "error": None, "date": date} # no suitable tags, so version is "0+unknown", but full hex is still there if verbose: print("no suitable tags, using unknown + full revision id") return {"version": "0+unknown", "full-revisionid": keywords["full"].strip(), "dirty": False, "error": "no suitable tags", "date": None} @register_vcs_handler("git", "pieces_from_vcs") def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): """Get version from 'git describe' in the root of the source tree. This only gets called if the git-archive 'subst' keywords were *not* expanded, and _version.py hasn't already been rewritten with a short version string, meaning we're inside a checked out source tree. """ GITS = ["git"] if sys.platform == "win32": GITS = ["git.cmd", "git.exe"] out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) if rc != 0: if verbose: print("Directory %s not under git control" % root) raise NotThisMethod("'git rev-parse --git-dir' returned error") # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] # if there isn't one, this yields HEX[-dirty] (no NUM) describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty", "--always", "--long", "--match", "%s*" % tag_prefix], cwd=root) # --long was added in git-1.5.5 if describe_out is None: raise NotThisMethod("'git describe' failed") describe_out = describe_out.strip() full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) if full_out is None: raise NotThisMethod("'git rev-parse' failed") full_out = full_out.strip() pieces = {} pieces["long"] = full_out pieces["short"] = full_out[:7] # maybe improved later pieces["error"] = None # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] # TAG might have hyphens. git_describe = describe_out # look for -dirty suffix dirty = git_describe.endswith("-dirty") pieces["dirty"] = dirty if dirty: git_describe = git_describe[:git_describe.rindex("-dirty")] # now we have TAG-NUM-gHEX or HEX if "-" in git_describe: # TAG-NUM-gHEX mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) if not mo: # unparseable. Maybe git-describe is misbehaving? pieces["error"] = ("unable to parse git-describe output: '%s'" % describe_out) return pieces # tag full_tag = mo.group(1) if not full_tag.startswith(tag_prefix): if verbose: fmt = "tag '%s' doesn't start with prefix '%s'" print(fmt % (full_tag, tag_prefix)) pieces["error"] = ("tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix)) return pieces pieces["closest-tag"] = full_tag[len(tag_prefix):] # distance: number of commits since tag pieces["distance"] = int(mo.group(2)) # commit: short hex revision ID pieces["short"] = mo.group(3) else: # HEX: no tags pieces["closest-tag"] = None count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], cwd=root) pieces["distance"] = int(count_out) # total number of commits # commit date: see ISO-8601 comment in git_versions_from_keywords() date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() # Use only the last line. Previous lines may contain GPG signature # information. date = date.splitlines()[-1] pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) return pieces def plus_or_dot(pieces): """Return a + if we don't already have one, else return a .""" if "+" in pieces.get("closest-tag", ""): return "." return "+" def render_pep440(pieces): """Build up version string, with post-release "local version identifier". Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty Exceptions: 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += plus_or_dot(pieces) rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) if pieces["dirty"]: rendered += ".dirty" else: # exception #1 rendered = "0+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) if pieces["dirty"]: rendered += ".dirty" return rendered def render_pep440_pre(pieces): """TAG[.post0.devDISTANCE] -- No -dirty. Exceptions: 1: no tags. 0.post0.devDISTANCE """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered += ".post0.dev%d" % pieces["distance"] else: # exception #1 rendered = "0.post0.dev%d" % pieces["distance"] return rendered def render_pep440_post(pieces): """TAG[.postDISTANCE[.dev0]+gHEX] . The ".dev0" means dirty. Note that .dev0 sorts backwards (a dirty tree will appear "older" than the corresponding clean one), but you shouldn't be releasing software with -dirty anyways. Exceptions: 1: no tags. 0.postDISTANCE[.dev0] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += ".post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" rendered += plus_or_dot(pieces) rendered += "g%s" % pieces["short"] else: # exception #1 rendered = "0.post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" rendered += "+g%s" % pieces["short"] return rendered def render_pep440_old(pieces): """TAG[.postDISTANCE[.dev0]] . The ".dev0" means dirty. Exceptions: 1: no tags. 0.postDISTANCE[.dev0] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += ".post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" else: # exception #1 rendered = "0.post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" return rendered def render_git_describe(pieces): """TAG[-DISTANCE-gHEX][-dirty]. Like 'git describe --tags --dirty --always'. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) else: # exception #1 rendered = pieces["short"] if pieces["dirty"]: rendered += "-dirty" return rendered def render_git_describe_long(pieces): """TAG-DISTANCE-gHEX[-dirty]. Like 'git describe --tags --dirty --always -long'. The distance/hash is unconditional. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) else: # exception #1 rendered = pieces["short"] if pieces["dirty"]: rendered += "-dirty" return rendered def render(pieces, style): """Render the given version pieces into the requested style.""" if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"], "date": None} if not style or style == "default": style = "pep440" # the default if style == "pep440": rendered = render_pep440(pieces) elif style == "pep440-pre": rendered = render_pep440_pre(pieces) elif style == "pep440-post": rendered = render_pep440_post(pieces) elif style == "pep440-old": rendered = render_pep440_old(pieces) elif style == "git-describe": rendered = render_git_describe(pieces) elif style == "git-describe-long": rendered = render_git_describe_long(pieces) else: raise ValueError("unknown style '%s'" % style) return {"version": rendered, "full-revisionid": pieces["long"], "dirty": pieces["dirty"], "error": None, "date": pieces.get("date")} def get_versions(): """Get version information or return default if unable to do so.""" # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have # __file__, we can work backwards from there to the root. Some # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which # case we can only use expanded keywords. cfg = get_config() verbose = cfg.verbose try: return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, verbose) except NotThisMethod: pass try: root = os.path.realpath(__file__) # versionfile_source is the relative path from the top of the source # tree (where the .git directory might live) to this file. Invert # this to find the root from __file__. for i in cfg.versionfile_source.split('/'): root = os.path.dirname(root) except NameError: return {"version": "0+unknown", "full-revisionid": None, "dirty": None, "error": "unable to find root of source tree", "date": None} try: pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) return render(pieces, cfg.style) except NotThisMethod: pass try: if cfg.parentdir_prefix: return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) except NotThisMethod: pass return {"version": "0+unknown", "full-revisionid": None, "dirty": None, "error": "unable to compute version", "date": None}
Java
<!-- %BD_HTML%/SearchResult.htm --> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=windows-1255"> <TITLE>úåöàú àéðèøðè - Takanot File</TITLE> </HEAD> <style> <!-- TR.A_Table {font-color:#3e6ea6; background-color: #f7f9fb; font-size:11;font-family: Arial,} TR.B_Table {font-color:#3e6ea6; background-color: #ecf1f6; font-size:11;font-family: Arial,} TR.C {font-color:#1e4a7a; background-color: #A9CAEF;font-weight:bold; font-size:11;font-family: Arial,} TR.clear { font-color:#1e4a7a; background-color: #FFFFFF;} H5 { font-family:Arial, Helvetica, sans-serif; font-size: 14px;} H3 { font-family:Arial, Helvetica, sans-serif; font-size: 16px;} TD.A_Row { font-family: Arial, Helvetica, sans-serif; font-weight:bold; font-style: normal; color: #093300; font-size: 10px} .defaultFont { color:#1f4a7b;font-family: Arial, Helvetica, sans-serif; font-size: 12px} --> </style> <BODY dir=rtl class="defaultFont"> <CENTER> <IMG src="/budget/Images/title1.jpg" align=bottom alt="ú÷öéá äîãéðä"> <TABLE align="center" border=0 cellspacing=0 cellpadding=0> <TR align="center"> <TD><H3>úåöàú çéôåù ìùðú 2006</H3></TD> </TR> <TR align="center"> <!--<TD><H3>ðúåðé áéöåò ðëåðéí ìñåó çåãù 04/2007</H3></TD>--> <TD><H3>ðúåðé áéöåò ëôé ùðøùîå áñôøé äðäìú äçùáåðåú ùì äîùøãéí - 04/2007<br></H3></TD> </TR> </TR align="center"> <TD><H3>àéï àçéãåú áéï äñòéôéí ìâáé îåòã òãëåï äðúåðéí</H3></TD> </TR> </TABLE> <H5>äñëåîéí äéðí ùì çå÷ äú÷öéá äî÷åøé åáàìôé ù÷ìéí <BR> </H5> </CENTER> <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#8fbcee"> <TR class="C" align="center"> <TD valign=top width=50>ñòéó</TD> <TD valign=top align="right" width=120>ùí ñòéó</TD> <TD valign=top width=65>äåöàä ðèå</TD> <TD valign=top width=65>äåöàä îåúðéú áäëðñä</TD> <TD valign=top width=65>ñä"ë äåöàä</TD> <TD valign=top width=65>äøùàä ìäúçééá</TD> <TD valign=top width=65>ùéà ë"à</TD> <TD valign=top width=40>ñä"ë ðåöì</TD> <TD valign=top width=40>àçåæ ðåöì</TD> </TR> </TABLE> <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#8fbcee"> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;06</TD> <TD valign=top align="right" width=120>&nbsp;îùøã äôðéí</TD> <TD valign=top width=65>&nbsp; 332,206</TD> <TD valign=top width=65>&nbsp; 45,823</TD> <TD valign=top width=65>&nbsp; 378,029</TD> <TD valign=top width=65>&nbsp; 107,616</TD> <TD valign=top width=65>&nbsp; 907.0</TD> <TD valign=top width=40>&nbsp; 410,283</TD> <TD valign=top width=40>&nbsp;108.53</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0601</TD> <TD valign=top align="right" width=120>&nbsp;úçåí ôòåìä ëììé</TD> <TD valign=top width=65>&nbsp; 87,342</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 87,449</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 170.0</TD> <TD valign=top width=40>&nbsp; 137,806</TD> <TD valign=top width=40>&nbsp;157.58</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060101</TD> <TD valign=top align="right" width=120>&nbsp;äðäìú äîùøã</TD> <TD valign=top width=65>&nbsp; 23,844</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 23,844</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 158.5</TD> <TD valign=top width=40>&nbsp; 25,826</TD> <TD valign=top width=40>&nbsp;108.31</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060102</TD> <TD valign=top align="right" width=120>&nbsp;äðäìú äîçåæåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 44</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060103</TD> <TD valign=top align="right" width=120>&nbsp;éòåõ îùôèé</TD> <TD valign=top width=65>&nbsp; 3,945</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 3,945</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 11.5</TD> <TD valign=top width=40>&nbsp; 3,836</TD> <TD valign=top width=40>&nbsp; 97.24</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060104</TD> <TD valign=top align="right" width=120>&nbsp;äãøëä àøâåï åùéèåú</TD> <TD valign=top width=65>&nbsp; 300</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 300</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 2,827</TD> <TD valign=top width=40>&nbsp;942.33</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060106</TD> <TD valign=top align="right" width=120>&nbsp;àîøëìåú</TD> <TD valign=top width=65>&nbsp; 53,391</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 53,498</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 99,786</TD> <TD valign=top width=40>&nbsp;186.52</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060108</TD> <TD valign=top align="right" width=120>&nbsp;îçùåá</TD> <TD valign=top width=65>&nbsp; 5,862</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 5,862</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 5,487</TD> <TD valign=top width=40>&nbsp; 93.60</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060110</TD> <TD valign=top align="right" width=120>&nbsp;îçùåá îéðäì äúëðåï</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0602</TD> <TD valign=top align="right" width=120>&nbsp;ô÷åç àøöé òì äáçéøåú</TD> <TD valign=top width=65>&nbsp; 29,382</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 29,489</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2.0</TD> <TD valign=top width=40>&nbsp; 23,179</TD> <TD valign=top width=40>&nbsp; 78.60</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060201</TD> <TD valign=top align="right" width=120>&nbsp;ô÷åç àøöé òì äáçéøåú</TD> <TD valign=top width=65>&nbsp; 4,340</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 4,340</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2.0</TD> <TD valign=top width=40>&nbsp; 16,427</TD> <TD valign=top width=40>&nbsp;378.50</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060203</TD> <TD valign=top align="right" width=120>&nbsp;áçéøåú ìîåòöåú àæåøéåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060204</TD> <TD valign=top align="right" width=120>&nbsp;äåöàåú äáçéøåú ìøùåéåú</TD> <TD valign=top width=65>&nbsp; 15,200</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 15,200</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 1,222</TD> <TD valign=top width=40>&nbsp; 8.04</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060205</TD> <TD valign=top align="right" width=120>&nbsp;îéîåï îôìâåú øùåéåú î÷åîéåú</TD> <TD valign=top width=65>&nbsp; 9,842</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 9,842</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 5,530</TD> <TD valign=top width=40>&nbsp; 56.19</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0603</TD> <TD valign=top align="right" width=120>&nbsp;ùìèåï î÷åîé</TD> <TD valign=top width=65>&nbsp; 7,884</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 7,884</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 48.5</TD> <TD valign=top width=40>&nbsp; 7,727</TD> <TD valign=top width=40>&nbsp; 98.01</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060301</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæééí</TD> <TD valign=top width=65>&nbsp; 7,884</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 7,884</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 48.5</TD> <TD valign=top width=40>&nbsp; 7,727</TD> <TD valign=top width=40>&nbsp; 98.01</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060302</TD> <TD valign=top align="right" width=120>&nbsp;àâó ùëø åë"à ìøùåî"÷</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060303</TD> <TD valign=top align="right" width=120>&nbsp;éçéãä ìçéåá àéùé</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060304</TD> <TD valign=top align="right" width=120>&nbsp;áé÷åøú áøùåéåú î÷åîéåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0604</TD> <TD valign=top align="right" width=120>&nbsp;îðäì äàåëìåñéï</TD> <TD valign=top width=65>&nbsp; 82,516</TD> <TD valign=top width=65>&nbsp; 9,897</TD> <TD valign=top width=65>&nbsp; 92,413</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 409.0</TD> <TD valign=top width=40>&nbsp; 101,664</TD> <TD valign=top width=40>&nbsp;110.01</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060401</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæééí áàâó</TD> <TD valign=top width=65>&nbsp; 18,115</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 18,115</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 94.5</TD> <TD valign=top width=40>&nbsp; 23,162</TD> <TD valign=top width=40>&nbsp;127.86</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060402</TD> <TD valign=top align="right" width=120>&nbsp;îçùåá îøùí äàåëìåñéï</TD> <TD valign=top width=65>&nbsp; 8,898</TD> <TD valign=top width=65>&nbsp; 3,544</TD> <TD valign=top width=65>&nbsp; 12,442</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 13,702</TD> <TD valign=top width=40>&nbsp;110.13</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060404</TD> <TD valign=top align="right" width=120>&nbsp;ìùëåú ìîðäì àåëìåñéï</TD> <TD valign=top width=65>&nbsp; 44,308</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 44,308</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 314.5</TD> <TD valign=top width=40>&nbsp; 48,351</TD> <TD valign=top width=40>&nbsp;109.12</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060405</TD> <TD valign=top align="right" width=120>&nbsp;áé÷åøú âáåìåú</TD> <TD valign=top width=65>&nbsp; 648</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 648</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060409</TD> <TD valign=top align="right" width=120>&nbsp;éçéãä ìèéôåì áòåáãéí æøéí</TD> <TD valign=top width=65>&nbsp; 190</TD> <TD valign=top width=65>&nbsp; 6,353</TD> <TD valign=top width=65>&nbsp; 6,543</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 7,839</TD> <TD valign=top width=40>&nbsp;119.81</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060410</TD> <TD valign=top align="right" width=120>&nbsp;éçéãú àëéôä òåáãéí æøéí</TD> <TD valign=top width=65>&nbsp; 10,357</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 10,357</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 8,611</TD> <TD valign=top width=40>&nbsp; 83.14</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0605</TD> <TD valign=top align="right" width=120>&nbsp;úëðåï ôéæé</TD> <TD valign=top width=65>&nbsp; 53,640</TD> <TD valign=top width=65>&nbsp; 35,712</TD> <TD valign=top width=65>&nbsp; 89,352</TD> <TD valign=top width=65>&nbsp; 100,000</TD> <TD valign=top width=65>&nbsp; 81.5</TD> <TD valign=top width=40>&nbsp; 66,221</TD> <TD valign=top width=40>&nbsp; 74.11</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060501</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæééí áîéðäì äúëðåï</TD> <TD valign=top width=65>&nbsp; 20,189</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 20,189</TD> <TD valign=top width=65>&nbsp; 4,000</TD> <TD valign=top width=65>&nbsp; 81.5</TD> <TD valign=top width=40>&nbsp; 19,991</TD> <TD valign=top width=40>&nbsp; 99.02</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060504</TD> <TD valign=top align="right" width=120>&nbsp;úëðéåú îúàø</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 21,150</TD> <TD valign=top width=65>&nbsp; 21,150</TD> <TD valign=top width=65>&nbsp; 56,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 6,078</TD> <TD valign=top width=40>&nbsp; 28.74</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060506</TD> <TD valign=top align="right" width=120>&nbsp;âåó îúàí ìú÷ðåú äáðéä</TD> <TD valign=top width=65>&nbsp; 1,500</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1,500</TD> <TD valign=top width=65>&nbsp; 2,250</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 378</TD> <TD valign=top width=40>&nbsp; 25.20</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060507</TD> <TD valign=top align="right" width=120>&nbsp;îãéðéåú åðäìé úëðåï</TD> <TD valign=top width=65>&nbsp; 400</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 400</TD> <TD valign=top width=65>&nbsp; 500</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 674</TD> <TD valign=top width=40>&nbsp;168.50</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060508</TD> <TD valign=top align="right" width=120>&nbsp;îò÷á á÷øä åúàåí úëðéåú</TD> <TD valign=top width=65>&nbsp; 700</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 700</TD> <TD valign=top width=65>&nbsp; 1,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 273</TD> <TD valign=top width=40>&nbsp; 39.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060509</TD> <TD valign=top align="right" width=120>&nbsp;äîåòöä äàøöéú ìúëðåï åáðéä</TD> <TD valign=top width=65>&nbsp; 25</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 25</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 10</TD> <TD valign=top width=40>&nbsp; 40.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060510</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúé úëðåï áîçåæåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 5,712</TD> <TD valign=top width=65>&nbsp; 5,712</TD> <TD valign=top width=65>&nbsp; 250</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 2,561</TD> <TD valign=top width=40>&nbsp; 44.84</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060511</TD> <TD valign=top align="right" width=120>&nbsp;îâæø òøáé ÷éãåí úåëðéåú</TD> <TD valign=top width=65>&nbsp; 25</TD> <TD valign=top width=65>&nbsp; 8,850</TD> <TD valign=top width=65>&nbsp; 8,875</TD> <TD valign=top width=65>&nbsp; 18,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 2,491</TD> <TD valign=top width=40>&nbsp; 28.07</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060512</TD> <TD valign=top align="right" width=120>&nbsp;åòãú úëðåï ìúùúéåú ìàåîéåú</TD> <TD valign=top width=65>&nbsp; 2,500</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2,500</TD> <TD valign=top width=65>&nbsp; 1,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 5,141</TD> <TD valign=top width=40>&nbsp;205.64</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060513</TD> <TD valign=top align="right" width=120>&nbsp;åòãåú úëðåï îçåæéåú</TD> <TD valign=top width=65>&nbsp; 28,301</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 28,301</TD> <TD valign=top width=65>&nbsp; 17,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 28,625</TD> <TD valign=top width=40>&nbsp;101.14</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0606</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúé çéøåí åúô÷éãéí îéåçãéí</TD> <TD valign=top width=65>&nbsp; 173</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 173</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060601</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæééí</TD> <TD valign=top width=65>&nbsp; 4</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 4</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060602</TD> <TD valign=top align="right" width=120>&nbsp;øéùåé åôé÷åç</TD> <TD valign=top width=65>&nbsp; 35</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 35</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060604</TD> <TD valign=top align="right" width=120>&nbsp;øùåú ôñ"ç</TD> <TD valign=top width=65>&nbsp; 35</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 35</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060605</TD> <TD valign=top align="right" width=120>&nbsp;øéùåé îôòìéí áéèçåðééí</TD> <TD valign=top width=65>&nbsp; 99</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 99</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0607</TD> <TD valign=top align="right" width=120>&nbsp;éçéãú øùí äòîåúåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060701</TD> <TD valign=top align="right" width=120>&nbsp;øùí äòîåúåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0608</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä</TD> <TD valign=top width=65>&nbsp; 5,134</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 5,134</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060801</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä ìäúéé÷øåéåú</TD> <TD valign=top width=65>&nbsp; 5,134</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 5,134</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060802</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0609</TD> <TD valign=top align="right" width=120>&nbsp;éçéãú äôé÷åç</TD> <TD valign=top width=65>&nbsp; 13,174</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 13,174</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 12.0</TD> <TD valign=top width=40>&nbsp; 14,609</TD> <TD valign=top width=40>&nbsp;110.89</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060901</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæéí</TD> <TD valign=top width=65>&nbsp; 12,596</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 12,596</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 12.0</TD> <TD valign=top width=40>&nbsp; 11,777</TD> <TD valign=top width=40>&nbsp; 93.50</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060902</TD> <TD valign=top align="right" width=120>&nbsp;úôòåì åàçæ÷ä</TD> <TD valign=top width=65>&nbsp; 578</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 578</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 2,833</TD> <TD valign=top width=40>&nbsp;490.14</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0610</TD> <TD valign=top align="right" width=120>&nbsp;ðöéáåú ëáàåú åäöìä</TD> <TD valign=top width=65>&nbsp; 6,933</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 6,933</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 27.0</TD> <TD valign=top width=40>&nbsp; 18,194</TD> <TD valign=top width=40>&nbsp;262.43</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;061002</TD> <TD valign=top align="right" width=120>&nbsp;ú÷öéá ðöéáåú ëáàåú åäöìä</TD> <TD valign=top width=65>&nbsp; 6,933</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 6,933</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 27.0</TD> <TD valign=top width=40>&nbsp; 17,650</TD> <TD valign=top width=40>&nbsp;254.58</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061003</TD> <TD valign=top align="right" width=120>&nbsp;ú÷öéá îëììä ìëáàåú åäöìä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 544</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0611</TD> <TD valign=top align="right" width=120>&nbsp;îéðäì äîéí</TD> <TD valign=top width=65>&nbsp; 3,774</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 3,774</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 3,312</TD> <TD valign=top width=40>&nbsp; 87.76</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061104</TD> <TD valign=top align="right" width=120>&nbsp;ëç àãí åôòåìåú</TD> <TD valign=top width=65>&nbsp; 3,774</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 3,774</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 3,312</TD> <TD valign=top width=40>&nbsp; 87.76</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0614</TD> <TD valign=top align="right" width=120>&nbsp;äîîåðä òì äúàâéãéí</TD> <TD valign=top width=65>&nbsp; 2,164</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2,164</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1.0</TD> <TD valign=top width=40>&nbsp; 1,406</TD> <TD valign=top width=40>&nbsp; 64.97</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061401</TD> <TD valign=top align="right" width=120>&nbsp;äîîåðä òì äúàâéãéí</TD> <TD valign=top width=65>&nbsp; 2,164</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2,164</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1.0</TD> <TD valign=top width=40>&nbsp; 1,406</TD> <TD valign=top width=40>&nbsp; 64.97</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0615</TD> <TD valign=top align="right" width=120>&nbsp;úôòåì ùéøåúé ãú</TD> <TD valign=top width=65>&nbsp; 40,090</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 40,090</TD> <TD valign=top width=65>&nbsp; 7,616</TD> <TD valign=top width=65>&nbsp; 156.0</TD> <TD valign=top width=40>&nbsp; 36,164</TD> <TD valign=top width=40>&nbsp; 90.21</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061501</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúé ãú ìòãåú ìà éäåãéåú</TD> <TD valign=top width=65>&nbsp; 29,644</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 29,644</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 156.0</TD> <TD valign=top width=40>&nbsp; 28,300</TD> <TD valign=top width=40>&nbsp; 95.47</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;061502</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä ìäúéé÷øåéåú- ùéøåúé ãú</TD> <TD valign=top width=65>&nbsp; 1,039</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1,039</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061503</TD> <TD valign=top align="right" width=120>&nbsp;îáðé ãú ìà éäåãééí</TD> <TD valign=top width=65>&nbsp; 9,407</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 9,407</TD> <TD valign=top width=65>&nbsp; 7,616</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 7,864</TD> <TD valign=top width=40>&nbsp; 83.60</TD> </TR> </TABLE> </CENTER> <BR> <CENTER> <table border="0" cellspacing="1" cellpadding="3" bgcolor="#8fbcee" dir="rtl"> <TR class="C" align="center"> <TD class="A_Row" valign=top width=80>ñéëåí ãå"ç</TD> <TD class="A_Row" valign=top width=60>äåöàä ðèå</TD> <TD class="A_Row" valign=top width=60>äåöàä îåúðéú áäëðñä</TD> <TD class="A_Row" valign=top width=60>ñä"ë äåöàä</TD> <TD class="A_Row" valign=top width=60>äøùàä ìäúçééá</TD> <TD class="A_Row" valign=top width=60>ùéà ë"à</TD> <TD class="A_Row" valign=top width=50>ñä"ë ðåöì</TD> <TD class="A_Row" valign=top width=50>àçåæ ðåöì</TD> </TR> <TR class="clear" align="center"> <TD class="A_Row" valign=top width=80>&nbsp;ú÷öéá î÷åøé</TD> <TD class="A_Row" valign=top width=60>&nbsp; 332,206</TD> <TD class="A_Row" valign=top width=60>&nbsp; 45,823</TD> <TD class="A_Row" valign=top width=60>&nbsp; 378,029</TD> <TD class="A_Row" valign=top width=60>&nbsp; 107,616</TD> <TD class="A_Row" valign=top width=60>&nbsp; 910</TD> <TD class="A_Row" valign=top width=50>&nbsp;</TD> <TD class="A_Row" valign=top width=50>&nbsp;</TD> </TR> <!--<TR class="clear" align="center"> <TD class="A_Row" valign=top width=80>&nbsp;ú÷öéá òì ùéðåééå</TD> <TD class="A_Row" valign=top width=60>&nbsp; 536,004</TD> <TD class="A_Row" valign=top width=60>&nbsp; 50,096</TD> <TD class="A_Row" valign=top width=60>&nbsp; 586,100</TD> <TD class="A_Row" valign=top width=60>&nbsp; 107,616</TD> <TD class="A_Row" valign=top width=60>&nbsp; 912</TD> <TD class="A_Row" valign=top width=50>&nbsp; 410,285</TD> <TD class="A_Row" valign=top width=50>&nbsp;108.53</TD> </TR>--> </TABLE> <CENTER> <TABLE WIDTH="100" > <TR> <TD align="center" nowrap> <IMG SRC="/budget/Images/semel.gif" HEIGHT=37 WIDTH=30 border = "0"><BR> <FONT SIZE=-2> <A HREF="http://www.mof.gov.il/rights.htm"> ëì äæëåéåú &copy; .ùîåøåú,2005,îãéðú éùøàì<BR></A> ðùîç ì÷áì àú äòøåúéëí åäöòåúéëí ìëúåáú: </FONT> <FONT SIZE=-2 dir=ltr> <A HREF="mailto:Webmaster@mof.gov.il">Webmaster@mof.gov.il</A><BR> </FONT> </TD> </TR> </TABLE> </CENTER> </CENTER> </BODY> </HTML>
Java
<?php /** * RSSAggregatingPage lets a CMS Authors aggregate and filter a number of RSS feed. */ class RSSAggregatingPage extends Page { static $db = array ( "NumberOfItems" => "Int" ); static $has_many = array( "SourceFeeds" => "RSSAggSource", "Entries" => "RSSAggEntry" ); private static $moderation_required = false; function getCMSFields() { $fields = parent::getCMSFields(); if(!isset($_REQUEST['executeForm'])) $this->updateRSS(); $fields->addFieldToTab("Root.Content.Sources", new TableField("SourceFeeds", "RSSAggSource", array( "RSSFeed" => "RSS Feed URL", "Title" => "Feed Title" ), array( "RSSFeed" => "TextField", "Title" => "ReadonlyField", ), "PageID", round($this->ID), true, "RSSFeed" )); global $number_of_items_list; // Insert Items as the first tab $fields->addFieldToTab("Root.Content", new Tab("Items"), "Main"); if ( !self::get_moderation_required() ) { $fields->addFieldToTab("Root.Content.Items", new DropdownField('NumberOfItems','Number Of Items', $number_of_items_list)); } $fields->addFieldToTab("Root.Content.Items", $entries = new TableField("Entries", "RSSAggEntry", array( "Displayed" => "Show", "DateNice" => "Date", "SourceNice" => "Source", "Title" => "Title", ), array( "Displayed" => "CheckboxField", "DateNice" => "ReadonlyField", "SourceNice" => "ReadonlyField", "Title" => "ReadonlyField", ), "PageID", round($this->ID), true, "Date DESC" )); $entries->setPermissions(array("edit")); return $fields; } /** * Use SimplePie to get all the RSS feeds and agregate them into Entries */ function updateRSS() { require_once(Director::baseFolder() . '/rssaggregator/thirdparty/simplepie/simplepie.inc'); if(!is_numeric($this->ID)) return; $goodSourceIDs = array(); foreach($this->SourceFeeds() as $sourceFeed) { $goodSourceIDs[] = $sourceFeed->ID; if(isset($_REQUEST['flush']) || strtotime($sourceFeed->LastChecked) < time() - 3600) { $simplePie = new SimplePie($sourceFeed->RSSFeed); /*$simplePie->enable_caching(false); $simplePie->enable_xmldump(true);*/ $simplePie->init(); $sourceFeed->Title = $simplePie->get_title(); $sourceFeed->LastChecked = date('Y-m-d H:i:s'); $sourceFeed->write(); $idClause = ''; $goodIDs = array(); $items = $simplePie->get_items(); //if(!$items) user_error("RSS Error: $simplePie->error", E_USER_WARNING); if($items) foreach($items as $item) { $entry = new RSSAggEntry(); $entry->Permalink = $item->get_permalink(); $entry->Date = $item->get_date('Y-m-d H:i:s'); $entry->Title = Convert::xml2raw($item->get_title()); $entry->Title = str_replace(array( '&nbsp;', '&lsquo;', '&rsquo;', '&ldquo;', '&rdquo;', '&amp;', '&apos;' ), array( '&#160;', "'", "'", '"', '"', '&', '`' ), $entry->Title); $entry->Content = str_replace(array( '&nbsp;', '&lsquo;', '&rsquo;', '&ldquo;', '&rdquo;', '&amp;', '&apos;' ), array( '&#160;', "'", "'", '"', '"', '&', '`' ), $item->get_description()); $entry->PageID = $this->ID; $entry->SourceID = $sourceFeed->ID; if($enclosure = $item->get_enclosure()) { $entry->EnclosureURL = $enclosure->get_link(); } $SQL_permalink = Convert::raw2sql($entry->Permalink); $existingID = DB::query("SELECT \"ID\" FROM \"RSSAggEntry\" WHERE \"Permalink\" = '$SQL_permalink' AND \"SourceID\" = $entry->SourceID AND \"PageID\" = $entry->PageID")->value(); if($existingID) $entry->ID = $existingID; $entry->write(); $goodIDs[] = $entry->ID; } if($goodIDs) { $list_goodIDs = implode(', ', $goodIDs); $idClause = "AND \"ID\" NOT IN ($list_goodIDs)"; } DB::query("DELETE FROM \"RSSAggEntry\" WHERE \"SourceID\" = $sourceFeed->ID AND \"PageID\" = $this->ID $idClause"); } } if($goodSourceIDs) { $list_goodSourceIDs = implode(', ', $goodSourceIDs); $sourceIDClause = " AND \"SourceID\" NOT IN ($list_goodSourceIDs)"; } else { $sourceIDClause = ''; } DB::query("DELETE FROM \"RSSAggEntry\" WHERE \"PageID\" = $this->ID $sourceIDClause"); } function Children() { $this->updateRSS(); // Tack the RSS feed children to the end of the children provided by the RSS feed $c1 = DataObject::get("SiteTree", "\"ParentID\" = '$this->ID'"); $c2 = DataObject::get("RSSAggEntry", "\"PageID\" = $this->ID AND \"Displayed\" = 1", "\"Date\" ASC"); if($c1) { if($c2) $c1->merge($c2); return $c1; } else { return $c2; } } /* * Set moderation mode * On (true) admin manually controls which items to display * Off (false) new imported feed item is set to display automatically * @param boolean */ static function set_moderation_required($required) { self::$moderation_required = $required; } /* * Get feed moderation mode * @return boolean */ static function get_moderation_required() { return self::$moderation_required; } } class RSSAggregatingPage_Controller extends Page_Controller { } ?>
Java
from . import Cl, conformalize layout_orig, blades_orig = Cl(3) layout, blades, stuff = conformalize(layout_orig) locals().update(blades) locals().update(stuff) # for shorter reprs layout.__name__ = 'layout' layout.__module__ = __name__
Java
using System; using Renci.SshNet.Messages.Connection; namespace Renci.SshNet.Channels { internal abstract class ServerChannel : Channel { internal void Initialize(Session session, uint localWindowSize, uint localPacketSize, uint remoteChannelNumber, uint remoteWindowSize, uint remotePacketSize) { Initialize(session, localWindowSize, localPacketSize); InitializeRemoteInfo(remoteChannelNumber, remoteWindowSize, remotePacketSize); //Session.ChannelOpenReceived += OnChannelOpen; } //private void OnChannelOpen(object sender, MessageEventArgs<ChannelOpenMessage> e) //{ // var channelOpenMessage = e.Message; // if (channelOpenMessage.LocalChannelNumber == LocalChannelNumber) // { // _remoteChannelNumber = channelOpenMessage.LocalChannelNumber; // RemoteWindowSize = channelOpenMessage.InitialWindowSize; // _remotePacketSize = channelOpenMessage.MaximumPacketSize; // OnOpen(e.Message.Info); // } //} protected void SendMessage(ChannelOpenConfirmationMessage message) { // No need to check whether channel is open when trying to open a channel Session.SendMessage(message); // When we act as server, consider the channel open when we've sent the // confirmation message to the peer IsOpen = true; } ///// <summary> ///// Called when channel need to be open on the client. ///// </summary> ///// <param name="info">Channel open information.</param> //protected virtual void OnOpen(ChannelOpenInfo info) //{ //} protected override void Dispose(bool disposing) { if (disposing) { var session = Session; if (session != null) { //session.ChannelOpenReceived -= OnChannelOpen; } } base.Dispose(disposing); } } }
Java
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>mne.find_events &#8212; MNE 0.15 documentation</title> <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/gallery.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '0.15', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt' }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/javascript" src="../_static/js/jquery-1.11.0.min.js"></script> <script type="text/javascript" src="../_static/js/jquery-fix.js"></script> <script type="text/javascript" src="../_static/bootstrap-3.3.7/js/bootstrap.min.js"></script> <script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <script type="text/javascript" src="../_static/copybutton.js"></script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-37225609-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <link rel="stylesheet" href="../_static/style.css " type="text/css" /> <link rel="stylesheet" href="../_static/font-awesome.css" type="text/css" /> <link rel="stylesheet" href="../_static/flag-icon.css" type="text/css" /> <script type="text/javascript"> !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s); js.id=id;js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); </script> <script type="text/javascript"> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> <link rel="canonical" href="https://mne.tools/stable/index.html" /> </head> <body> <div id="navbar" class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <!-- .btn-navbar is used as the toggle for collapsed navbar content --> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.html"><span><img src="../_static/mne_logo_small.png"></span> </a> <span class="navbar-text navbar-version pull-left"><b>0.15</b></span> </div> <div class="collapse navbar-collapse nav-collapse"> <ul class="nav navbar-nav"> <li><a href="../getting_started.html">Install</a></li> <li><a href="../documentation.html">Documentation</a></li> <li><a href="../python_reference.html">API</a></li> <li><a href="../auto_examples/index.html">Examples</a></li> <li><a href="../contributing.html">Contribute</a></li> <li class="dropdown globaltoc-container"> <a role="button" id="dLabelGlobalToc" data-toggle="dropdown" data-target="#" href="../index.html">Site <b class="caret"></b></a> <ul class="dropdown-menu globaltoc" role="menu" aria-labelledby="dLabelGlobalToc"></ul> </li> <li class="hidden-sm"></li> </ul> <div class="navbar-form navbar-right navbar-btn dropdown btn-group-sm" style="margin-left: 20px; margin-top: 5px; margin-bottom: 5px"> <button type="button" class="btn btn-primary navbar-btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown"> v0.15 <span class="caret"></span> </button> <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> <li><a href="https://mne-tools.github.io/dev/index.html">Development</a></li> <li><a href="https://mne-tools.github.io/stable/index.html">v0.15 (stable)</a></li> <li><a href="https://mne-tools.github.io/0.14/index.html">v0.14</a></li> <li><a href="https://mne-tools.github.io/0.13/index.html">v0.13</a></li> <li><a href="https://mne-tools.github.io/0.12/index.html">v0.12</a></li> <li><a href="https://mne-tools.github.io/0.11/index.html">v0.11</a></li> </ul> </div> <form class="navbar-form navbar-right" action="../search.html" method="get"> <div class="form-group"> <input type="text" name="q" class="form-control" placeholder="Search" /> </div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> </div> <div class="container"> <div class="row"> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="../index.html"> <img class="logo" src="../_static/mne_logo_small.png" alt="Logo"/> </a></p><ul> <li><a class="reference internal" href="#">mne.find_events</a><ul> <li><a class="reference internal" href="#examples-using-mne-find-events">Examples using <code class="docutils literal"><span class="pre">mne.find_events</span></code></a></li> </ul> </li> </ul> <form action="../search.html" method="get"> <div class="form-group"> <input type="text" name="q" class="form-control" placeholder="Search" /> </div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="col-md-12 content"> <div class="section" id="mne-find-events"> <h1>mne.find_events<a class="headerlink" href="#mne-find-events" title="Permalink to this headline">¶</a></h1> <dl class="function"> <dt id="mne.find_events"> <code class="descclassname">mne.</code><code class="descname">find_events</code><span class="sig-paren">(</span><em>raw</em>, <em>stim_channel=None</em>, <em>output='onset'</em>, <em>consecutive='increasing'</em>, <em>min_duration=0</em>, <em>shortest_event=2</em>, <em>mask=None</em>, <em>uint_cast=False</em>, <em>mask_type=None</em>, <em>verbose=None</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/mne-tools/mne-python/blob/maint/0.15/mne/event.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#mne.find_events" title="Permalink to this definition">¶</a></dt> <dd><p>Find events from raw file.</p> <p>See <a class="reference internal" href="../auto_tutorials/plot_epoching_and_averaging.html#tut-epoching-and-averaging"><span class="std std-ref">Epoching and averaging (ERP/ERF)</span></a> as well as <a class="reference internal" href="../auto_examples/io/plot_read_events.html#ex-read-events"><span class="std std-ref">Reading an event file</span></a> for more information about events.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>raw</strong> : Raw object</p> <blockquote> <div><p>The raw data.</p> </div></blockquote> <p><strong>stim_channel</strong> : None | string | list of string</p> <blockquote> <div><p>Name of the stim channel or all the stim channels affected by triggers. If None, the config variables ‘MNE_STIM_CHANNEL’, ‘MNE_STIM_CHANNEL_1’, ‘MNE_STIM_CHANNEL_2’, etc. are read. If these are not found, it will fall back to ‘STI 014’ if present, then fall back to the first channel of type ‘stim’, if present. If multiple channels are provided then the returned events are the union of all the events extracted from individual stim channels.</p> </div></blockquote> <p><strong>output</strong> : ‘onset’ | ‘offset’ | ‘step’</p> <blockquote> <div><p>Whether to report when events start, when events end, or both.</p> </div></blockquote> <p><strong>consecutive</strong> : bool | ‘increasing’</p> <blockquote> <div><p>If True, consider instances where the value of the events channel changes without first returning to zero as multiple events. If False, report only instances where the value of the events channel changes from/to zero. If ‘increasing’, report adjacent events only when the second event code is greater than the first.</p> </div></blockquote> <p><strong>min_duration</strong> : float</p> <blockquote> <div><p>The minimum duration of a change in the events channel required to consider it as an event (in seconds).</p> </div></blockquote> <p><strong>shortest_event</strong> : int</p> <blockquote> <div><p>Minimum number of samples an event must last (default is 2). If the duration is less than this an exception will be raised.</p> </div></blockquote> <p><strong>mask</strong> : int | None</p> <blockquote> <div><p>The value of the digital mask to apply to the stim channel values. If None (default), no masking is performed.</p> </div></blockquote> <p><strong>uint_cast</strong> : bool</p> <blockquote> <div><p>If True (default False), do a cast to <code class="docutils literal"><span class="pre">uint16</span></code> on the channel data. This can be used to fix a bug with STI101 and STI014 in Neuromag acquisition setups that use channel STI016 (channel 16 turns data into e.g. -32768), similar to <code class="docutils literal"><span class="pre">mne_fix_stim14</span> <span class="pre">--32</span></code> in MNE-C.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.12.</span></p> </div> </div></blockquote> <p><strong>mask_type: ‘and’ | ‘not_and’</strong></p> <blockquote> <div><p>The type of operation between the mask and the trigger. Choose ‘and’ for MNE-C masking behavior. The default (‘not_and’) will change to ‘and’ in 0.16.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.13.</span></p> </div> </div></blockquote> <p><strong>verbose</strong> : bool, str, int, or None</p> <blockquote> <div><p>If not None, override default verbose level (see <a class="reference internal" href="mne.verbose.html#mne.verbose" title="mne.verbose"><code class="xref py py-func docutils literal"><span class="pre">mne.verbose()</span></code></a> and <a class="reference internal" href="../auto_tutorials/plot_configuration.html#tut-logging"><span class="std std-ref">Logging documentation</span></a> for more).</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>events</strong> : array, shape = (n_events, 3)</p> <blockquote class="last"> <div><p>All events that were found. The first column contains the event time in samples and the third column contains the event id. For output = ‘onset’ or ‘step’, the second column contains the value of the stim channel immediately before the event/step. For output = ‘offset’, the second column contains the value of the stim channel after the event offset.</p> </div></blockquote> </td> </tr> </tbody> </table> <div class="admonition seealso"> <p class="first admonition-title">See also</p> <dl class="last docutils"> <dt><a class="reference internal" href="mne.find_stim_steps.html#mne.find_stim_steps" title="mne.find_stim_steps"><code class="xref py py-obj docutils literal"><span class="pre">find_stim_steps</span></code></a></dt> <dd>Find all the steps in the stim channel.</dd> <dt><a class="reference internal" href="mne.read_events.html#mne.read_events" title="mne.read_events"><code class="xref py py-obj docutils literal"><span class="pre">read_events</span></code></a></dt> <dd>Read events from disk.</dd> <dt><a class="reference internal" href="mne.write_events.html#mne.write_events" title="mne.write_events"><code class="xref py py-obj docutils literal"><span class="pre">write_events</span></code></a></dt> <dd>Write events to disk.</dd> </dl> </div> <p class="rubric">Notes</p> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">If you are working with downsampled data, events computed before decimation are no longer valid. Please recompute your events after decimation, but note this reduces the precision of event timing.</p> </div> <p class="rubric">Examples</p> <p>Consider data with a stim channel that looks like:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">33</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span> </pre></div> </div> <p>By default, find_events returns all samples at which the value of the stim channel increases:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">))</span> <span class="go">[[ 1 0 32]</span> <span class="go"> [ 3 32 33]]</span> </pre></div> </div> <p>If consecutive is False, find_events only returns the samples at which the stim channel changes from zero to a non-zero value:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">False</span><span class="p">))</span> <span class="go">[[ 1 0 32]]</span> </pre></div> </div> <p>If consecutive is True, find_events returns samples at which the event changes, regardless of whether it first returns to zero:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span> <span class="go">[[ 1 0 32]</span> <span class="go"> [ 3 32 33]</span> <span class="go"> [ 4 33 32]]</span> </pre></div> </div> <p>If output is ‘offset’, find_events returns the last sample of each event instead of the first one:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="gp">... </span> <span class="n">output</span><span class="o">=</span><span class="s1">&#39;offset&#39;</span><span class="p">))</span> <span class="go">[[ 2 33 32]</span> <span class="go"> [ 3 32 33]</span> <span class="go"> [ 4 0 32]]</span> </pre></div> </div> <p>If output is ‘step’, find_events returns the samples at which an event starts or ends:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="gp">... </span> <span class="n">output</span><span class="o">=</span><span class="s1">&#39;step&#39;</span><span class="p">))</span> <span class="go">[[ 1 0 32]</span> <span class="go"> [ 3 32 33]</span> <span class="go"> [ 4 33 32]</span> <span class="go"> [ 5 32 0]]</span> </pre></div> </div> <p>To ignore spurious events, it is also possible to specify a minimum event duration. Assuming our events channel has a sample rate of 1000 Hz:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="gp">... </span> <span class="n">min_duration</span><span class="o">=</span><span class="mf">0.002</span><span class="p">))</span> <span class="go">[[ 1 0 32]]</span> </pre></div> </div> <p>For the digital mask, if mask_type is set to ‘and’ it will take the binary representation of the digital mask, e.g. 5 -&gt; ‘00000101’, and will allow the values to pass where mask is one, e.g.:</p> <div class="highlight-default"><div class="highlight"><pre><span></span> <span class="mi">7</span> <span class="s1">&#39;0000111&#39;</span> <span class="o">&lt;-</span> <span class="n">trigger</span> <span class="n">value</span> <span class="mi">37</span> <span class="s1">&#39;0100101&#39;</span> <span class="o">&lt;-</span> <span class="n">mask</span> <span class="o">----------------</span> <span class="mi">5</span> <span class="s1">&#39;0000101&#39;</span> </pre></div> </div> <p>For the digital mask, if mask_type is set to ‘not_and’ it will take the binary representation of the digital mask, e.g. 5 -&gt; ‘00000101’, and will block the values where mask is one, e.g.:</p> <div class="highlight-default"><div class="highlight"><pre><span></span> <span class="mi">7</span> <span class="s1">&#39;0000111&#39;</span> <span class="o">&lt;-</span> <span class="n">trigger</span> <span class="n">value</span> <span class="mi">37</span> <span class="s1">&#39;0100101&#39;</span> <span class="o">&lt;-</span> <span class="n">mask</span> <span class="o">----------------</span> <span class="mi">2</span> <span class="s1">&#39;0000010&#39;</span> </pre></div> </div> </dd></dl> <div class="section" id="examples-using-mne-find-events"> <h2>Examples using <code class="docutils literal"><span class="pre">mne.find_events</span></code><a class="headerlink" href="#examples-using-mne-find-events" title="Permalink to this headline">¶</a></h2> <div class="sphx-glr-thumbcontainer" tooltip="The MEGSIM consists of experimental and simulated MEG data which can be useful for reproducing ..."><div class="figure" id="id1"> <img alt="../_images/sphx_glr_plot_megsim_data_thumb.png" src="../_images/sphx_glr_plot_megsim_data_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/datasets/plot_megsim_data.html#sphx-glr-auto-examples-datasets-plot-megsim-data-py"><span class="std std-ref">MEGSIM experimental and simulation datasets</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Here we compute the evoked from raw for the Brainstorm tutorial dataset. For comparison, see [1..."><div class="figure" id="id2"> <img alt="../_images/sphx_glr_plot_brainstorm_data_thumb.png" src="../_images/sphx_glr_plot_brainstorm_data_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/datasets/plot_brainstorm_data.html#sphx-glr-auto-examples-datasets-plot-brainstorm-data-py"><span class="std std-ref">Brainstorm tutorial datasets</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Runs a full pipeline using MNE-Python:"><div class="figure" id="id3"> <img alt="../_images/sphx_glr_plot_spm_faces_dataset_thumb.png" src="../_images/sphx_glr_plot_spm_faces_dataset_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/datasets/plot_spm_faces_dataset.html#sphx-glr-auto-examples-datasets-plot-spm-faces-dataset-py"><span class="std std-ref">From raw data to dSPM on SPM Faces dataset</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Representational Similarity Analysis is used to perform summary statistics on supervised classi..."><div class="figure" id="id4"> <img alt="../_images/sphx_glr_decoding_rsa_thumb.png" src="../_images/sphx_glr_decoding_rsa_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/decoding/decoding_rsa.html#sphx-glr-auto-examples-decoding-decoding-rsa-py"><span class="std std-ref">Representational Similarity Analysis</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Decoding of motor imagery applied to EEG data decomposed using CSP. Here the classifier is appl..."><div class="figure" id="id5"> <img alt="../_images/sphx_glr_plot_decoding_csp_eeg_thumb.png" src="../_images/sphx_glr_plot_decoding_csp_eeg_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/decoding/plot_decoding_csp_eeg.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-eeg-py"><span class="std std-ref">Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=" The time-frequency decomposition is estimated by iterating over raw data that has been band-pa..."><div class="figure" id="id6"> <img alt="../_images/sphx_glr_plot_decoding_csp_timefreq_thumb.png" src="../_images/sphx_glr_plot_decoding_csp_timefreq_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/decoding/plot_decoding_csp_timefreq.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-timefreq-py"><span class="std std-ref">Decoding in time-frequency space data using the Common Spatial Pattern (CSP)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the relationship between the noise covariance estimate and the MNE / ..."><div class="figure" id="id7"> <img alt="../_images/sphx_glr_plot_covariance_whitening_dspm_thumb.png" src="../_images/sphx_glr_plot_covariance_whitening_dspm_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/inverse/plot_covariance_whitening_dspm.html#sphx-glr-auto-examples-inverse-plot-covariance-whitening-dspm-py"><span class="std std-ref">Demonstrate impact of whitening on source estimates</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="ICA is fit to MEG raw data. We assume that the non-stationary EOG artifacts have already been r..."><div class="figure" id="id8"> <img alt="../_images/sphx_glr_plot_run_ica_thumb.png" src="../_images/sphx_glr_plot_run_ica_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/preprocessing/plot_run_ica.html#sphx-glr-auto-examples-preprocessing-plot-run-ica-py"><span class="std std-ref">Compute ICA components on epochs</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Compute the distribution of timing for EOG artifacts."><div class="figure" id="id9"> <img alt="../_images/sphx_glr_plot_eog_artifact_histogram_thumb.png" src="../_images/sphx_glr_plot_eog_artifact_histogram_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/preprocessing/plot_eog_artifact_histogram.html#sphx-glr-auto-examples-preprocessing-plot-eog-artifact-histogram-py"><span class="std std-ref">Show EOG artifact timing</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Demonstrate movement compensation on simulated data. The simulated data contains bilateral acti..."><div class="figure" id="id10"> <img alt="../_images/sphx_glr_plot_movement_compensation_thumb.png" src="../_images/sphx_glr_plot_movement_compensation_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/preprocessing/plot_movement_compensation.html#sphx-glr-auto-examples-preprocessing-plot-movement-compensation-py"><span class="std std-ref">Maxwell filter data with movement compensation</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="When performing experiments where timing is critical, a signal with a high sampling rate is des..."><div class="figure" id="id11"> <img alt="../_images/sphx_glr_plot_resample_thumb.png" src="../_images/sphx_glr_plot_resample_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/preprocessing/plot_resample.html#sphx-glr-auto-examples-preprocessing-plot-resample-py"><span class="std std-ref">Resampling data</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This example generates raw data by repeating a desired source activation multiple times."><div class="figure" id="id12"> <img alt="../_images/sphx_glr_plot_simulate_raw_data_thumb.png" src="../_images/sphx_glr_plot_simulate_raw_data_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/simulation/plot_simulate_raw_data.html#sphx-glr-auto-examples-simulation-plot-simulate-raw-data-py"><span class="std std-ref">Generate simulated raw data</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This demonstrates how rER[P/F]s - regressing the continuous data - is a generalisation of tradi..."><div class="figure" id="id13"> <img alt="../_images/sphx_glr_plot_linear_regression_raw_thumb.png" src="../_images/sphx_glr_plot_linear_regression_raw_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/stats/plot_linear_regression_raw.html#sphx-glr-auto-examples-stats-plot-linear-regression-raw-py"><span class="std std-ref">Regression on continuous data (rER[P/F])</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Returns an STC file containing the PSD (in dB) of each of the sources."><div class="figure" id="id14"> <img alt="../_images/sphx_glr_plot_source_power_spectrum_thumb.png" src="../_images/sphx_glr_plot_source_power_spectrum_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_source_power_spectrum.html#sphx-glr-auto-examples-time-frequency-plot-source-power-spectrum-py"><span class="std std-ref">Compute power spectrum densities of the sources with dSPM</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Returns STC files ie source estimates of induced power for different bands in the source space...."><div class="figure" id="id15"> <img alt="../_images/sphx_glr_plot_source_space_time_frequency_thumb.png" src="../_images/sphx_glr_plot_source_space_time_frequency_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_source_space_time_frequency.html#sphx-glr-auto-examples-time-frequency-plot-source-space-time-frequency-py"><span class="std std-ref">Compute induced power in the source space with dSPM</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="The objective is to show you how to explore spectrally localized effects. For this purpose we a..."><div class="figure" id="id16"> <img alt="../_images/sphx_glr_plot_time_frequency_global_field_power_thumb.png" src="../_images/sphx_glr_plot_time_frequency_global_field_power_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_time_frequency_global_field_power.html#sphx-glr-auto-examples-time-frequency-plot-time-frequency-global-field-power-py"><span class="std std-ref">Explore event-related dynamics for specific frequency bands</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Compute time-frequency maps of power and phase lock in the source space. The inverse method is ..."><div class="figure" id="id17"> <img alt="../_images/sphx_glr_plot_source_label_time_frequency_thumb.png" src="../_images/sphx_glr_plot_source_label_time_frequency_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_source_label_time_frequency.html#sphx-glr-auto-examples-time-frequency-plot-source-label-time-frequency-py"><span class="std std-ref">Compute power and phase lock in label of the source space</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This example calculates and displays ERDS maps of event-related EEG data. ERDS (sometimes also ..."><div class="figure" id="id18"> <img alt="../_images/sphx_glr_plot_time_frequency_erds_thumb.png" src="../_images/sphx_glr_plot_time_frequency_erds_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_time_frequency_erds.html#sphx-glr-auto-examples-time-frequency-plot-time-frequency-erds-py"><span class="std std-ref">Compute and visualize ERDS maps</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This will produce what is sometimes called an event related potential / field (ERP/ERF) image."><div class="figure" id="id19"> <img alt="../_images/sphx_glr_plot_roi_erpimage_by_rt_thumb.png" src="../_images/sphx_glr_plot_roi_erpimage_by_rt_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/visualization/plot_roi_erpimage_by_rt.html#sphx-glr-auto-examples-visualization-plot-roi-erpimage-by-rt-py"><span class="std std-ref">Plot single trial activity, grouped by ROI and sorted by RT</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This tutorial shows how to clean MEG data with Maxwell filtering."><div class="figure" id="id20"> <img alt="../_images/sphx_glr_plot_artifacts_correction_maxwell_filtering_thumb.png" src="../_images/sphx_glr_plot_artifacts_correction_maxwell_filtering_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_artifacts_correction_maxwell_filtering.html#sphx-glr-auto-tutorials-plot-artifacts-correction-maxwell-filtering-py"><span class="std std-ref">Artifact correction with Maxwell filter</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=""><div class="figure" id="id21"> <img alt="../_images/sphx_glr_plot_artifacts_correction_ssp_thumb.png" src="../_images/sphx_glr_plot_artifacts_correction_ssp_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_artifacts_correction_ssp.html#sphx-glr-auto-tutorials-plot-artifacts-correction-ssp-py"><span class="std std-ref">Artifact Correction with SSP</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Many methods in MNE, including e.g. source estimation and some classification algorithms, requi..."><div class="figure" id="id22"> <img alt="../_images/sphx_glr_plot_compute_covariance_thumb.png" src="../_images/sphx_glr_plot_compute_covariance_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_compute_covariance.html#sphx-glr-auto-tutorials-plot-compute-covariance-py"><span class="std std-ref">Computing covariance matrix</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=""><div class="figure" id="id23"> <img alt="../_images/sphx_glr_plot_epoching_and_averaging_thumb.png" src="../_images/sphx_glr_plot_epoching_and_averaging_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_epoching_and_averaging.html#sphx-glr-auto-tutorials-plot-epoching-and-averaging-py"><span class="std std-ref">Epoching and averaging (ERP/ERF)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=""><div class="figure" id="id24"> <img alt="../_images/sphx_glr_plot_artifacts_correction_rejection_thumb.png" src="../_images/sphx_glr_plot_artifacts_correction_rejection_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_artifacts_correction_rejection.html#sphx-glr-auto-tutorials-plot-artifacts-correction-rejection-py"><span class="std std-ref">Rejecting bad data (channels and segments)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=":class:`Epochs &lt;mne.Epochs&gt;` objects are a way of representing continuous data as a collection ..."><div class="figure" id="id25"> <img alt="../_images/sphx_glr_plot_object_epochs_thumb.png" src="../_images/sphx_glr_plot_object_epochs_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_object_epochs.html#sphx-glr-auto-tutorials-plot-object-epochs-py"><span class="std std-ref">The Epochs data structure: epoched data</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="The objective is to show you how to explore the spectral content of your data (frequency and ti..."><div class="figure" id="id26"> <img alt="../_images/sphx_glr_plot_sensors_time_frequency_thumb.png" src="../_images/sphx_glr_plot_sensors_time_frequency_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_sensors_time_frequency.html#sphx-glr-auto-tutorials-plot-sensors-time-frequency-py"><span class="std std-ref">Frequency and time-frequency sensors analysis</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This script shows how to estimate significant clusters in time-frequency power estimates. It us..."><div class="figure" id="id27"> <img alt="../_images/sphx_glr_plot_stats_cluster_1samp_test_time_frequency_thumb.png" src="../_images/sphx_glr_plot_stats_cluster_1samp_test_time_frequency_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_stats_cluster_1samp_test_time_frequency.html#sphx-glr-auto-tutorials-plot-stats-cluster-1samp-test-time-frequency-py"><span class="std std-ref">Non-parametric 1 sample cluster statistic on single trial power</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Here we compute the evoked from raw for the Brainstorm Elekta phantom tutorial dataset. For com..."><div class="figure" id="id28"> <img alt="../_images/sphx_glr_plot_brainstorm_phantom_elekta_thumb.png" src="../_images/sphx_glr_plot_brainstorm_phantom_elekta_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_brainstorm_phantom_elekta.html#sphx-glr-auto-tutorials-plot-brainstorm-phantom-elekta-py"><span class="std std-ref">Brainstorm Elekta phantom tutorial dataset</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="The aim of this tutorial is to teach you how to compute and apply a linear inverse method such ..."><div class="figure" id="id29"> <img alt="../_images/sphx_glr_plot_mne_dspm_source_localization_thumb.png" src="../_images/sphx_glr_plot_mne_dspm_source_localization_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_mne_dspm_source_localization.html#sphx-glr-auto-tutorials-plot-mne-dspm-source-localization-py"><span class="std std-ref">Source localization with MNE/dSPM/sLORETA</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="The aim of this tutorial is to demonstrate how to put a known signal at a desired location(s) i..."><div class="figure" id="id30"> <img alt="../_images/sphx_glr_plot_point_spread_thumb.png" src="../_images/sphx_glr_plot_point_spread_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_point_spread.html#sphx-glr-auto-tutorials-plot-point-spread-py"><span class="std std-ref">Corrupt known signal with point spread</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Decoding, a.k.a MVPA or supervised machine learning applied to MEG data in sensor space. Here t..."><div class="figure" id="id31"> <img alt="../_images/sphx_glr_plot_sensors_decoding_thumb.png" src="../_images/sphx_glr_plot_sensors_decoding_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_sensors_decoding.html#sphx-glr-auto-tutorials-plot-sensors-decoding-py"><span class="std std-ref">Decoding sensor space data (MVPA)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="MNE-Python reimplements most of MNE-C's (the original MNE command line utils) functionality and..."><div class="figure" id="id32"> <img alt="../_images/sphx_glr_plot_introduction_thumb.png" src="../_images/sphx_glr_plot_introduction_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_introduction.html#sphx-glr-auto-tutorials-plot-introduction-py"><span class="std std-ref">Basic MEG and EEG data processing</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Here we compute the evoked from raw for the auditory Brainstorm tutorial dataset. For compariso..."><div class="figure" id="id33"> <img alt="../_images/sphx_glr_plot_brainstorm_auditory_thumb.png" src="../_images/sphx_glr_plot_brainstorm_auditory_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_brainstorm_auditory.html#sphx-glr-auto-tutorials-plot-brainstorm-auditory-py"><span class="std std-ref">Brainstorm auditory tutorial dataset</span></a></span></p> </div> </div><div style='clear:both'></div></div> </div> </div> </div> </div> <footer class="footer"> <div class="container"><img src="../_static/institutions.png" alt="Institutions"></div> <div class="container"> <ul class="list-inline"> <li><a href="https://github.com/mne-tools/mne-python">GitHub</a></li> <li>·</li> <li><a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis">Mailing list</a></li> <li>·</li> <li><a href="https://gitter.im/mne-tools/mne-python">Gitter</a></li> <li>·</li> <li><a href="whats_new.html">What's new</a></li> <li>·</li> <li><a href="faq.html#cite">Cite MNE</a></li> <li class="pull-right"><a href="#">Back to top</a></li> </ul> <p>&copy; Copyright 2012-2017, MNE Developers. Last updated on 2017-10-31.</p> </div> </footer> <script src="https://mne.tools/versionwarning.js"></script> </body> </html>
Java
<?php use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model app\models\ShopGoodsCategory */ $this->title = Yii::t('app', 'Create Shop Goods Category'); $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Shop Goods Categories'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="shop-goods-category-create"> <?= $this->render('_form', [ 'model' => $model, ]) ?> </div>
Java
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/browser/chromeos/login/login_utils.h" #include <algorithm> #include <set> #include <vector> #include "base/bind.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/location.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/memory/weak_ptr.h" #include "base/path_service.h" #include "base/prefs/pref_member.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_service.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/lock.h" #include "base/sys_info.h" #include "base/task_runner_util.h" #include "base/threading/worker_pool.h" #include "base/time/time.h" #include "chrome/browser/about_flags.h" #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/boot_times_loader.h" #include "chrome/browser/chromeos/input_method/input_method_util.h" #include "chrome/browser/chromeos/login/chrome_restart_request.h" #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" #include "chrome/browser/chromeos/login/input_events_blocker.h" #include "chrome/browser/chromeos/login/login_display_host.h" #include "chrome/browser/chromeos/login/oauth2_login_manager.h" #include "chrome/browser/chromeos/login/oauth2_login_manager_factory.h" #include "chrome/browser/chromeos/login/parallel_authenticator.h" #include "chrome/browser/chromeos/login/profile_auth_data.h" #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h" #include "chrome/browser/chromeos/login/screen_locker.h" #include "chrome/browser/chromeos/login/startup_utils.h" #include "chrome/browser/chromeos/login/supervised_user_manager.h" #include "chrome/browser/chromeos/login/user.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/first_run/first_run.h" #include "chrome/browser/google/google_util_chromeos.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/pref_service_flags_storage.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/rlz/rlz.h" #include "chrome/browser/signin/signin_manager.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/ui/app_list/start_page_service.h" #include "chrome/browser/ui/startup/startup_browser_creator.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "chrome/common/pref_names.h" #include "chromeos/chromeos_switches.h" #include "chromeos/cryptohome/cryptohome_util.h" #include "chromeos/dbus/cryptohome_client.h" #include "chromeos/dbus/dbus_method_call_status.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/session_manager_client.h" #include "chromeos/ime/input_method_manager.h" #include "chromeos/settings/cros_settings_names.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "google_apis/gaia/gaia_auth_consumer.h" #include "net/base/network_change_notifier.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" #include "url/gurl.h" using content::BrowserThread; namespace chromeos { namespace { #if defined(ENABLE_RLZ) // Flag file that disables RLZ tracking, when present. const base::FilePath::CharType kRLZDisabledFlagName[] = FILE_PATH_LITERAL(".rlz_disabled"); base::FilePath GetRlzDisabledFlagPath() { return base::GetHomeDir().Append(kRLZDisabledFlagName); } #endif } // namespace struct DoBrowserLaunchOnLocaleLoadedData; class LoginUtilsImpl : public LoginUtils, public OAuth2LoginManager::Observer, public net::NetworkChangeNotifier::ConnectionTypeObserver, public base::SupportsWeakPtr<LoginUtilsImpl> { public: LoginUtilsImpl() : has_web_auth_cookies_(false), delegate_(NULL), exit_after_session_restore_(false), session_restore_strategy_( OAuth2LoginManager::RESTORE_FROM_SAVED_OAUTH2_REFRESH_TOKEN) { net::NetworkChangeNotifier::AddConnectionTypeObserver(this); } virtual ~LoginUtilsImpl() { net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); } // LoginUtils implementation: virtual void DoBrowserLaunch(Profile* profile, LoginDisplayHost* login_host) OVERRIDE; virtual void PrepareProfile( const UserContext& user_context, const std::string& display_email, bool has_cookies, bool has_active_session, LoginUtils::Delegate* delegate) OVERRIDE; virtual void DelegateDeleted(LoginUtils::Delegate* delegate) OVERRIDE; virtual void CompleteOffTheRecordLogin(const GURL& start_url) OVERRIDE; virtual void SetFirstLoginPrefs(PrefService* prefs) OVERRIDE; virtual scoped_refptr<Authenticator> CreateAuthenticator( LoginStatusConsumer* consumer) OVERRIDE; virtual void RestoreAuthenticationSession(Profile* profile) OVERRIDE; virtual void InitRlzDelayed(Profile* user_profile) OVERRIDE; // OAuth2LoginManager::Observer overrides. virtual void OnSessionRestoreStateChanged( Profile* user_profile, OAuth2LoginManager::SessionRestoreState state) OVERRIDE; virtual void OnNewRefreshTokenAvaiable(Profile* user_profile) OVERRIDE; // net::NetworkChangeNotifier::ConnectionTypeObserver overrides. virtual void OnConnectionTypeChanged( net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; private: typedef std::set<std::string> SessionRestoreStateSet; // DoBrowserLaunch is split into two parts. // This one is called after anynchronous locale switch. void DoBrowserLaunchOnLocaleLoadedImpl(Profile* profile, LoginDisplayHost* login_host); // Callback for locale_util::SwitchLanguage(). static void DoBrowserLaunchOnLocaleLoaded( scoped_ptr<DoBrowserLaunchOnLocaleLoadedData> context, const std::string& locale, const std::string& loaded_locale, const bool success); // Restarts OAuth session authentication check. void KickStartAuthentication(Profile* profile); // Callback for Profile::CREATE_STATUS_CREATED profile state. // Initializes basic preferences for newly created profile. Any other // early profile initialization that needs to happen before // ProfileManager::DoFinalInit() gets called is done here. void InitProfilePreferences(Profile* user_profile, const std::string& email); // Callback for asynchronous profile creation. void OnProfileCreated(const std::string& email, Profile* profile, Profile::CreateStatus status); // Callback for asynchronous off the record profile creation. void OnOTRProfileCreated(const std::string& email, Profile* profile, Profile::CreateStatus status); // Callback for Profile::CREATE_STATUS_INITIALIZED profile state. // Profile is created, extensions and promo resources are initialized. void UserProfileInitialized(Profile* user_profile); // Callback for Profile::CREATE_STATUS_INITIALIZED profile state for an OTR // login. void OTRProfileInitialized(Profile* user_profile); // Callback to resume profile creation after transferring auth data from // the authentication profile. void CompleteProfileCreate(Profile* user_profile); // Finalized profile preparation. void FinalizePrepareProfile(Profile* user_profile); // Initializes member variables needed for session restore process via // OAuthLoginManager. void InitSessionRestoreStrategy(); // Restores GAIA auth cookies for the created user profile from OAuth2 token. void RestoreAuthSession(Profile* user_profile, bool restore_from_auth_cookies); // Initializes RLZ. If |disabled| is true, RLZ pings are disabled. void InitRlz(Profile* user_profile, bool disabled); // Attempts restarting the browser process and esures that this does // not happen while we are still fetching new OAuth refresh tokens. void AttemptRestart(Profile* profile); UserContext user_context_; // True if the authentication profile's cookie jar should contain // authentication cookies from the authentication extension log in flow. bool has_web_auth_cookies_; // Has to be scoped_refptr, see comment for CreateAuthenticator(...). scoped_refptr<Authenticator> authenticator_; // Delegate to be fired when the profile will be prepared. LoginUtils::Delegate* delegate_; // Set of user_id for those users that we should restore authentication // session when notified about online state change. SessionRestoreStateSet pending_restore_sessions_; // True if we should restart chrome right after session restore. bool exit_after_session_restore_; // Sesion restore strategy. OAuth2LoginManager::SessionRestoreStrategy session_restore_strategy_; // OAuth2 refresh token for session restore. std::string oauth2_refresh_token_; DISALLOW_COPY_AND_ASSIGN(LoginUtilsImpl); }; class LoginUtilsWrapper { public: static LoginUtilsWrapper* GetInstance() { return Singleton<LoginUtilsWrapper>::get(); } LoginUtils* get() { base::AutoLock create(create_lock_); if (!ptr_.get()) reset(new LoginUtilsImpl); return ptr_.get(); } void reset(LoginUtils* ptr) { ptr_.reset(ptr); } private: friend struct DefaultSingletonTraits<LoginUtilsWrapper>; LoginUtilsWrapper() {} base::Lock create_lock_; scoped_ptr<LoginUtils> ptr_; DISALLOW_COPY_AND_ASSIGN(LoginUtilsWrapper); }; struct DoBrowserLaunchOnLocaleLoadedData { DoBrowserLaunchOnLocaleLoadedData(LoginUtilsImpl* login_utils_impl, Profile* profile, LoginDisplayHost* display_host) : login_utils_impl(login_utils_impl), profile(profile), display_host(display_host) {} LoginUtilsImpl* login_utils_impl; Profile* profile; chromeos::LoginDisplayHost* display_host; // Block UI events untill ResourceBundle is reloaded. InputEventsBlocker input_events_blocker; }; // static void LoginUtilsImpl::DoBrowserLaunchOnLocaleLoaded( scoped_ptr<DoBrowserLaunchOnLocaleLoadedData> context, const std::string& /* locale */, const std::string& /* loaded_locale */, const bool /* success */) { context->login_utils_impl->DoBrowserLaunchOnLocaleLoadedImpl( context->profile, context->display_host); } // Called from DoBrowserLaunch() or from // DoBrowserLaunchOnLocaleLoaded() depending on // if locale switch was needed. void LoginUtilsImpl::DoBrowserLaunchOnLocaleLoadedImpl( Profile* profile, LoginDisplayHost* login_host) { if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); return; } CommandLine user_flags(CommandLine::NO_PROGRAM); about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, about_flags::kAddSentinels); // Only restart if needed and if not going into managed mode. // Don't restart browser if it is not first profile in session. if (UserManager::Get()->GetLoggedInUsers().size() == 1 && !UserManager::Get()->IsLoggedInAsLocallyManagedUser() && !about_flags::AreSwitchesIdenticalToCurrentCommandLine( user_flags, *CommandLine::ForCurrentProcess())) { CommandLine::StringVector flags; // argv[0] is the program name |CommandLine::NO_PROGRAM|. flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); VLOG(1) << "Restarting to apply per-session flags..."; DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( UserManager::Get()->GetActiveUser()->email(), flags); AttemptRestart(profile); return; } if (login_host) { login_host->SetStatusAreaVisible(true); login_host->BeforeSessionStart(); } BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); VLOG(1) << "Launching browser..."; StartupBrowserCreator browser_creator; int return_code; chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), profile, base::FilePath(), chrome::startup::IS_PROCESS_STARTUP, first_run, &return_code); // Triggers app launcher start page service to load start page web contents. app_list::StartPageService::Get(profile); // Mark login host for deletion after browser starts. This // guarantees that the message loop will be referenced by the // browser before it is dereferenced by the login host. if (login_host) login_host->Finalize(); UserManager::Get()->SessionStarted(); } void LoginUtilsImpl::DoBrowserLaunch(Profile* profile, LoginDisplayHost* login_host) { if (browser_shutdown::IsTryingToQuit()) return; User* const user = UserManager::Get()->GetUserByProfile(profile); scoped_ptr<DoBrowserLaunchOnLocaleLoadedData> data( new DoBrowserLaunchOnLocaleLoadedData(this, profile, login_host)); scoped_ptr<locale_util::SwitchLanguageCallback> callback( new locale_util::SwitchLanguageCallback( base::Bind(&LoginUtilsImpl::DoBrowserLaunchOnLocaleLoaded, base::Passed(data.Pass())))); if (!UserManager::Get()-> RespectLocalePreference(profile, user, callback.Pass())) { DoBrowserLaunchOnLocaleLoadedImpl(profile, login_host); } } void LoginUtilsImpl::PrepareProfile( const UserContext& user_context, const std::string& display_email, bool has_cookies, bool has_active_session, LoginUtils::Delegate* delegate) { BootTimesLoader* btl = BootTimesLoader::Get(); VLOG(1) << "Completing login for " << user_context.username; if (!has_active_session) { btl->AddLoginTimeMarker("StartSession-Start", false); DBusThreadManager::Get()->GetSessionManagerClient()->StartSession( user_context.username); btl->AddLoginTimeMarker("StartSession-End", false); } btl->AddLoginTimeMarker("UserLoggedIn-Start", false); UserManager* user_manager = UserManager::Get(); user_manager->UserLoggedIn(user_context.username, user_context.username_hash, false); btl->AddLoginTimeMarker("UserLoggedIn-End", false); // Switch log file as soon as possible. if (base::SysInfo::IsRunningOnChromeOS()) logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); // Update user's displayed email. if (!display_email.empty()) user_manager->SaveUserDisplayEmail(user_context.username, display_email); user_context_ = user_context; has_web_auth_cookies_ = has_cookies; delegate_ = delegate; InitSessionRestoreStrategy(); if (DemoAppLauncher::IsDemoAppSession(user_context.username)) { g_browser_process->profile_manager()->CreateProfileAsync( user_manager->GetUserProfileDir(user_context.username), base::Bind(&LoginUtilsImpl::OnOTRProfileCreated, AsWeakPtr(), user_context.username), base::string16(), base::string16(), std::string()); } else { // Can't use display_email because it is empty when existing user logs in // using sing-in pod on login screen (i.e. user didn't type email). g_browser_process->profile_manager()->CreateProfileAsync( user_manager->GetUserProfileDir(user_context.username), base::Bind(&LoginUtilsImpl::OnProfileCreated, AsWeakPtr(), user_context.username), base::string16(), base::string16(), std::string()); } } void LoginUtilsImpl::DelegateDeleted(LoginUtils::Delegate* delegate) { if (delegate_ == delegate) delegate_ = NULL; } void LoginUtilsImpl::InitProfilePreferences(Profile* user_profile, const std::string& user_id) { if (UserManager::Get()->IsCurrentUserNew()) SetFirstLoginPrefs(user_profile->GetPrefs()); if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { User* active_user = UserManager::Get()->GetActiveUser(); std::string managed_user_sync_id = UserManager::Get()->GetSupervisedUserManager()-> GetUserSyncId(active_user->email()); // TODO(ibraaaa): Remove that when 97% of our users are using M31. // http://crbug.com/276163 if (managed_user_sync_id.empty()) managed_user_sync_id = "DUMMY_ID"; user_profile->GetPrefs()->SetString(prefs::kManagedUserId, managed_user_sync_id); } else { // Make sure that the google service username is properly set (we do this // on every sign in, not just the first login, to deal with existing // profiles that might not have it set yet). SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile(user_profile); signin_manager->SetAuthenticatedUsername(user_id); } } void LoginUtilsImpl::InitSessionRestoreStrategy() { CommandLine* command_line = CommandLine::ForCurrentProcess(); bool in_app_mode = chrome::IsRunningInForcedAppMode(); // Are we in kiosk app mode? if (in_app_mode) { if (command_line->HasSwitch(::switches::kAppModeOAuth2Token)) { oauth2_refresh_token_ = command_line->GetSwitchValueASCII( ::switches::kAppModeOAuth2Token); } if (command_line->HasSwitch(::switches::kAppModeAuthCode)) { user_context_.auth_code = command_line->GetSwitchValueASCII( ::switches::kAppModeAuthCode); } DCHECK(!has_web_auth_cookies_); if (!user_context_.auth_code.empty()) { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_AUTH_CODE; } else if (!oauth2_refresh_token_.empty()) { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_PASSED_OAUTH2_REFRESH_TOKEN; } else { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_SAVED_OAUTH2_REFRESH_TOKEN; } return; } if (has_web_auth_cookies_) { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_COOKIE_JAR; } else if (!user_context_.auth_code.empty()) { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_AUTH_CODE; } else { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_SAVED_OAUTH2_REFRESH_TOKEN; } } void LoginUtilsImpl::OnProfileCreated( const std::string& user_id, Profile* user_profile, Profile::CreateStatus status) { CHECK(user_profile); switch (status) { case Profile::CREATE_STATUS_CREATED: InitProfilePreferences(user_profile, user_id); break; case Profile::CREATE_STATUS_INITIALIZED: UserProfileInitialized(user_profile); break; case Profile::CREATE_STATUS_LOCAL_FAIL: case Profile::CREATE_STATUS_REMOTE_FAIL: case Profile::CREATE_STATUS_CANCELED: case Profile::MAX_CREATE_STATUS: NOTREACHED(); break; } } void LoginUtilsImpl::OnOTRProfileCreated( const std::string& user_id, Profile* user_profile, Profile::CreateStatus status) { CHECK(user_profile); switch (status) { case Profile::CREATE_STATUS_CREATED: InitProfilePreferences(user_profile, user_id); break; case Profile::CREATE_STATUS_INITIALIZED: OTRProfileInitialized(user_profile); break; case Profile::CREATE_STATUS_LOCAL_FAIL: case Profile::CREATE_STATUS_REMOTE_FAIL: case Profile::CREATE_STATUS_CANCELED: case Profile::MAX_CREATE_STATUS: NOTREACHED(); break; } } void LoginUtilsImpl::UserProfileInitialized(Profile* user_profile) { BootTimesLoader* btl = BootTimesLoader::Get(); btl->AddLoginTimeMarker("UserProfileGotten", false); if (user_context_.using_oauth) { // Transfer proxy authentication cache, cookies (optionally) and server // bound certs from the profile that was used for authentication. This // profile contains cookies that auth extension should have already put in // place that will ensure that the newly created session is authenticated // for the websites that work with the used authentication schema. ProfileAuthData::Transfer(authenticator_->authentication_profile(), user_profile, has_web_auth_cookies_, // transfer_cookies base::Bind( &LoginUtilsImpl::CompleteProfileCreate, AsWeakPtr(), user_profile)); return; } FinalizePrepareProfile(user_profile); } void LoginUtilsImpl::OTRProfileInitialized(Profile* user_profile) { user_profile->OnLogin(); // Send the notification before creating the browser so additional objects // that need the profile (e.g. the launcher) can be created first. content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, content::NotificationService::AllSources(), content::Details<Profile>(user_profile)); if (delegate_) delegate_->OnProfilePrepared(user_profile); } void LoginUtilsImpl::CompleteProfileCreate(Profile* user_profile) { RestoreAuthSession(user_profile, has_web_auth_cookies_); FinalizePrepareProfile(user_profile); } void LoginUtilsImpl::RestoreAuthSession(Profile* user_profile, bool restore_from_auth_cookies) { CHECK((authenticator_.get() && authenticator_->authentication_profile()) || !restore_from_auth_cookies); if (chrome::IsRunningInForcedAppMode() || CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kOobeSkipPostLogin)) { return; } exit_after_session_restore_ = false; // Remove legacy OAuth1 token if we have one. If it's valid, we should already // have OAuth2 refresh token in OAuth2TokenService that could be used to // retrieve all other tokens and user_context. OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); login_manager->AddObserver(this); login_manager->RestoreSession( authenticator_.get() && authenticator_->authentication_profile() ? authenticator_->authentication_profile()->GetRequestContext() : NULL, session_restore_strategy_, oauth2_refresh_token_, user_context_.auth_code); } void LoginUtilsImpl::FinalizePrepareProfile(Profile* user_profile) { BootTimesLoader* btl = BootTimesLoader::Get(); // Own TPM device if, for any reason, it has not been done in EULA // wizard screen. CryptohomeClient* client = DBusThreadManager::Get()->GetCryptohomeClient(); btl->AddLoginTimeMarker("TPMOwn-Start", false); if (cryptohome_util::TpmIsEnabled() && !cryptohome_util::TpmIsBeingOwned()) { if (cryptohome_util::TpmIsOwned()) { client->CallTpmClearStoredPasswordAndBlock(); } else { client->TpmCanAttemptOwnership(EmptyVoidDBusMethodCallback()); } } btl->AddLoginTimeMarker("TPMOwn-End", false); if (UserManager::Get()->IsLoggedInAsRegularUser()) { SAMLOfflineSigninLimiter* saml_offline_signin_limiter = SAMLOfflineSigninLimiterFactory::GetForProfile(user_profile); if (saml_offline_signin_limiter) saml_offline_signin_limiter->SignedIn(user_context_.auth_flow); } user_profile->OnLogin(); // Send the notification before creating the browser so additional objects // that need the profile (e.g. the launcher) can be created first. content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, content::NotificationService::AllSources(), content::Details<Profile>(user_profile)); // Initialize RLZ only for primary user. if (UserManager::Get()->GetPrimaryUser() == UserManager::Get()->GetUserByProfile(user_profile)) { InitRlzDelayed(user_profile); } // TODO(altimofeev): This pointer should probably never be NULL, but it looks // like LoginUtilsImpl::OnProfileCreated() may be getting called before // LoginUtilsImpl::PrepareProfile() has set |delegate_| when Chrome is killed // during shutdown in tests -- see http://crosbug.com/18269. Replace this // 'if' statement with a CHECK(delegate_) once the underlying issue is // resolved. if (delegate_) delegate_->OnProfilePrepared(user_profile); } void LoginUtilsImpl::InitRlzDelayed(Profile* user_profile) { #if defined(ENABLE_RLZ) if (!g_browser_process->local_state()->HasPrefPath(prefs::kRLZBrand)) { // Read brand code asynchronously from an OEM data and repost ourselves. google_util::chromeos::InitBrand( base::Bind(&LoginUtilsImpl::InitRlzDelayed, AsWeakPtr(), user_profile)); return; } base::PostTaskAndReplyWithResult( base::WorkerPool::GetTaskRunner(false), FROM_HERE, base::Bind(&base::PathExists, GetRlzDisabledFlagPath()), base::Bind(&LoginUtilsImpl::InitRlz, AsWeakPtr(), user_profile)); #endif } void LoginUtilsImpl::InitRlz(Profile* user_profile, bool disabled) { #if defined(ENABLE_RLZ) PrefService* local_state = g_browser_process->local_state(); if (disabled) { // Empty brand code means an organic install (no RLZ pings are sent). google_util::chromeos::ClearBrandForCurrentSession(); } if (disabled != local_state->GetBoolean(prefs::kRLZDisabled)) { // When switching to RLZ enabled/disabled state, clear all recorded events. RLZTracker::ClearRlzState(); local_state->SetBoolean(prefs::kRLZDisabled, disabled); } // Init the RLZ library. int ping_delay = user_profile->GetPrefs()->GetInteger( first_run::GetPingDelayPrefName().c_str()); // Negative ping delay means to send ping immediately after a first search is // recorded. RLZTracker::InitRlzFromProfileDelayed( user_profile, UserManager::Get()->IsCurrentUserNew(), ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay))); if (delegate_) delegate_->OnRlzInitialized(user_profile); #endif } void LoginUtilsImpl::CompleteOffTheRecordLogin(const GURL& start_url) { VLOG(1) << "Completing incognito login"; // For guest session we ask session manager to restart Chrome with --bwsi // flag. We keep only some of the arguments of this process. const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); CommandLine command_line(browser_command_line.GetProgram()); std::string cmd_line_str = GetOffTheRecordCommandLine(start_url, StartupUtils::IsOobeCompleted(), browser_command_line, &command_line); RestartChrome(cmd_line_str); } void LoginUtilsImpl::SetFirstLoginPrefs(PrefService* prefs) { VLOG(1) << "Setting first login prefs"; BootTimesLoader* btl = BootTimesLoader::Get(); std::string locale = g_browser_process->GetApplicationLocale(); // First, we'll set kLanguagePreloadEngines. input_method::InputMethodManager* manager = input_method::InputMethodManager::Get(); std::vector<std::string> input_method_ids; manager->GetInputMethodUtil()->GetFirstLoginInputMethodIds( locale, manager->GetCurrentInputMethod(), &input_method_ids); // Save the input methods in the user's preferences. StringPrefMember language_preload_engines; language_preload_engines.Init(prefs::kLanguagePreloadEngines, prefs); language_preload_engines.SetValue(JoinString(input_method_ids, ',')); btl->AddLoginTimeMarker("IMEStarted", false); // Second, we'll set kLanguagePreferredLanguages. std::vector<std::string> language_codes; // The current locale should be on the top. language_codes.push_back(locale); // Add input method IDs based on the input methods, as there may be // input methods that are unrelated to the current locale. Example: the // hardware keyboard layout xkb:us::eng is used for logging in, but the // UI language is set to French. In this case, we should set "fr,en" // to the preferred languages preference. std::vector<std::string> candidates; manager->GetInputMethodUtil()->GetLanguageCodesFromInputMethodIds( input_method_ids, &candidates); for (size_t i = 0; i < candidates.size(); ++i) { const std::string& candidate = candidates[i]; // Skip if it's already in language_codes. if (std::count(language_codes.begin(), language_codes.end(), candidate) == 0) { language_codes.push_back(candidate); } } // Save the preferred languages in the user's preferences. StringPrefMember language_preferred_languages; language_preferred_languages.Init(prefs::kLanguagePreferredLanguages, prefs); language_preferred_languages.SetValue(JoinString(language_codes, ',')); } scoped_refptr<Authenticator> LoginUtilsImpl::CreateAuthenticator( LoginStatusConsumer* consumer) { // Screen locker needs new Authenticator instance each time. if (ScreenLocker::default_screen_locker()) { if (authenticator_.get()) authenticator_->SetConsumer(NULL); authenticator_ = NULL; } if (authenticator_.get() == NULL) { authenticator_ = new ParallelAuthenticator(consumer); } else { // TODO(nkostylev): Fix this hack by improving Authenticator dependencies. authenticator_->SetConsumer(consumer); } return authenticator_; } void LoginUtilsImpl::RestoreAuthenticationSession(Profile* user_profile) { UserManager* user_manager = UserManager::Get(); // We don't need to restore session for demo/guest/stub/public account users. if (!user_manager->IsUserLoggedIn() || user_manager->IsLoggedInAsGuest() || user_manager->IsLoggedInAsPublicAccount() || user_manager->IsLoggedInAsDemoUser() || user_manager->IsLoggedInAsStub()) { return; } User* user = user_manager->GetUserByProfile(user_profile); DCHECK(user); if (!net::NetworkChangeNotifier::IsOffline()) { pending_restore_sessions_.erase(user->email()); RestoreAuthSession(user_profile, false); } else { // Even if we're online we should wait till initial // OnConnectionTypeChanged() call. Otherwise starting fetchers too early may // end up canceling all request when initial network connection type is // processed. See http://crbug.com/121643. pending_restore_sessions_.insert(user->email()); } } void LoginUtilsImpl::OnSessionRestoreStateChanged( Profile* user_profile, OAuth2LoginManager::SessionRestoreState state) { User::OAuthTokenStatus user_status = User::OAUTH_TOKEN_STATUS_UNKNOWN; OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); bool connection_error = false; switch (state) { case OAuth2LoginManager::SESSION_RESTORE_DONE: user_status = User::OAUTH2_TOKEN_STATUS_VALID; break; case OAuth2LoginManager::SESSION_RESTORE_FAILED: user_status = User::OAUTH2_TOKEN_STATUS_INVALID; break; case OAuth2LoginManager::SESSION_RESTORE_CONNECTION_FAILED: connection_error = true; break; case OAuth2LoginManager::SESSION_RESTORE_NOT_STARTED: case OAuth2LoginManager::SESSION_RESTORE_PREPARING: case OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS: return; } // We should not be clearing existing token state if that was a connection // error. http://crbug.com/295245 if (!connection_error) { // We are in one of "done" states here. UserManager::Get()->SaveUserOAuthStatus( UserManager::Get()->GetLoggedInUser()->email(), user_status); } login_manager->RemoveObserver(this); } void LoginUtilsImpl::OnNewRefreshTokenAvaiable(Profile* user_profile) { // Check if we were waiting to restart chrome. if (!exit_after_session_restore_) return; OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); login_manager->RemoveObserver(this); // Mark user auth token status as valid. UserManager::Get()->SaveUserOAuthStatus( UserManager::Get()->GetLoggedInUser()->email(), User::OAUTH2_TOKEN_STATUS_VALID); LOG(WARNING) << "Exiting after new refresh token fetched"; // We need to restart cleanly in this case to make sure OAuth2 RT is actually // saved. chrome::AttemptRestart(); } void LoginUtilsImpl::OnConnectionTypeChanged( net::NetworkChangeNotifier::ConnectionType type) { UserManager* user_manager = UserManager::Get(); if (type == net::NetworkChangeNotifier::CONNECTION_NONE || user_manager->IsLoggedInAsGuest() || !user_manager->IsUserLoggedIn()) { return; } // Need to iterate over all users and their OAuth2 session state. const UserList& users = user_manager->GetLoggedInUsers(); for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { Profile* user_profile = user_manager->GetProfileByUser(*it); bool should_restore_session = pending_restore_sessions_.find((*it)->email()) != pending_restore_sessions_.end(); OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); if (login_manager->state() == OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS) { // If we come online for the first time after successful offline login, // we need to kick off OAuth token verification process again. login_manager->ContinueSessionRestore(); } else if (should_restore_session) { pending_restore_sessions_.erase((*it)->email()); RestoreAuthSession(user_profile, has_web_auth_cookies_); } } } void LoginUtilsImpl::AttemptRestart(Profile* profile) { if (session_restore_strategy_ != OAuth2LoginManager::RESTORE_FROM_COOKIE_JAR) { chrome::AttemptRestart(); return; } // We can't really quit if the session restore process that mints new // refresh token is still in progress. OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(profile); if (login_manager->state() != OAuth2LoginManager::SESSION_RESTORE_PREPARING && login_manager->state() != OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS) { chrome::AttemptRestart(); return; } LOG(WARNING) << "Attempting browser restart during session restore."; exit_after_session_restore_ = true; } // static void LoginUtils::RegisterPrefs(PrefRegistrySimple* registry) { registry->RegisterBooleanPref(prefs::kFactoryResetRequested, false); registry->RegisterBooleanPref(prefs::kRollbackRequested, false); registry->RegisterStringPref(prefs::kRLZBrand, std::string()); registry->RegisterBooleanPref(prefs::kRLZDisabled, false); } // static LoginUtils* LoginUtils::Get() { return LoginUtilsWrapper::GetInstance()->get(); } // static void LoginUtils::Set(LoginUtils* mock) { LoginUtilsWrapper::GetInstance()->reset(mock); } // static bool LoginUtils::IsWhitelisted(const std::string& username, bool* wildcard_match) { // Skip whitelist check for tests. if (CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kOobeSkipPostLogin)) { return true; } CrosSettings* cros_settings = CrosSettings::Get(); bool allow_new_user = false; cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); if (allow_new_user) return true; return cros_settings->FindEmailInList( kAccountsPrefUsers, username, wildcard_match); } } // namespace chromeos
Java
package edu.ucdenver.ccp.datasource.fileparsers.snomed; import edu.ucdenver.ccp.datasource.fileparsers.SingleLineFileRecord; /* * #%L * Colorado Computational Pharmacology's common module * %% * Copyright (C) 2012 - 2015 Regents of the University of Colorado * %% * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the Regents of the University of Colorado nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * #L% */ import lombok.Getter; /** * @author Center for Computational Pharmacology, UC Denver; ccpsupport@ucdenver.edu * */ @Getter public class SnomedRf2DescriptionFileRecord extends SingleLineFileRecord { public enum DescriptionType { FULLY_SPECIFIED_NAME("900000000000003001"), SYNONYM("900000000000013009"); private final String typeId; private DescriptionType(String typeId) { this.typeId = typeId; } public String typeId() { return typeId; } public static DescriptionType getType(String typeId) { for (DescriptionType type : values()) { if (type.typeId().equals(typeId)) { return type; } } throw new IllegalArgumentException("Invalid SnoMed description type id: " + typeId); } } /* * id effectiveTime active moduleId conceptId languageCode typeId term caseSignificanceId */ private final String descriptionId; private final String effectiveTime; private final boolean active; private final String moduleId; private final String conceptId; private final String languageCode; private final DescriptionType type; private final String term; private final String caseSignificanceId; /** * @param byteOffset * @param lineNumber * @param definitionId * @param effectiveTime * @param active * @param moduleId * @param conceptId * @param languageCode * @param typeId * @param term * @param caseSignificanceId */ public SnomedRf2DescriptionFileRecord(String descriptionId, String effectiveTime, boolean active, String moduleId, String conceptId, String languageCode, DescriptionType type, String term, String caseSignificanceId, long byteOffset, long lineNumber) { super(byteOffset, lineNumber); this.descriptionId = descriptionId; this.effectiveTime = effectiveTime; this.active = active; this.moduleId = moduleId; this.conceptId = conceptId; this.languageCode = languageCode; this.type = type; this.term = term; this.caseSignificanceId = caseSignificanceId; } }
Java
""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tools import unittest class E(HasTraits): a = Property(Any) b = Property(Int) class TestPropertyDelete(unittest.TestCase): def test_property_delete(self): e = E() with self.assertRaises(TraitError): del e.a with self.assertRaises(TraitError): del e.b def test_property_reset_traits(self): e = E() unresetable = e.reset_traits() _py2to3.assertCountEqual(self, unresetable, ['a', 'b'])
Java
<?php namespace app\controllers; use app\models\ContactForm; use app\models\LoginForm; use Yii; use yii\filters\AccessControl; use yii\filters\VerbFilter; use yii\web\Controller; class SiteController extends Controller { public function behaviors() { return [ 'access' => [ 'class' => AccessControl::className(), 'only' => ['logout'], 'rules' => [ [ 'actions' => ['logout'], 'allow' => true, 'roles' => ['@'], ], ], ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'logout' => ['post'], ], ], ]; } public function actions() { return [ 'error' => [ 'class' => 'yii\web\ErrorAction', ], 'captcha' => [ 'class' => 'yii\captcha\CaptchaAction', 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, ], ]; } public function actionIndex() { return $this->render('index'); } public function actionLogin() { if (!\Yii::$app->user->isGuest) { return $this->goHome(); } $model = new LoginForm(); if ($model->load(Yii::$app->request->post()) && $model->login()) { return $this->goBack(); } return $this->render('login', [ 'model' => $model, ]); } public function actionLogout() { Yii::$app->user->logout(); return $this->goHome(); } public function actionContact() { $model = new ContactForm(); if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) { Yii::$app->session->setFlash('contactFormSubmitted'); return $this->refresh(); } return $this->render('contact', [ 'model' => $model, ]); } public function actionAbout() { return $this->render('about'); } public function actionLayout() { $this->layout = 'frontEnd'; return $this->render('index'); // return $this->render('//order/step1'); } }
Java
/* dlar1v.f -- translated by f2c (version 20061008). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib; on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */ #include "f2c.h" #include "blaswrap.h" /* Subroutine */ int dlar1v_(integer *n, integer *b1, integer *bn, doublereal *lambda, doublereal *d__, doublereal *l, doublereal *ld, doublereal * lld, doublereal *pivmin, doublereal *gaptol, doublereal *z__, logical *wantnc, integer *negcnt, doublereal *ztz, doublereal *mingma, integer *r__, integer *isuppz, doublereal *nrminv, doublereal *resid, doublereal *rqcorr, doublereal *work) { /* System generated locals */ integer i__1; doublereal d__1, d__2, d__3; /* Local variables */ integer i__; doublereal s; integer r1, r2; doublereal eps, tmp; integer neg1, neg2, indp, inds; doublereal dplus; integer indlpl, indumn; doublereal dminus; logical sawnan1, sawnan2; /* -- LAPACK auxiliary routine (version 3.2) -- */ /* November 2006 */ /* Purpose */ /* ======= */ /* DLAR1V computes the (scaled) r-th column of the inverse of */ /* the sumbmatrix in rows B1 through BN of the tridiagonal matrix */ /* L D L^T - sigma I. When sigma is close to an eigenvalue, the */ /* computed vector is an accurate eigenvector. Usually, r corresponds */ /* to the index where the eigenvector is largest in magnitude. */ /* The following steps accomplish this computation : */ /* (a) Stationary qd transform, L D L^T - sigma I = L(+) D(+) L(+)^T, */ /* (b) Progressive qd transform, L D L^T - sigma I = U(-) D(-) U(-)^T, */ /* (c) Computation of the diagonal elements of the inverse of */ /* L D L^T - sigma I by combining the above transforms, and choosing */ /* r as the index where the diagonal of the inverse is (one of the) */ /* largest in magnitude. */ /* (d) Computation of the (scaled) r-th column of the inverse using the */ /* twisted factorization obtained by combining the top part of the */ /* the stationary and the bottom part of the progressive transform. */ /* Arguments */ /* ========= */ /* N (input) INTEGER */ /* The order of the matrix L D L^T. */ /* B1 (input) INTEGER */ /* First index of the submatrix of L D L^T. */ /* BN (input) INTEGER */ /* Last index of the submatrix of L D L^T. */ /* LAMBDA (input) DOUBLE PRECISION */ /* The shift. In order to compute an accurate eigenvector, */ /* LAMBDA should be a good approximation to an eigenvalue */ /* of L D L^T. */ /* L (input) DOUBLE PRECISION array, dimension (N-1) */ /* The (n-1) subdiagonal elements of the unit bidiagonal matrix */ /* L, in elements 1 to N-1. */ /* D (input) DOUBLE PRECISION array, dimension (N) */ /* The n diagonal elements of the diagonal matrix D. */ /* LD (input) DOUBLE PRECISION array, dimension (N-1) */ /* The n-1 elements L(i)*D(i). */ /* LLD (input) DOUBLE PRECISION array, dimension (N-1) */ /* The n-1 elements L(i)*L(i)*D(i). */ /* PIVMIN (input) DOUBLE PRECISION */ /* The minimum pivot in the Sturm sequence. */ /* GAPTOL (input) DOUBLE PRECISION */ /* Tolerance that indicates when eigenvector entries are negligible */ /* w.r.t. their contribution to the residual. */ /* Z (input/output) DOUBLE PRECISION array, dimension (N) */ /* On input, all entries of Z must be set to 0. */ /* On output, Z contains the (scaled) r-th column of the */ /* inverse. The scaling is such that Z(R) equals 1. */ /* WANTNC (input) LOGICAL */ /* Specifies whether NEGCNT has to be computed. */ /* NEGCNT (output) INTEGER */ /* If WANTNC is .TRUE. then NEGCNT = the number of pivots < pivmin */ /* in the matrix factorization L D L^T, and NEGCNT = -1 otherwise. */ /* ZTZ (output) DOUBLE PRECISION */ /* The square of the 2-norm of Z. */ /* MINGMA (output) DOUBLE PRECISION */ /* The reciprocal of the largest (in magnitude) diagonal */ /* element of the inverse of L D L^T - sigma I. */ /* R (input/output) INTEGER */ /* The twist index for the twisted factorization used to */ /* compute Z. */ /* On input, 0 <= R <= N. If R is input as 0, R is set to */ /* the index where (L D L^T - sigma I)^{-1} is largest */ /* in magnitude. If 1 <= R <= N, R is unchanged. */ /* On output, R contains the twist index used to compute Z. */ /* Ideally, R designates the position of the maximum entry in the */ /* eigenvector. */ /* ISUPPZ (output) INTEGER array, dimension (2) */ /* The support of the vector in Z, i.e., the vector Z is */ /* nonzero only in elements ISUPPZ(1) through ISUPPZ( 2 ). */ /* NRMINV (output) DOUBLE PRECISION */ /* NRMINV = 1/SQRT( ZTZ ) */ /* RESID (output) DOUBLE PRECISION */ /* The residual of the FP vector. */ /* RESID = ABS( MINGMA )/SQRT( ZTZ ) */ /* RQCORR (output) DOUBLE PRECISION */ /* The Rayleigh Quotient correction to LAMBDA. */ /* RQCORR = MINGMA*TMP */ /* WORK (workspace) DOUBLE PRECISION array, dimension (4*N) */ /* Further Details */ /* =============== */ /* Based on contributions by */ /* Beresford Parlett, University of California, Berkeley, USA */ /* Jim Demmel, University of California, Berkeley, USA */ /* Inderjit Dhillon, University of Texas, Austin, USA */ /* Osni Marques, LBNL/NERSC, USA */ /* Christof Voemel, University of California, Berkeley, USA */ /* ===================================================================== */ /* Parameter adjustments */ --work; --isuppz; --z__; --lld; --ld; --l; --d__; /* Function Body */ eps = dlamch_("Precision"); if (*r__ == 0) { r1 = *b1; r2 = *bn; } else { r1 = *r__; r2 = *r__; } /* Storage for LPLUS */ indlpl = 0; /* Storage for UMINUS */ indumn = *n; inds = (*n << 1) + 1; indp = *n * 3 + 1; if (*b1 == 1) { work[inds] = 0.; } else { work[inds + *b1 - 1] = lld[*b1 - 1]; } /* Compute the stationary transform (using the differential form) */ /* until the index R2. */ sawnan1 = FALSE_; neg1 = 0; s = work[inds + *b1 - 1] - *lambda; i__1 = r1 - 1; for (i__ = *b1; i__ <= i__1; ++i__) { dplus = d__[i__] + s; work[indlpl + i__] = ld[i__] / dplus; if (dplus < 0.) { ++neg1; } work[inds + i__] = s * work[indlpl + i__] * l[i__]; s = work[inds + i__] - *lambda; } sawnan1 = disnan_(&s); if (sawnan1) { goto L60; } i__1 = r2 - 1; for (i__ = r1; i__ <= i__1; ++i__) { dplus = d__[i__] + s; work[indlpl + i__] = ld[i__] / dplus; work[inds + i__] = s * work[indlpl + i__] * l[i__]; s = work[inds + i__] - *lambda; } sawnan1 = disnan_(&s); L60: if (sawnan1) { /* Runs a slower version of the above loop if a NaN is detected */ neg1 = 0; s = work[inds + *b1 - 1] - *lambda; i__1 = r1 - 1; for (i__ = *b1; i__ <= i__1; ++i__) { dplus = d__[i__] + s; if (abs(dplus) < *pivmin) { dplus = -(*pivmin); } work[indlpl + i__] = ld[i__] / dplus; if (dplus < 0.) { ++neg1; } work[inds + i__] = s * work[indlpl + i__] * l[i__]; if (work[indlpl + i__] == 0.) { work[inds + i__] = lld[i__]; } s = work[inds + i__] - *lambda; } i__1 = r2 - 1; for (i__ = r1; i__ <= i__1; ++i__) { dplus = d__[i__] + s; if (abs(dplus) < *pivmin) { dplus = -(*pivmin); } work[indlpl + i__] = ld[i__] / dplus; work[inds + i__] = s * work[indlpl + i__] * l[i__]; if (work[indlpl + i__] == 0.) { work[inds + i__] = lld[i__]; } s = work[inds + i__] - *lambda; } } /* Compute the progressive transform (using the differential form) */ /* until the index R1 */ sawnan2 = FALSE_; neg2 = 0; work[indp + *bn - 1] = d__[*bn] - *lambda; i__1 = r1; for (i__ = *bn - 1; i__ >= i__1; --i__) { dminus = lld[i__] + work[indp + i__]; tmp = d__[i__] / dminus; if (dminus < 0.) { ++neg2; } work[indumn + i__] = l[i__] * tmp; work[indp + i__ - 1] = work[indp + i__] * tmp - *lambda; } tmp = work[indp + r1 - 1]; sawnan2 = disnan_(&tmp); if (sawnan2) { /* Runs a slower version of the above loop if a NaN is detected */ neg2 = 0; i__1 = r1; for (i__ = *bn - 1; i__ >= i__1; --i__) { dminus = lld[i__] + work[indp + i__]; if (abs(dminus) < *pivmin) { dminus = -(*pivmin); } tmp = d__[i__] / dminus; if (dminus < 0.) { ++neg2; } work[indumn + i__] = l[i__] * tmp; work[indp + i__ - 1] = work[indp + i__] * tmp - *lambda; if (tmp == 0.) { work[indp + i__ - 1] = d__[i__] - *lambda; } } } /* Find the index (from R1 to R2) of the largest (in magnitude) */ /* diagonal element of the inverse */ *mingma = work[inds + r1 - 1] + work[indp + r1 - 1]; if (*mingma < 0.) { ++neg1; } if (*wantnc) { *negcnt = neg1 + neg2; } else { *negcnt = -1; } if (abs(*mingma) == 0.) { *mingma = eps * work[inds + r1 - 1]; } *r__ = r1; i__1 = r2 - 1; for (i__ = r1; i__ <= i__1; ++i__) { tmp = work[inds + i__] + work[indp + i__]; if (tmp == 0.) { tmp = eps * work[inds + i__]; } if (abs(tmp) <= abs(*mingma)) { *mingma = tmp; *r__ = i__ + 1; } } /* Compute the FP vector: solve N^T v = e_r */ isuppz[1] = *b1; isuppz[2] = *bn; z__[*r__] = 1.; *ztz = 1.; /* Compute the FP vector upwards from R */ if (! sawnan1 && ! sawnan2) { i__1 = *b1; for (i__ = *r__ - 1; i__ >= i__1; --i__) { z__[i__] = -(work[indlpl + i__] * z__[i__ + 1]); if (((d__1 = z__[i__], abs(d__1)) + (d__2 = z__[i__ + 1], abs( d__2))) * (d__3 = ld[i__], abs(d__3)) < *gaptol) { z__[i__] = 0.; isuppz[1] = i__ + 1; goto L220; } *ztz += z__[i__] * z__[i__]; } L220: ; } else { /* Run slower loop if NaN occurred. */ i__1 = *b1; for (i__ = *r__ - 1; i__ >= i__1; --i__) { if (z__[i__ + 1] == 0.) { z__[i__] = -(ld[i__ + 1] / ld[i__]) * z__[i__ + 2]; } else { z__[i__] = -(work[indlpl + i__] * z__[i__ + 1]); } if (((d__1 = z__[i__], abs(d__1)) + (d__2 = z__[i__ + 1], abs( d__2))) * (d__3 = ld[i__], abs(d__3)) < *gaptol) { z__[i__] = 0.; isuppz[1] = i__ + 1; goto L240; } *ztz += z__[i__] * z__[i__]; } L240: ; } /* Compute the FP vector downwards from R in blocks of size BLKSIZ */ if (! sawnan1 && ! sawnan2) { i__1 = *bn - 1; for (i__ = *r__; i__ <= i__1; ++i__) { z__[i__ + 1] = -(work[indumn + i__] * z__[i__]); if (((d__1 = z__[i__], abs(d__1)) + (d__2 = z__[i__ + 1], abs( d__2))) * (d__3 = ld[i__], abs(d__3)) < *gaptol) { z__[i__ + 1] = 0.; isuppz[2] = i__; goto L260; } *ztz += z__[i__ + 1] * z__[i__ + 1]; } L260: ; } else { /* Run slower loop if NaN occurred. */ i__1 = *bn - 1; for (i__ = *r__; i__ <= i__1; ++i__) { if (z__[i__] == 0.) { z__[i__ + 1] = -(ld[i__ - 1] / ld[i__]) * z__[i__ - 1]; } else { z__[i__ + 1] = -(work[indumn + i__] * z__[i__]); } if (((d__1 = z__[i__], abs(d__1)) + (d__2 = z__[i__ + 1], abs( d__2))) * (d__3 = ld[i__], abs(d__3)) < *gaptol) { z__[i__ + 1] = 0.; isuppz[2] = i__; goto L280; } *ztz += z__[i__ + 1] * z__[i__ + 1]; } L280: ; } /* Compute quantities for convergence test */ tmp = 1. / *ztz; *nrminv = sqrt(tmp); *resid = abs(*mingma) * *nrminv; *rqcorr = *mingma * tmp; return 0; /* End of DLAR1V */ } /* dlar1v_ */
Java
<?php namespace elisdn\gii\fixture\tests; use yii\db\ActiveRecord; class Post extends ActiveRecord { public static function tableName() { return 'post'; } }
Java
package com.mattunderscore.trees.base; import static org.junit.Assert.*; import static org.mockito.Mockito.verify; import static org.mockito.MockitoAnnotations.initMocks; import java.util.Iterator; import java.util.NoSuchElementException; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import com.mattunderscore.iterators.SingletonIterator; import com.mattunderscore.trees.mutable.MutableNode; import com.mattunderscore.trees.tree.Node; /** * Unit tests for {@link MutableChildIterator}. * * @author Matt Champion on 29/08/2015 */ public final class MutableChildIteratorTest { @Mock private MutableNode<String> parent; @Mock private MutableNode<String> child; private Iterator<? extends MutableNode<String>> iterator; @Before public void setUp() { initMocks(this); iterator = new SingletonIterator<>(child); } @Test public void hasNext() { final MutableChildIterator<String, MutableNode<String>> mutableIterator = new MutableChildIterator<>(parent, iterator); assertTrue(mutableIterator.hasNext()); mutableIterator.next(); assertFalse(mutableIterator.hasNext()); } @Test(expected = NoSuchElementException.class) public void next() { final MutableChildIterator<String, MutableNode<String>> mutableIterator = new MutableChildIterator<>(parent, iterator); final MutableNode<String> node = mutableIterator.next(); assertSame(child, node); mutableIterator.next(); } @Test public void remove() { final MutableChildIterator<String, MutableNode<String>> mutableIterator = new MutableChildIterator<>(parent, iterator); mutableIterator.next(); mutableIterator.remove(); verify(parent).removeChild(child); } }
Java
// Copyright 2004-present Facebook. All Rights Reserved. #include <vector> #include <string> #include <osquery/core.h> #include <osquery/logger.h> #include <osquery/tables.h> #include "osquery/events/linux/udev.h" namespace osquery { namespace tables { /** * @brief Track udev events in Linux */ class HardwareEventSubscriber : public EventSubscriber { DECLARE_EVENTSUBSCRIBER(HardwareEventSubscriber, UdevEventPublisher); DECLARE_CALLBACK(Callback, UdevEventContext); public: void init(); Status Callback(const UdevEventContextRef ec); }; REGISTER_EVENTSUBSCRIBER(HardwareEventSubscriber); void HardwareEventSubscriber::init() { auto subscription = UdevEventPublisher::createSubscriptionContext(); subscription->action = UDEV_EVENT_ACTION_ALL; BIND_CALLBACK(Callback, subscription); } Status HardwareEventSubscriber::Callback(const UdevEventContextRef ec) { Row r; if (ec->devtype.empty()) { // Superfluous hardware event. return Status(0, "Missing type."); } else if (ec->devnode.empty() && ec->driver.empty()) { return Status(0, "Missing node and driver."); } struct udev_device *device = ec->device; r["action"] = ec->action_string; r["path"] = ec->devnode; r["type"] = ec->devtype; r["driver"] = ec->driver; // UDEV properties. r["model"] = UdevEventPublisher::getValue(device, "ID_MODEL_FROM_DATABASE"); if (r["path"].empty() && r["model"].empty()) { // Don't emit mising path/model combos. return Status(0, "Missing path and model."); } r["model_id"] = INTEGER(UdevEventPublisher::getValue(device, "ID_MODEL_ID")); r["vendor"] = UdevEventPublisher::getValue(device, "ID_VENDOR_FROM_DATABASE"); r["vendor_id"] = INTEGER(UdevEventPublisher::getValue(device, "ID_VENDOR_ID")); r["serial"] = INTEGER(UdevEventPublisher::getValue(device, "ID_SERIAL_SHORT")); r["revision"] = INTEGER(UdevEventPublisher::getValue(device, "ID_REVISION")); r["time"] = INTEGER(ec->time); add(r, ec->time); return Status(0, "OK"); } } }
Java
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_WEBAUTHN_SHEET_MODELS_H_ #define CHROME_BROWSER_UI_WEBAUTHN_SHEET_MODELS_H_ #include <memory> #include <string> #include "chrome/browser/ui/webauthn/authenticator_request_sheet_model.h" #include "chrome/browser/ui/webauthn/transport_hover_list_model.h" #include "chrome/browser/webauthn/authenticator_request_dialog_model.h" #include "device/fido/pin.h" namespace gfx { struct VectorIcon; } namespace ui { class MenuModel; } class OtherMechanismsMenuModel; // Base class for sheets, implementing the shared behavior used on most sheets, // as well as maintaining a weak pointer to the dialog model. class AuthenticatorSheetModelBase : public AuthenticatorRequestSheetModel, public AuthenticatorRequestDialogModel::Observer { public: explicit AuthenticatorSheetModelBase( AuthenticatorRequestDialogModel* dialog_model); AuthenticatorSheetModelBase(const AuthenticatorSheetModelBase&) = delete; AuthenticatorSheetModelBase& operator=(const AuthenticatorSheetModelBase&) = delete; ~AuthenticatorSheetModelBase() override; AuthenticatorRequestDialogModel* dialog_model() const { return dialog_model_; } // Returns a string containing the RP ID, styled as an origin, truncated to a // reasonable width. static std::u16string GetRelyingPartyIdString( const AuthenticatorRequestDialogModel* dialog_model); protected: // AuthenticatorRequestSheetModel: bool IsActivityIndicatorVisible() const override; bool IsBackButtonVisible() const override; bool IsCancelButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; void OnBack() override; void OnAccept() override; void OnCancel() override; // AuthenticatorRequestDialogModel::Observer: void OnModelDestroyed(AuthenticatorRequestDialogModel* model) override; private: AuthenticatorRequestDialogModel* dialog_model_; }; // The sheet shown for selecting the transport over which the security key // should be accessed. class AuthenticatorMechanismSelectorSheetModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; class AuthenticatorInsertAndActivateUsbSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorInsertAndActivateUsbSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorInsertAndActivateUsbSheetModel() override; private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; std::u16string GetAdditionalDescription() const override; ui::MenuModel* GetOtherMechanismsMenuModel() override; std::unique_ptr<OtherMechanismsMenuModel> other_mechanisms_menu_model_; }; class AuthenticatorTimeoutErrorModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; class AuthenticatorNoAvailableTransportsErrorModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; class AuthenticatorNotRegisteredErrorModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; }; class AuthenticatorAlreadyRegisteredErrorModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; }; class AuthenticatorInternalUnrecognizedErrorSheetModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; }; class AuthenticatorBlePowerOnManualSheetModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; void OnAccept() override; // AuthenticatorRequestDialogModel::Observer: void OnBluetoothPoweredStateChanged() override; }; class AuthenticatorBlePowerOnAutomaticSheetModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; void OnAccept() override; bool busy_powering_on_ble_ = false; }; class AuthenticatorOffTheRecordInterstitialSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorOffTheRecordInterstitialSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorOffTheRecordInterstitialSheetModel() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; ui::MenuModel* GetOtherMechanismsMenuModel() override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; std::u16string GetCancelButtonLabel() const override; void OnAccept() override; std::unique_ptr<OtherMechanismsMenuModel> other_mechanisms_menu_model_; }; class AuthenticatorPaaskSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorPaaskSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorPaaskSheetModel() override; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; ui::MenuModel* GetOtherMechanismsMenuModel() override; std::unique_ptr<OtherMechanismsMenuModel> other_mechanisms_menu_model_; }; class AuthenticatorAndroidAccessorySheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorAndroidAccessorySheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorAndroidAccessorySheetModel() override; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; ui::MenuModel* GetOtherMechanismsMenuModel() override; std::unique_ptr<OtherMechanismsMenuModel> other_mechanisms_menu_model_; }; class AuthenticatorClientPinEntrySheetModel : public AuthenticatorSheetModelBase { public: // Indicates whether the view should accommodate changing an existing PIN, // setting up a new PIN or entering an existing one. enum class Mode { kPinChange, kPinEntry, kPinSetup }; AuthenticatorClientPinEntrySheetModel( AuthenticatorRequestDialogModel* dialog_model, Mode mode, device::pin::PINEntryError error); ~AuthenticatorClientPinEntrySheetModel() override; using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; void SetPinCode(std::u16string pin_code); void SetPinConfirmation(std::u16string pin_confirmation); Mode mode() const { return mode_; } private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; std::u16string GetError() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; void OnAccept() override; std::u16string pin_code_; std::u16string pin_confirmation_; std::u16string error_; const Mode mode_; }; class AuthenticatorClientPinTapAgainSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorClientPinTapAgainSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorClientPinTapAgainSheetModel() override; private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; std::u16string GetAdditionalDescription() const override; }; class AuthenticatorBioEnrollmentSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorBioEnrollmentSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorBioEnrollmentSheetModel() override; int max_bio_samples() { return dialog_model()->max_bio_samples().value_or(1); } int bio_samples_remaining() { return dialog_model()->bio_samples_remaining().value_or(1); } private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsAcceptButtonEnabled() const override; bool IsAcceptButtonVisible() const override; std::u16string GetAcceptButtonLabel() const override; bool IsCancelButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; void OnAccept() override; void OnCancel() override; }; class AuthenticatorRetryUvSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorRetryUvSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorRetryUvSheetModel() override; private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; std::u16string GetError() const override; }; // Generic error dialog that allows starting the request over. class AuthenticatorGenericErrorSheetModel : public AuthenticatorSheetModelBase { public: static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForClientPinErrorSoftBlock(AuthenticatorRequestDialogModel* dialog_model); static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForClientPinErrorHardBlock(AuthenticatorRequestDialogModel* dialog_model); static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForClientPinErrorAuthenticatorRemoved( AuthenticatorRequestDialogModel* dialog_model); static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForMissingCapability(AuthenticatorRequestDialogModel* dialog_model); static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForStorageFull( AuthenticatorRequestDialogModel* dialog_model); private: AuthenticatorGenericErrorSheetModel( AuthenticatorRequestDialogModel* dialog_model, std::u16string title, std::u16string description); // AuthenticatorSheetModelBase: bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; std::u16string title_; std::u16string description_; }; class AuthenticatorResidentCredentialConfirmationSheetView : public AuthenticatorSheetModelBase { public: explicit AuthenticatorResidentCredentialConfirmationSheetView( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorResidentCredentialConfirmationSheetView() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; bool IsBackButtonVisible() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; }; // The sheet shown when the user needs to select an account. class AuthenticatorSelectAccountSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorSelectAccountSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorSelectAccountSheetModel() override; // Set the index of the currently selected row. void SetCurrentSelection(int selected); // AuthenticatorSheetModelBase: void OnAccept() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; size_t selected_ = 0; }; class AttestationPermissionRequestSheetModel : public AuthenticatorSheetModelBase { public: explicit AttestationPermissionRequestSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AttestationPermissionRequestSheetModel() override; // AuthenticatorSheetModelBase: void OnAccept() override; void OnCancel() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsBackButtonVisible() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; bool IsCancelButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; }; class EnterpriseAttestationPermissionRequestSheetModel : public AttestationPermissionRequestSheetModel { public: explicit EnterpriseAttestationPermissionRequestSheetModel( AuthenticatorRequestDialogModel* dialog_model); private: // AuthenticatorSheetModelBase: std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; class AuthenticatorQRSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorQRSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorQRSheetModel() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; #endif // CHROME_BROWSER_UI_WEBAUTHN_SHEET_MODELS_H_
Java
package com.spm.store; import java.io.Serializable; import java.util.List; import android.content.Context; /** * * @author Agustin Sgarlata * @param <T> */ public class DbProvider<T extends Serializable> extends Db4oHelper { public Class<T> persistentClass; public DbProvider(Class<T> persistentClass, Context ctx) { super(ctx); this.persistentClass = persistentClass; } public void store(T obj) { db().store(obj); db().commit(); } public void delete(T obj) { db().delete(obj); db().commit(); } public List<T> findAll() { return db().query(persistentClass); } public List<T> get(T obj) { return db().queryByExample(obj); } }
Java
package main /* * CSCI 4229 Assignment 5: Lighting * * Author: Zach Anders * * Some code derived from CSCI 4229 Examples 9, 10, and 13 (ex9.c, ex10.c, ex13.c) * * Code for 2D text display (due to missing windowpos2i) based off some example code * at http://programmingexamples.net/wiki/OpenGL/Text */ import ( "actor" "entity" "math/rand" "os" "runtime" "time" "glutil" "util" "world" "github.com/go-gl/gl" "github.com/ianremmler/ode" "github.com/rhencke/glut" ) var renderQueue util.RenderQueue = util.NewEmptyRenderQueue() //var currentCamera = CreateDefaultViewport() var my_world = world.NewWorld() var player = actor.NewPlayer(&my_world, glutil.Point3D{0, 0, 0}, 5) var light actor.OrbitActor var currentMouse = glutil.CreateMouseState() // Normal order: //Translate -> Rotate -> Scale // Creates the display function func DisplayFunc() { gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT) gl.Enable(gl.DEPTH_TEST) gl.LoadIdentity() // currentCamera.PositionSelf() player.PositionSelf() my_world.Tick() renderQueue.RenderAll() gl.Disable(gl.DEPTH_TEST) gl.Disable(gl.LIGHTING) gl.Color3f(.9, .9, .9) glutil.Print2d(5, 35, "Keys: W,S,A,D : Move Around | Q / E : Move Light left/right | L : Toggle light rotation") glutil.Print2d(5, 20, "Click and Drag: Rotate | Arrow keys: Rotate") glutil.Print2d(5, 5, "%s", player.ToString()) gl.Flush() glut.SwapBuffers() } // Creates the key handler function func KeyDownFunc(ch byte, x int, y int) { switch ch { case 27: os.Exit(0) break case 's': player.Translate(-2.5, 0.0, 0.0) break case 'w': player.Translate(2.5, 0.0, 0.0) break case 'd': player.Translate(0.0, 0.0, -2.5) break case 'a': player.Translate(0.0, 0.0, 2.5) break case 'q': light.AdjustAngle(-5) break case 'e': light.AdjustAngle(5) break case 'l': light.Toggle() break } glut.PostRedisplay() } // Creates the special key handler function func SpecialFunc(key int, x int, y int) { // Phi: Elevation, Theta: Azimuth if key == glut.KEY_RIGHT { player.Rotate(10, 0) } else if key == glut.KEY_LEFT { player.Rotate(-10, 0) } else if key == glut.KEY_UP { player.Rotate(0, 10) } else if key == glut.KEY_DOWN { player.Rotate(0, -10) } // Tell GLUT it is necessary to redisplay the scene glut.PostRedisplay() } func MouseMotion(x, y int) { if currentMouse.LeftDown { horiz_delta := currentMouse.X - x vert_delta := currentMouse.Y - y player.Rotate(int32(horiz_delta)/-5, int32(vert_delta)/5) player.ImmediateLook() } currentMouse.X, currentMouse.Y = x, y } func MouseDown(button, state, x, y int) { currentMouse.X, currentMouse.Y = x, y switch button { case glut.LEFT_BUTTON: currentMouse.LeftDown = (state == glut.DOWN) break case glut.MIDDLE_BUTTON: currentMouse.MiddleDown = (state == glut.DOWN) break case glut.RIGHT_BUTTON: currentMouse.RightDown = (state == glut.DOWN) break } } /* * GLUT calls this routine when the window is resized */ func Reshape(width int, height int) { asp := float64(1) // Ratio of the width to the height of the window if height > 0 { asp = float64(width) / float64(height) } // Set the viewport to the entire window gl.Viewport(0, 0, width, height) player.GetProjection().AspectRatio = asp player.GetProjection().SetProjectionMatrix() } // Idler function. Called whenever GLUT is idle. func IdleFunc() { s_time := glut.Get(glut.ELAPSED_TIME) glut.PostRedisplay() e_time := glut.Get(glut.ELAPSED_TIME) - s_time if e_time < 33 { time.Sleep(time.Duration(33-e_time) * time.Millisecond) } } func setup() { lightsource := actor.NewBallLight(&my_world, glutil.Point3D{15, 15, 15}) renderQueue.AddNamed(&lightsource, "light") light = actor.NewOrbitActor(&my_world, &lightsource, glutil.Point3D{0, 15, 0}, 50) my_world.AddActor(&light) rand.Seed(0x12345 + 8) my_world.AddActor(&player) block := actor.NewBlock(&my_world, glutil.Point3D{22, 0, 0}, glutil.Point3D{10, 20.5, 20}, glutil.Color4D{.5, .3, .1, 1}) my_world.AddActor(&block) renderQueue.Add(&block) tmpList := []actor.OrbitActor{} for i := 0; i < 250; i++ { speed := rand.Intn(3) //radius := rand.Intn(50) + 125 radius := 100 x, y, z := float64(rand.Intn(10)-5), float64(rand.Intn(10)-5), float64(rand.Intn(150)-75) angle := float64(rand.Intn(360)) //cylinder := NewCylinder(&my_world, glutil.Point3D{x, y + 30, z}, 1, 4) cylinder := actor.NewBlock(&my_world, glutil.Point3D{x, y + 30, z}, glutil.Point3D{.1, .1, .1}, glutil.Color4D{.8, .8, .8, .05}) tmpList = append(tmpList, actor.NewOrbitActor(&my_world, &cylinder, glutil.Point3D{x, y + 0, z}, float64(radius))) tmpList[i].SetSpeed(int32(speed)) tmpList[i].SetAngle(int32(angle)) tmpList[i].SetAxis(glutil.Point3D{0, 0, 1}) renderQueue.Add(&cylinder) my_world.AddActor(&tmpList[i]) } // Create castle //myCastle := NewCastle() //renderQueue.AddNamed(&myCastle, "castle") // Create ground ground := entity.NewXYPlane(glutil.Point3D{100, 0, 100}, glutil.Point3D{-100, 0, -100}, 0) ground.SetColor(glutil.Color4D{0.4313725490 * .7, 0.24705882 * .7, 0.098039215 * .7, 1}) ground.SetPolygonOffset(1.0) renderQueue.Add(&ground) my_world.AddEntity(&ground.Box) stairs := actor.NewStairs(&my_world, glutil.Point3D{0, 0, 0}) renderQueue.Add(&stairs) scale := float64(200) for i := 0; i < 100; i++ { x := (rand.Float64() * scale) - (scale / 2) z := (rand.Float64() * scale) - (scale / 2) x_scale, z_scale := (rand.Float64()/2)+.75, (rand.Float64()/2)+.75 y_scale := (rand.Float64() * 1) + .75 if (x < -5 || x > 20) && (z < -5 || z > 20) { tree1 := entity.NewTree(glutil.Point3D{x, 0, z}, x_scale, y_scale, z_scale) renderQueue.Add(&tree1) } } // Put camera somewhere //currentCamera.Translate(5, -5, 28) player.Translate(10, 0, -20) player.ImmediateJump() // Skip interpolation player.Rotate(-120, 0) player.ImmediateLook() // Skip interpolation } func main() { // Let go use 2 threads runtime.GOMAXPROCS(2) // Init glut.InitDisplayMode(glut.RGB | glut.DOUBLE | glut.DEPTH) glut.InitWindowSize(750, 750) glut.CreateWindow("Zach Anders - Assignment 5") setup() // Display Callbacks glut.DisplayFunc(DisplayFunc) glut.IdleFunc(IdleFunc) glut.ReshapeFunc(Reshape) // Input Callbacks glut.SpecialFunc(SpecialFunc) glut.KeyboardFunc(KeyDownFunc) glut.MotionFunc(MouseMotion) glut.MouseFunc(MouseDown) glut.MainLoop() }
Java
from django import forms from ncdjango.interfaces.arcgis.form_fields import SrField class PointForm(forms.Form): x = forms.FloatField() y = forms.FloatField() projection = SrField()
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="lang:clipboard.copy" content="Copy to clipboard"> <meta name="lang:clipboard.copied" content="Copied to clipboard"> <meta name="lang:search.language" content="en"> <meta name="lang:search.pipeline.stopwords" content="True"> <meta name="lang:search.pipeline.trimmer" content="True"> <meta name="lang:search.result.none" content="No matching documents"> <meta name="lang:search.result.one" content="1 matching document"> <meta name="lang:search.result.other" content="# matching documents"> <meta name="lang:search.tokenizer" content="[\s\-]+"> <link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin> <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet"> <style> body, input { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif } code, kbd, pre { font-family: "Roboto Mono", "Courier New", Courier, monospace } </style> <link rel="stylesheet" href="../_static/stylesheets/application.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/> <link rel="stylesheet" href="../_static/fonts/material-icons.css"/> <meta name="theme-color" content="#3f51b5"> <script src="../_static/javascripts/modernizr.js"></script> <title>statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names &#8212; statsmodels</title> <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png"> <link rel="manifest" href="../_static/icons/site.webmanifest"> <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191"> <meta name="msapplication-TileColor" content="#2b5797"> <meta name="msapplication-config" content="../_static/icons/browserconfig.xml"> <link rel="stylesheet" href="../_static/stylesheets/examples.css"> <link rel="stylesheet" href="../_static/stylesheets/deprecation.css"> <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="../_static/material.css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <link rel="stylesheet" type="text/css" href="../_static/plot_directive.css" /> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names" href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names.html" /> <link rel="prev" title="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights" href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights.html" /> </head> <body dir=ltr data-md-color-primary=indigo data-md-color-accent=blue> <svg class="md-svg"> <defs data-children-count="0"> <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg> </defs> </svg> <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search"> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <a href="#generated/statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names" tabindex="1" class="md-skip"> Skip to content </a> <header class="md-header" data-md-component="header"> <nav class="md-header-nav md-grid"> <div class="md-flex navheader"> <div class="md-flex__cell md-flex__cell--shrink"> <a href="../index.html" title="statsmodels" class="md-header-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" height="26" alt="statsmodels logo"> </a> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label> </div> <div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> <span class="md-header-nav__topic">statsmodels v0.13.1</span> <span class="md-header-nav__topic"> statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names </span> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> <div class="md-search" data-md-component="search" role="dialog"> <label class="md-search__overlay" for="__search"></label> <div class="md-search__inner" role="search"> <form class="md-search__form" action="../search.html" method="get" name="search"> <input type="text" class="md-search__input" name="q" placeholder="Search" autocapitalize="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <label class="md-icon md-search__icon" for="__search"></label> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> &#xE5CD; </button> </form> <div class="md-search__output"> <div class="md-search__scrollwrap" data-md-scrollfix> <div class="md-search-result" data-md-component="result"> <div class="md-search-result__meta"> Type to start searching </div> <ol class="md-search-result__list"></ol> </div> </div> </div> </div> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <div class="md-header-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> </div> <script src="../_static/javascripts/version_dropdown.js"></script> <script> var json_loc = "../../versions-v2.json", target_loc = "../../", text = "Versions"; $( document ).ready( add_version_dropdown(json_loc, target_loc, text)); </script> </div> </nav> </header> <div class="md-container"> <nav class="md-tabs" data-md-component="tabs"> <div class="md-tabs__inner md-grid"> <ul class="md-tabs__list"> <li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li> <li class="md-tabs__item"><a href="../gmm.html" class="md-tabs__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a></li> <li class="md-tabs__item"><a href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.html" class="md-tabs__link">statsmodels.sandbox.regression.gmm.NonlinearIVGMM</a></li> </ul> </div> </nav> <main class="md-main"> <div class="md-main__inner md-grid" data-md-component="container"> <div class="md-sidebar md-sidebar--primary" data-md-component="navigation"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--primary" data-md-level="0"> <label class="md-nav__title md-nav__title--site" for="__drawer"> <a href="../index.html" title="statsmodels" class="md-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48"> </a> <a href="../index.html" title="statsmodels">statsmodels v0.13.1</a> </label> <div class="md-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../install.html" class="md-nav__link">Installing statsmodels</a> </li> <li class="md-nav__item"> <a href="../gettingstarted.html" class="md-nav__link">Getting started</a> </li> <li class="md-nav__item"> <a href="../user-guide.html" class="md-nav__link">User Guide</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../user-guide.html#background" class="md-nav__link">Background</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../duration.html" class="md-nav__link">Methods for Survival and Duration Analysis</a> </li> <li class="md-nav__item"> <a href="../nonparametric.html" class="md-nav__link">Nonparametric Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">nonparametric</span></code></a> </li> <li class="md-nav__item"> <a href="../gmm.html" class="md-nav__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a> </li> <li class="md-nav__item"> <a href="../miscmodels.html" class="md-nav__link">Other Models <code class="xref py py-mod docutils literal notranslate"><span class="pre">miscmodels</span></code></a> </li> <li class="md-nav__item"> <a href="../multivariate.html" class="md-nav__link">Multivariate Statistics <code class="xref py py-mod docutils literal notranslate"><span class="pre">multivariate</span></code></a> </li></ul> </li> <li class="md-nav__item"> <a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a> </li></ul> </li> <li class="md-nav__item"> <a href="../examples/index.html" class="md-nav__link">Examples</a> </li> <li class="md-nav__item"> <a href="../api.html" class="md-nav__link">API Reference</a> </li> <li class="md-nav__item"> <a href="../about.html" class="md-nav__link">About statsmodels</a> </li> <li class="md-nav__item"> <a href="../dev/index.html" class="md-nav__link">Developer Page</a> </li> <li class="md-nav__item"> <a href="../release/index.html" class="md-nav__link">Release Notes</a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--secondary"> <ul class="md-nav__list" data-md-scrollfix=""> <li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names.rst.txt">Show Source</a> </li> <li id="searchbox" class="md-nav__item"></li> </ul> </nav> </div> </div> </div> <div class="md-content"> <article class="md-content__inner md-typeset" role="main"> <section id="statsmodels-sandbox-regression-gmm-nonlinearivgmm-endog-names"> <h1 id="generated-statsmodels-sandbox-regression-gmm-nonlinearivgmm-endog-names--page-root">statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names<a class="headerlink" href="#generated-statsmodels-sandbox-regression-gmm-nonlinearivgmm-endog-names--page-root" title="Permalink to this headline">¶</a></h1> <dl class="py property"> <dt class="sig sig-object py" id="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names"> <em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">NonlinearIVGMM.</span></span><span class="sig-name descname"><span class="pre">endog_names</span></span><a class="headerlink" href="#statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names" title="Permalink to this definition">¶</a></dt> <dd><p>Names of endogenous variables.</p> </dd></dl> </section> </article> </div> </div> </main> </div> <footer class="md-footer"> <div class="md-footer-nav"> <nav class="md-footer-nav__inner md-grid"> <a href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights.html" title="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <div class="md-flex__cell md-flex__cell--shrink"> <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> </div> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> <span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Previous </span> statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights </span> </div> </a> <a href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names.html" title="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Next </span> statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names </span> </div> <div class="md-flex__cell md-flex__cell--shrink"><i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> </div> </a> </nav> </div> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-footer-copyright"> <div class="md-footer-copyright__highlight"> &#169; Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. </div> Last updated on Nov 12, 2021. <br/> Created using <a href="http://www.sphinx-doc.org/">Sphinx</a> 4.3.0. and <a href="https://github.com/bashtage/sphinx-material/">Material for Sphinx</a> </div> </div> </div> </footer> <script src="../_static/javascripts/application.js"></script> <script>app.initialize({version: "1.0.4", url: {base: ".."}})</script> </body> </html>
Java
<? $this->title = Yii::t("UserModule.user", 'Create profile field'); $this->breadcrumbs=array( Yii::t("UserModule.user", 'Profile fields')=>array('admin'), Yii::t("UserModule.user", 'Create')); ?> <?php echo $this->renderPartial('_form', array('model'=>$model)); ?>
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_45) on Mon Jul 12 18:25:20 IDT 2021 --> <title>com.exlibris.repository.persistence.sip</title> <meta name="date" content="2021-07-12"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <h1 class="bar"><a href="../../../../../com/exlibris/repository/persistence/sip/package-summary.html" target="classFrame">com.exlibris.repository.persistence.sip</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="SIPStatusInfo.html" title="class in com.exlibris.repository.persistence.sip" target="classFrame">SIPStatusInfo</a></li> </ul> </div> </body> </html>
Java
/* * Kit.h * * Created on: 21 Aug 2016 * Author: jeremy */ #ifndef SOURCE_DRUMKIT_KITS_KIT_H_ #define SOURCE_DRUMKIT_KITS_KIT_H_ #include "KitParameters.h" #include "KitManager.h" #include "../../Sound/SoundBank/SoundBank.h" #include "../Instruments/Instrument.h" #include "../Triggers/Triggers/Trigger.h" #include <string> #include <vector> namespace DrumKit { class Kit { public: Kit(const KitParameters& params, std::vector<TriggerPtr> const& trigs, std::shared_ptr<Sound::SoundBank> sb); virtual ~Kit(); void Enable(); void Disable(); void Save() const { KitManager::SaveKit(parameters.configFilePath, parameters);} void SetInstrumentVolume(size_t id, float volume); std::string GetConfigFilePath() const noexcept { return parameters.configFilePath; } float GetInstrumentVolume(int id) const { return instruments[id]->GetVolume(); } std::string GetInstrumentName(std::size_t id) const; std::string GetName() const noexcept { return parameters.kitName; } int GetNumInstruments() const { return (int)parameters.instrumentParameters.size(); } const std::vector<InstrumentPtr>& GetInstruments() const { return instruments; } private: void CreateInstruments(); KitParameters parameters; const std::vector<TriggerPtr>& triggers; std::shared_ptr<Sound::SoundBank> soundBank; std::vector<InstrumentPtr> instruments; }; } /* namespace DrumKit */ #endif /* SOURCE_DRUMKIT_KITS_KIT_H_ */
Java
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from .fetchers import NUPermissionsFetcher from .fetchers import NUMetadatasFetcher from .fetchers import NUGlobalMetadatasFetcher from bambou import NURESTObject class NUAvatar(NURESTObject): """ Represents a Avatar in the VSD Notes: Avatar """ __rest_name__ = "avatar" __resource_name__ = "avatars" ## Constants CONST_ENTITY_SCOPE_GLOBAL = "GLOBAL" CONST_ENTITY_SCOPE_ENTERPRISE = "ENTERPRISE" def __init__(self, **kwargs): """ Initializes a Avatar instance Notes: You can specify all parameters while calling this methods. A special argument named `data` will enable you to load the object from a Python dictionary Examples: >>> avatar = NUAvatar(id=u'xxxx-xxx-xxx-xxx', name=u'Avatar') >>> avatar = NUAvatar(data=my_dict) """ super(NUAvatar, self).__init__() # Read/Write Attributes self._last_updated_by = None self._last_updated_date = None self._embedded_metadata = None self._entity_scope = None self._creation_date = None self._owner = None self._external_id = None self._type = None self.expose_attribute(local_name="last_updated_by", remote_name="lastUpdatedBy", attribute_type=str, is_required=False, is_unique=False) self.expose_attribute(local_name="last_updated_date", remote_name="lastUpdatedDate", attribute_type=str, is_required=False, is_unique=False) self.expose_attribute(local_name="embedded_metadata", remote_name="embeddedMetadata", attribute_type=list, is_required=False, is_unique=False) self.expose_attribute(local_name="entity_scope", remote_name="entityScope", attribute_type=str, is_required=False, is_unique=False, choices=[u'ENTERPRISE', u'GLOBAL']) self.expose_attribute(local_name="creation_date", remote_name="creationDate", attribute_type=str, is_required=False, is_unique=False) self.expose_attribute(local_name="owner", remote_name="owner", attribute_type=str, is_required=False, is_unique=False) self.expose_attribute(local_name="external_id", remote_name="externalID", attribute_type=str, is_required=False, is_unique=True) self.expose_attribute(local_name="type", remote_name="type", attribute_type=str, is_required=False, is_unique=False) # Fetchers self.permissions = NUPermissionsFetcher.fetcher_with_object(parent_object=self, relationship="child") self.metadatas = NUMetadatasFetcher.fetcher_with_object(parent_object=self, relationship="child") self.global_metadatas = NUGlobalMetadatasFetcher.fetcher_with_object(parent_object=self, relationship="child") self._compute_args(**kwargs) # Properties @property def last_updated_by(self): """ Get last_updated_by value. Notes: ID of the user who last updated the object. This attribute is named `lastUpdatedBy` in VSD API. """ return self._last_updated_by @last_updated_by.setter def last_updated_by(self, value): """ Set last_updated_by value. Notes: ID of the user who last updated the object. This attribute is named `lastUpdatedBy` in VSD API. """ self._last_updated_by = value @property def last_updated_date(self): """ Get last_updated_date value. Notes: Time stamp when this object was last updated. This attribute is named `lastUpdatedDate` in VSD API. """ return self._last_updated_date @last_updated_date.setter def last_updated_date(self, value): """ Set last_updated_date value. Notes: Time stamp when this object was last updated. This attribute is named `lastUpdatedDate` in VSD API. """ self._last_updated_date = value @property def embedded_metadata(self): """ Get embedded_metadata value. Notes: Metadata objects associated with this entity. This will contain a list of Metadata objects if the API request is made using the special flag to enable the embedded Metadata feature. Only a maximum of Metadata objects is returned based on the value set in the system configuration. This attribute is named `embeddedMetadata` in VSD API. """ return self._embedded_metadata @embedded_metadata.setter def embedded_metadata(self, value): """ Set embedded_metadata value. Notes: Metadata objects associated with this entity. This will contain a list of Metadata objects if the API request is made using the special flag to enable the embedded Metadata feature. Only a maximum of Metadata objects is returned based on the value set in the system configuration. This attribute is named `embeddedMetadata` in VSD API. """ self._embedded_metadata = value @property def entity_scope(self): """ Get entity_scope value. Notes: Specify if scope of entity is Data center or Enterprise level This attribute is named `entityScope` in VSD API. """ return self._entity_scope @entity_scope.setter def entity_scope(self, value): """ Set entity_scope value. Notes: Specify if scope of entity is Data center or Enterprise level This attribute is named `entityScope` in VSD API. """ self._entity_scope = value @property def creation_date(self): """ Get creation_date value. Notes: Time stamp when this object was created. This attribute is named `creationDate` in VSD API. """ return self._creation_date @creation_date.setter def creation_date(self, value): """ Set creation_date value. Notes: Time stamp when this object was created. This attribute is named `creationDate` in VSD API. """ self._creation_date = value @property def owner(self): """ Get owner value. Notes: Identifies the user that has created this object. """ return self._owner @owner.setter def owner(self, value): """ Set owner value. Notes: Identifies the user that has created this object. """ self._owner = value @property def external_id(self): """ Get external_id value. Notes: External object ID. Used for integration with third party systems This attribute is named `externalID` in VSD API. """ return self._external_id @external_id.setter def external_id(self, value): """ Set external_id value. Notes: External object ID. Used for integration with third party systems This attribute is named `externalID` in VSD API. """ self._external_id = value @property def type(self): """ Get type value. Notes: The image type """ return self._type @type.setter def type(self, value): """ Set type value. Notes: The image type """ self._type = value
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Zend_Session - Zend Framework Manual</title> </head> <body> <table width="100%"> <tr valign="top"> <td width="85%"> <table width="100%"> <tr> <td width="25%" style="text-align: left;"> <a href="zend.service.yahoo.html">Zend_Service_Yahoo</a> </td> <td width="50%" style="text-align: center;"> <div class="up"><span class="up"><a href="reference.html">Zend Framework Reference</a></span><br /> <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div> </td> <td width="25%" style="text-align: right;"> <div class="next" style="text-align: right; float: right;"><a href="zend.session.introduction.html">Einf&uuml;hrung</a></div> </td> </tr> </table> <hr /> <div id="zend.session" class="chapter"><div class="info"><h1>Zend_Session</h1><strong>Table of Contents</strong><ul class="chunklist chunklist_title"> <li><a href="zend.session.introduction.html">Einf&uuml;hrung</a></li> <li><a href="zend.session.basic_usage.html">Grunds&auml;tzliche Verwendung</a></li> <li><a href="zend.session.advanced_usage.html">Fortgeschrittene Benutzung</a></li> <li><a href="zend.session.global_session_management.html">Globales Session Management</a></li> <li><a href="zend.session.savehandler.dbtable.html">Zend_Session_SaveHandler_DbTable</a></li> </ul> </div> </div> <hr /> <table width="100%"> <tr> <td width="25%" style="text-align: left;"> <a href="zend.service.yahoo.html">Zend_Service_Yahoo</a> </td> <td width="50%" style="text-align: center;"> <div class="up"><span class="up"><a href="reference.html">Zend Framework Reference</a></span><br /> <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div> </td> <td width="25%" style="text-align: right;"> <div class="next" style="text-align: right; float: right;"><a href="zend.session.introduction.html">Einf&uuml;hrung</a></div> </td> </tr> </table> </td> <td style="font-size: smaller;" width="15%"> <style type="text/css"> #leftbar { float: left; width: 186px; padding: 5px; font-size: smaller; } ul.toc { margin: 0px 5px 5px 5px; padding: 0px; } ul.toc li { font-size: 85%; margin: 1px 0 1px 1px; padding: 1px 0 1px 11px; list-style-type: none; background-repeat: no-repeat; background-position: center left; } ul.toc li.header { font-size: 115%; padding: 5px 0px 5px 11px; border-bottom: 1px solid #cccccc; margin-bottom: 5px; } ul.toc li.active { font-weight: bold; } ul.toc li a { text-decoration: none; } ul.toc li a:hover { text-decoration: underline; } </style> <ul class="toc"> <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li> <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li> <li class="header up"><a href="reference.html">Zend Framework Reference</a></li> <li><a href="zend.acl.html">Zend_Acl</a></li> <li><a href="zend.amf.html">Zend_Amf</a></li> <li><a href="zend.application.html">Zend_Application</a></li> <li><a href="zend.auth.html">Zend_Auth</a></li> <li><a href="zend.barcode.html">Zend_Barcode</a></li> <li><a href="zend.cache.html">Zend_Cache</a></li> <li><a href="zend.captcha.html">Zend_Captcha</a></li> <li><a href="zend.cloud.html">SimpleCloud API: Zend_Cloud</a></li> <li><a href="zend.codegenerator.html">Zend_CodeGenerator</a></li> <li><a href="zend.config.html">Zend_Config</a></li> <li><a href="zend.config.writer.html">Zend_Config_Writer</a></li> <li><a href="zend.console.getopt.html">Zend_Console_Getopt</a></li> <li><a href="zend.controller.html">Zend_Controller</a></li> <li><a href="zend.currency.html">Zend_Currency</a></li> <li><a href="zend.date.html">Zend_Date</a></li> <li><a href="zend.db.html">Zend_Db</a></li> <li><a href="zend.debug.html">Zend_Debug</a></li> <li><a href="zend.dojo.html">Zend_Dojo</a></li> <li><a href="zend.dom.html">Zend_Dom</a></li> <li><a href="zend.exception.html">Zend_Exception</a></li> <li><a href="zend.feed.html">Zend_Feed</a></li> <li><a href="zend.file.html">Zend_File</a></li> <li><a href="zend.filter.html">Zend_Filter</a></li> <li><a href="zend.form.html">Zend_Form</a></li> <li><a href="zend.gdata.html">Zend_Gdata</a></li> <li><a href="zend.http.html">Zend_Http</a></li> <li><a href="zend.infocard.html">Zend_InfoCard</a></li> <li><a href="zend.json.html">Zend_Json</a></li> <li><a href="zend.layout.html">Zend_Layout</a></li> <li><a href="zend.ldap.html">Zend_Ldap</a></li> <li><a href="zend.loader.html">Zend_Loader</a></li> <li><a href="zend.locale.html">Zend_Locale</a></li> <li><a href="zend.log.html">Zend_Log</a></li> <li><a href="zend.mail.html">Zend_Mail</a></li> <li><a href="zend.markup.html">Zend_Markup</a></li> <li><a href="zend.measure.html">Zend_Measure</a></li> <li><a href="zend.memory.html">Zend_Memory</a></li> <li><a href="zend.mime.html">Zend_Mime</a></li> <li><a href="zend.navigation.html">Zend_Navigation</a></li> <li><a href="zend.oauth.html">Zend_Oauth</a></li> <li><a href="zend.openid.html">Zend_OpenId</a></li> <li><a href="zend.paginator.html">Zend_Paginator</a></li> <li><a href="zend.pdf.html">Zend_Pdf</a></li> <li><a href="zend.progressbar.html">Zend_ProgressBar</a></li> <li><a href="zend.queue.html">Zend_Queue</a></li> <li><a href="zend.reflection.html">Zend_Reflection</a></li> <li><a href="zend.registry.html">Zend_Registry</a></li> <li><a href="zend.rest.html">Zend_Rest</a></li> <li><a href="zend.search.lucene.html">Zend_Search_Lucene</a></li> <li><a href="zend.serializer.html">Zend_Serializer</a></li> <li><a href="zend.server.html">Zend_Server</a></li> <li><a href="zend.service.html">Zend_Service</a></li> <li class="active"><a href="zend.session.html">Zend_Session</a></li> <li><a href="zend.soap.html">Zend_Soap</a></li> <li><a href="zend.tag.html">Zend_Tag</a></li> <li><a href="zend.test.html">Zend_Test</a></li> <li><a href="zend.text.html">Zend_Text</a></li> <li><a href="zend.timesync.html">Zend_TimeSync</a></li> <li><a href="zend.tool.html">Zend_Tool</a></li> <li><a href="zend.tool.framework.html">Zend_Tool_Framework</a></li> <li><a href="zend.tool.project.html">Zend_Tool_Project</a></li> <li><a href="zend.translate.html">Zend_Translate</a></li> <li><a href="zend.uri.html">Zend_Uri</a></li> <li><a href="zend.validate.html">Zend_Validate</a></li> <li><a href="zend.version.html">Zend_Version</a></li> <li><a href="zend.view.html">Zend_View</a></li> <li><a href="zend.wildfire.html">Zend_Wildfire</a></li> <li><a href="zend.xmlrpc.html">Zend_XmlRpc</a></li> <li><a href="zendx.console.process.unix.html">ZendX_Console_Process_Unix</a></li> <li><a href="zendx.jquery.html">ZendX_JQuery</a></li> </ul> </td> </tr> </table> </body> </html>
Java
/* * hostapd / Initialization and configuration * Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi> * * This software may be distributed under the terms of the BSD license. * See README for more details. */ #include "utils/includes.h" #include "utils/common.h" #include "utils/eloop.h" #include "common/ieee802_11_defs.h" #include "common/wpa_ctrl.h" #include "common/hw_features_common.h" #include "radius/radius_client.h" #include "radius/radius_das.h" #include "eap_server/tncs.h" #include "eapol_auth/eapol_auth_sm.h" #include "eapol_auth/eapol_auth_sm_i.h" #include "fst/fst.h" #include "hostapd.h" #include "authsrv.h" #include "sta_info.h" #include "accounting.h" #include "ap_list.h" #include "beacon.h" #include "iapp.h" #include "ieee802_1x.h" #include "ieee802_11_auth.h" #include "vlan_init.h" #include "wpa_auth.h" #include "wps_hostapd.h" #include "hw_features.h" #include "wpa_auth_glue.h" #include "ap_drv_ops.h" #include "ap_config.h" #include "p2p_hostapd.h" #include "gas_serv.h" #include "dfs.h" #include "ieee802_11.h" #include "bss_load.h" #include "x_snoop.h" #include "dhcp_snoop.h" #include "ndisc_snoop.h" #include "neighbor_db.h" #include "rrm.h" #ifdef CONFIG_KARMA_ATTACK #include "karma_handlers.h" #endif static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason); static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd); static int hostapd_broadcast_wep_clear(struct hostapd_data *hapd); static int setup_interface2(struct hostapd_iface *iface); static void channel_list_update_timeout(void *eloop_ctx, void *timeout_ctx); #ifdef CONFIG_KARMA_ATTACK struct hostapd_data *g_hapd_data; #endif int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx) { size_t i; int ret; for (i = 0; i < interfaces->count; i++) { ret = cb(interfaces->iface[i], ctx); if (ret) return ret; } return 0; } static void hostapd_reload_bss(struct hostapd_data *hapd) { struct hostapd_ssid *ssid; #ifndef CONFIG_NO_RADIUS radius_client_reconfig(hapd->radius, hapd->conf->radius); #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* * Force PSK to be derived again since SSID or passphrase may * have changed. */ hostapd_config_clear_wpa_psk(&hapd->conf->ssid.wpa_psk); } if (hostapd_setup_wpa_psk(hapd->conf)) { wpa_printf(MSG_ERROR, "Failed to re-configure WPA PSK " "after reloading configuration"); } if (hapd->conf->ieee802_1x || hapd->conf->wpa) hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 1); else hostapd_set_drv_ieee8021x(hapd, hapd->conf->iface, 0); if ((hapd->conf->wpa || hapd->conf->osen) && hapd->wpa_auth == NULL) { hostapd_setup_wpa(hapd); if (hapd->wpa_auth) wpa_init_keys(hapd->wpa_auth); } else if (hapd->conf->wpa) { const u8 *wpa_ie; size_t wpa_ie_len; hostapd_reconfig_wpa(hapd); wpa_ie = wpa_auth_get_wpa_ie(hapd->wpa_auth, &wpa_ie_len); if (hostapd_set_generic_elem(hapd, wpa_ie, wpa_ie_len)) wpa_printf(MSG_ERROR, "Failed to configure WPA IE for " "the kernel driver."); } else if (hapd->wpa_auth) { wpa_deinit(hapd->wpa_auth); hapd->wpa_auth = NULL; hostapd_set_privacy(hapd, 0); hostapd_setup_encryption(hapd->conf->iface, hapd); hostapd_set_generic_elem(hapd, (u8 *) "", 0); } ieee802_11_set_beacon(hapd); hostapd_update_wps(hapd); if (hapd->conf->ssid.ssid_set && hostapd_set_ssid(hapd, hapd->conf->ssid.ssid, hapd->conf->ssid.ssid_len)) { wpa_printf(MSG_ERROR, "Could not set SSID for kernel driver"); /* try to continue */ } wpa_printf(MSG_DEBUG, "Reconfigured interface %s", hapd->conf->iface); } static void hostapd_clear_old(struct hostapd_iface *iface) { size_t j; /* * Deauthenticate all stations since the new configuration may not * allow them to use the BSS anymore. */ for (j = 0; j < iface->num_bss; j++) { hostapd_flush_old_stations(iface->bss[j], WLAN_REASON_PREV_AUTH_NOT_VALID); hostapd_broadcast_wep_clear(iface->bss[j]); #ifndef CONFIG_NO_RADIUS /* TODO: update dynamic data based on changed configuration * items (e.g., open/close sockets, etc.) */ radius_client_flush(iface->bss[j]->radius, 0); #endif /* CONFIG_NO_RADIUS */ } } int hostapd_reload_config(struct hostapd_iface *iface) { struct hostapd_data *hapd = iface->bss[0]; struct hostapd_config *newconf, *oldconf; size_t j; if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ hostapd_clear_old(iface); for (j = 0; j < iface->num_bss; j++) hostapd_reload_bss(iface->bss[j]); return 0; } if (iface->interfaces == NULL || iface->interfaces->config_read_cb == NULL) return -1; newconf = iface->interfaces->config_read_cb(iface->config_fname); if (newconf == NULL) return -1; hostapd_clear_old(iface); oldconf = hapd->iconf; iface->conf = newconf; for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; hapd->iconf = newconf; hapd->iconf->channel = oldconf->channel; hapd->iconf->acs = oldconf->acs; hapd->iconf->secondary_channel = oldconf->secondary_channel; hapd->iconf->ieee80211n = oldconf->ieee80211n; hapd->iconf->ieee80211ac = oldconf->ieee80211ac; hapd->iconf->ht_capab = oldconf->ht_capab; hapd->iconf->vht_capab = oldconf->vht_capab; hapd->iconf->vht_oper_chwidth = oldconf->vht_oper_chwidth; hapd->iconf->vht_oper_centr_freq_seg0_idx = oldconf->vht_oper_centr_freq_seg0_idx; hapd->iconf->vht_oper_centr_freq_seg1_idx = oldconf->vht_oper_centr_freq_seg1_idx; hapd->conf = newconf->bss[j]; hostapd_reload_bss(hapd); } hostapd_config_free(oldconf); return 0; } static void hostapd_broadcast_key_clear_iface(struct hostapd_data *hapd, const char *ifname) { int i; if (!ifname) return; for (i = 0; i < NUM_WEP_KEYS; i++) { if (hostapd_drv_set_key(ifname, hapd, WPA_ALG_NONE, NULL, i, 0, NULL, 0, NULL, 0)) { wpa_printf(MSG_DEBUG, "Failed to clear default " "encryption keys (ifname=%s keyidx=%d)", ifname, i); } } #ifdef CONFIG_IEEE80211W if (hapd->conf->ieee80211w) { for (i = NUM_WEP_KEYS; i < NUM_WEP_KEYS + 2; i++) { if (hostapd_drv_set_key(ifname, hapd, WPA_ALG_NONE, NULL, i, 0, NULL, 0, NULL, 0)) { wpa_printf(MSG_DEBUG, "Failed to clear " "default mgmt encryption keys " "(ifname=%s keyidx=%d)", ifname, i); } } } #endif /* CONFIG_IEEE80211W */ } static int hostapd_broadcast_wep_clear(struct hostapd_data *hapd) { hostapd_broadcast_key_clear_iface(hapd, hapd->conf->iface); return 0; } static int hostapd_broadcast_wep_set(struct hostapd_data *hapd) { int errors = 0, idx; struct hostapd_ssid *ssid = &hapd->conf->ssid; idx = ssid->wep.idx; if (ssid->wep.default_len && hostapd_drv_set_key(hapd->conf->iface, hapd, WPA_ALG_WEP, broadcast_ether_addr, idx, 1, NULL, 0, ssid->wep.key[idx], ssid->wep.len[idx])) { wpa_printf(MSG_WARNING, "Could not set WEP encryption."); errors++; } return errors; } static void hostapd_free_hapd_data(struct hostapd_data *hapd) { os_free(hapd->probereq_cb); hapd->probereq_cb = NULL; hapd->num_probereq_cb = 0; #ifdef CONFIG_P2P wpabuf_free(hapd->p2p_beacon_ie); hapd->p2p_beacon_ie = NULL; wpabuf_free(hapd->p2p_probe_resp_ie); hapd->p2p_probe_resp_ie = NULL; #endif /* CONFIG_P2P */ if (!hapd->started) { wpa_printf(MSG_ERROR, "%s: Interface %s wasn't started", __func__, hapd->conf->iface); return; } hapd->started = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); iapp_deinit(hapd->iapp); hapd->iapp = NULL; accounting_deinit(hapd); hostapd_deinit_wpa(hapd); vlan_deinit(hapd); hostapd_acl_deinit(hapd); #ifndef CONFIG_NO_RADIUS radius_client_deinit(hapd->radius); hapd->radius = NULL; radius_das_deinit(hapd->radius_das); hapd->radius_das = NULL; #endif /* CONFIG_NO_RADIUS */ hostapd_deinit_wps(hapd); authsrv_deinit(hapd); if (hapd->interface_added) { hapd->interface_added = 0; if (hostapd_if_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface)) { wpa_printf(MSG_WARNING, "Failed to remove BSS interface %s", hapd->conf->iface); hapd->interface_added = 1; } else { /* * Since this was a dynamically added interface, the * driver wrapper may have removed its internal instance * and hapd->drv_priv is not valid anymore. */ hapd->drv_priv = NULL; } } wpabuf_free(hapd->time_adv); #ifdef CONFIG_INTERWORKING gas_serv_deinit(hapd); #endif /* CONFIG_INTERWORKING */ bss_load_update_deinit(hapd); ndisc_snoop_deinit(hapd); dhcp_snoop_deinit(hapd); x_snoop_deinit(hapd); #ifdef CONFIG_SQLITE bin_clear_free(hapd->tmp_eap_user.identity, hapd->tmp_eap_user.identity_len); bin_clear_free(hapd->tmp_eap_user.password, hapd->tmp_eap_user.password_len); #endif /* CONFIG_SQLITE */ #ifdef CONFIG_MESH wpabuf_free(hapd->mesh_pending_auth); hapd->mesh_pending_auth = NULL; #endif /* CONFIG_MESH */ hostapd_clean_rrm(hapd); } /** * hostapd_cleanup - Per-BSS cleanup (deinitialization) * @hapd: Pointer to BSS data * * This function is used to free all per-BSS data structures and resources. * Most of the modules that are initialized in hostapd_setup_bss() are * deinitialized here. */ static void hostapd_cleanup(struct hostapd_data *hapd) { wpa_printf(MSG_DEBUG, "%s(hapd=%p (%s))", __func__, hapd, hapd->conf->iface); if (hapd->iface->interfaces && hapd->iface->interfaces->ctrl_iface_deinit) hapd->iface->interfaces->ctrl_iface_deinit(hapd); hostapd_free_hapd_data(hapd); } static void sta_track_deinit(struct hostapd_iface *iface) { struct hostapd_sta_info *info; if (!iface->num_sta_seen) return; while ((info = dl_list_first(&iface->sta_seen, struct hostapd_sta_info, list))) { dl_list_del(&info->list); iface->num_sta_seen--; sta_track_del(info); } } static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) { wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); #ifdef CONFIG_IEEE80211N #ifdef NEED_AP_MLME hostapd_stop_setup_timers(iface); #endif /* NEED_AP_MLME */ #endif /* CONFIG_IEEE80211N */ hostapd_free_hw_features(iface->hw_features, iface->num_hw_features); iface->hw_features = NULL; os_free(iface->current_rates); iface->current_rates = NULL; os_free(iface->basic_rates); iface->basic_rates = NULL; ap_list_deinit(iface); sta_track_deinit(iface); } /** * hostapd_cleanup_iface - Complete per-interface cleanup * @iface: Pointer to interface data * * This function is called after per-BSS data structures are deinitialized * with hostapd_cleanup(). */ static void hostapd_cleanup_iface(struct hostapd_iface *iface) { wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); hostapd_cleanup_iface_partial(iface); hostapd_config_free(iface->conf); iface->conf = NULL; os_free(iface->config_fname); os_free(iface->bss); wpa_printf(MSG_DEBUG, "%s: free iface=%p", __func__, iface); os_free(iface); } static void hostapd_clear_wep(struct hostapd_data *hapd) { if (hapd->drv_priv && !hapd->iface->driver_ap_teardown) { hostapd_set_privacy(hapd, 0); hostapd_broadcast_wep_clear(hapd); } } static int hostapd_setup_encryption(char *iface, struct hostapd_data *hapd) { int i; hostapd_broadcast_wep_set(hapd); if (hapd->conf->ssid.wep.default_len) { hostapd_set_privacy(hapd, 1); return 0; } /* * When IEEE 802.1X is not enabled, the driver may need to know how to * set authentication algorithms for static WEP. */ hostapd_drv_set_authmode(hapd, hapd->conf->auth_algs); for (i = 0; i < 4; i++) { if (hapd->conf->ssid.wep.key[i] && hostapd_drv_set_key(iface, hapd, WPA_ALG_WEP, NULL, i, i == hapd->conf->ssid.wep.idx, NULL, 0, hapd->conf->ssid.wep.key[i], hapd->conf->ssid.wep.len[i])) { wpa_printf(MSG_WARNING, "Could not set WEP " "encryption."); return -1; } if (hapd->conf->ssid.wep.key[i] && i == hapd->conf->ssid.wep.idx) hostapd_set_privacy(hapd, 1); } return 0; } static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason) { int ret = 0; u8 addr[ETH_ALEN]; if (hostapd_drv_none(hapd) || hapd->drv_priv == NULL) return 0; if (!hapd->iface->driver_ap_teardown) { wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "Flushing old station entries"); if (hostapd_flush(hapd)) { wpa_msg(hapd->msg_ctx, MSG_WARNING, "Could not connect to kernel driver"); ret = -1; } } wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "Deauthenticate all stations"); os_memset(addr, 0xff, ETH_ALEN); hostapd_drv_sta_deauth(hapd, addr, reason); hostapd_free_stas(hapd); return ret; } static void hostapd_bss_deinit_no_free(struct hostapd_data *hapd) { #ifdef CONFIG_KARMA_ATTACK free_all_karma_data(hapd); #endif hostapd_free_stas(hapd); hostapd_flush_old_stations(hapd, WLAN_REASON_DEAUTH_LEAVING); hostapd_clear_wep(hapd); } /** * hostapd_validate_bssid_configuration - Validate BSSID configuration * @iface: Pointer to interface data * Returns: 0 on success, -1 on failure * * This function is used to validate that the configured BSSIDs are valid. */ static int hostapd_validate_bssid_configuration(struct hostapd_iface *iface) { u8 mask[ETH_ALEN] = { 0 }; struct hostapd_data *hapd = iface->bss[0]; unsigned int i = iface->conf->num_bss, bits = 0, j; int auto_addr = 0; if (hostapd_drv_none(hapd)) return 0; if (iface->conf->use_driver_iface_addr) return 0; /* Generate BSSID mask that is large enough to cover the BSSIDs. */ /* Determine the bits necessary to cover the number of BSSIDs. */ for (i--; i; i >>= 1) bits++; /* Determine the bits necessary to any configured BSSIDs, if they are higher than the number of BSSIDs. */ for (j = 0; j < iface->conf->num_bss; j++) { if (is_zero_ether_addr(iface->conf->bss[j]->bssid)) { if (j) auto_addr++; continue; } for (i = 0; i < ETH_ALEN; i++) { mask[i] |= iface->conf->bss[j]->bssid[i] ^ hapd->own_addr[i]; } } if (!auto_addr) goto skip_mask_ext; for (i = 0; i < ETH_ALEN && mask[i] == 0; i++) ; j = 0; if (i < ETH_ALEN) { j = (5 - i) * 8; while (mask[i] != 0) { mask[i] >>= 1; j++; } } if (bits < j) bits = j; if (bits > 40) { wpa_printf(MSG_ERROR, "Too many bits in the BSSID mask (%u)", bits); return -1; } os_memset(mask, 0xff, ETH_ALEN); j = bits / 8; for (i = 5; i > 5 - j; i--) mask[i] = 0; j = bits % 8; while (j--) mask[i] <<= 1; skip_mask_ext: wpa_printf(MSG_DEBUG, "BSS count %lu, BSSID mask " MACSTR " (%d bits)", (unsigned long) iface->conf->num_bss, MAC2STR(mask), bits); if (!auto_addr) return 0; for (i = 0; i < ETH_ALEN; i++) { if ((hapd->own_addr[i] & mask[i]) != hapd->own_addr[i]) { wpa_printf(MSG_ERROR, "Invalid BSSID mask " MACSTR " for start address " MACSTR ".", MAC2STR(mask), MAC2STR(hapd->own_addr)); wpa_printf(MSG_ERROR, "Start address must be the " "first address in the block (i.e., addr " "AND mask == addr)."); return -1; } } return 0; } static int mac_in_conf(struct hostapd_config *conf, const void *a) { size_t i; for (i = 0; i < conf->num_bss; i++) { if (hostapd_mac_comp(conf->bss[i]->bssid, a) == 0) { return 1; } } return 0; } #ifndef CONFIG_NO_RADIUS static int hostapd_das_nas_mismatch(struct hostapd_data *hapd, struct radius_das_attrs *attr) { if (attr->nas_identifier && (!hapd->conf->nas_identifier || os_strlen(hapd->conf->nas_identifier) != attr->nas_identifier_len || os_memcmp(hapd->conf->nas_identifier, attr->nas_identifier, attr->nas_identifier_len) != 0)) { wpa_printf(MSG_DEBUG, "RADIUS DAS: NAS-Identifier mismatch"); return 1; } if (attr->nas_ip_addr && (hapd->conf->own_ip_addr.af != AF_INET || os_memcmp(&hapd->conf->own_ip_addr.u.v4, attr->nas_ip_addr, 4) != 0)) { wpa_printf(MSG_DEBUG, "RADIUS DAS: NAS-IP-Address mismatch"); return 1; } #ifdef CONFIG_IPV6 if (attr->nas_ipv6_addr && (hapd->conf->own_ip_addr.af != AF_INET6 || os_memcmp(&hapd->conf->own_ip_addr.u.v6, attr->nas_ipv6_addr, 16) != 0)) { wpa_printf(MSG_DEBUG, "RADIUS DAS: NAS-IPv6-Address mismatch"); return 1; } #endif /* CONFIG_IPV6 */ return 0; } static struct sta_info * hostapd_das_find_sta(struct hostapd_data *hapd, struct radius_das_attrs *attr, int *multi) { struct sta_info *selected, *sta; char buf[128]; int num_attr = 0; int count; *multi = 0; for (sta = hapd->sta_list; sta; sta = sta->next) sta->radius_das_match = 1; if (attr->sta_addr) { num_attr++; sta = ap_get_sta(hapd, attr->sta_addr); if (!sta) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No Calling-Station-Id match"); return NULL; } selected = sta; for (sta = hapd->sta_list; sta; sta = sta->next) { if (sta != selected) sta->radius_das_match = 0; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Calling-Station-Id match"); } if (attr->acct_session_id) { num_attr++; if (attr->acct_session_id_len != 16) { wpa_printf(MSG_DEBUG, "RADIUS DAS: Acct-Session-Id cannot match"); return NULL; } count = 0; for (sta = hapd->sta_list; sta; sta = sta->next) { if (!sta->radius_das_match) continue; os_snprintf(buf, sizeof(buf), "%016llX", (unsigned long long) sta->acct_session_id); if (os_memcmp(attr->acct_session_id, buf, 16) != 0) sta->radius_das_match = 0; else count++; } if (count == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No matches remaining after Acct-Session-Id check"); return NULL; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Acct-Session-Id match"); } if (attr->acct_multi_session_id) { num_attr++; if (attr->acct_multi_session_id_len != 16) { wpa_printf(MSG_DEBUG, "RADIUS DAS: Acct-Multi-Session-Id cannot match"); return NULL; } count = 0; for (sta = hapd->sta_list; sta; sta = sta->next) { if (!sta->radius_das_match) continue; if (!sta->eapol_sm || !sta->eapol_sm->acct_multi_session_id) { sta->radius_das_match = 0; continue; } os_snprintf(buf, sizeof(buf), "%016llX", (unsigned long long) sta->eapol_sm->acct_multi_session_id); if (os_memcmp(attr->acct_multi_session_id, buf, 16) != 0) sta->radius_das_match = 0; else count++; } if (count == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No matches remaining after Acct-Multi-Session-Id check"); return NULL; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Acct-Multi-Session-Id match"); } if (attr->cui) { num_attr++; count = 0; for (sta = hapd->sta_list; sta; sta = sta->next) { struct wpabuf *cui; if (!sta->radius_das_match) continue; cui = ieee802_1x_get_radius_cui(sta->eapol_sm); if (!cui || wpabuf_len(cui) != attr->cui_len || os_memcmp(wpabuf_head(cui), attr->cui, attr->cui_len) != 0) sta->radius_das_match = 0; else count++; } if (count == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No matches remaining after Chargeable-User-Identity check"); return NULL; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Chargeable-User-Identity match"); } if (attr->user_name) { num_attr++; count = 0; for (sta = hapd->sta_list; sta; sta = sta->next) { u8 *identity; size_t identity_len; if (!sta->radius_das_match) continue; identity = ieee802_1x_get_identity(sta->eapol_sm, &identity_len); if (!identity || identity_len != attr->user_name_len || os_memcmp(identity, attr->user_name, identity_len) != 0) sta->radius_das_match = 0; else count++; } if (count == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: No matches remaining after User-Name check"); return NULL; } wpa_printf(MSG_DEBUG, "RADIUS DAS: User-Name match"); } if (num_attr == 0) { /* * In theory, we could match all current associations, but it * seems safer to just reject requests that do not include any * session identification attributes. */ wpa_printf(MSG_DEBUG, "RADIUS DAS: No session identification attributes included"); return NULL; } selected = NULL; for (sta = hapd->sta_list; sta; sta = sta->next) { if (sta->radius_das_match) { if (selected) { *multi = 1; return NULL; } selected = sta; } } return selected; } static int hostapd_das_disconnect_pmksa(struct hostapd_data *hapd, struct radius_das_attrs *attr) { if (!hapd->wpa_auth) return -1; return wpa_auth_radius_das_disconnect_pmksa(hapd->wpa_auth, attr); } static enum radius_das_res hostapd_das_disconnect(void *ctx, struct radius_das_attrs *attr) { struct hostapd_data *hapd = ctx; struct sta_info *sta; int multi; if (hostapd_das_nas_mismatch(hapd, attr)) return RADIUS_DAS_NAS_MISMATCH; sta = hostapd_das_find_sta(hapd, attr, &multi); if (sta == NULL) { if (multi) { wpa_printf(MSG_DEBUG, "RADIUS DAS: Multiple sessions match - not supported"); return RADIUS_DAS_MULTI_SESSION_MATCH; } if (hostapd_das_disconnect_pmksa(hapd, attr) == 0) { wpa_printf(MSG_DEBUG, "RADIUS DAS: PMKSA cache entry matched"); return RADIUS_DAS_SUCCESS; } wpa_printf(MSG_DEBUG, "RADIUS DAS: No matching session found"); return RADIUS_DAS_SESSION_NOT_FOUND; } wpa_printf(MSG_DEBUG, "RADIUS DAS: Found a matching session " MACSTR " - disconnecting", MAC2STR(sta->addr)); wpa_auth_pmksa_remove(hapd->wpa_auth, sta->addr); hostapd_drv_sta_deauth(hapd, sta->addr, WLAN_REASON_PREV_AUTH_NOT_VALID); ap_sta_deauthenticate(hapd, sta, WLAN_REASON_PREV_AUTH_NOT_VALID); return RADIUS_DAS_SUCCESS; } #endif /* CONFIG_NO_RADIUS */ /** * hostapd_setup_bss - Per-BSS setup (initialization) * @hapd: Pointer to BSS data * @first: Whether this BSS is the first BSS of an interface; -1 = not first, * but interface may exist * * This function is used to initialize all per-BSS data structures and * resources. This gets called in a loop for each BSS when an interface is * initialized. Most of the modules that are initialized here will be * deinitialized in hostapd_cleanup(). */ static int hostapd_setup_bss(struct hostapd_data *hapd, int first) { struct hostapd_bss_config *conf = hapd->conf; u8 ssid[SSID_MAX_LEN + 1]; int ssid_len, set_ssid; char force_ifname[IFNAMSIZ]; u8 if_addr[ETH_ALEN]; int flush_old_stations = 1; wpa_printf(MSG_DEBUG, "%s(hapd=%p (%s), first=%d)", __func__, hapd, conf->iface, first); #ifdef EAP_SERVER_TNC if (conf->tnc && tncs_global_init() < 0) { wpa_printf(MSG_ERROR, "Failed to initialize TNCS"); return -1; } #endif /* EAP_SERVER_TNC */ if (hapd->started) { wpa_printf(MSG_ERROR, "%s: Interface %s was already started", __func__, conf->iface); return -1; } hapd->started = 1; if (!first || first == -1) { u8 *addr = hapd->own_addr; if (!is_zero_ether_addr(conf->bssid)) { /* Allocate the configured BSSID. */ os_memcpy(hapd->own_addr, conf->bssid, ETH_ALEN); if (hostapd_mac_comp(hapd->own_addr, hapd->iface->bss[0]->own_addr) == 0) { wpa_printf(MSG_ERROR, "BSS '%s' may not have " "BSSID set to the MAC address of " "the radio", conf->iface); return -1; } } else if (hapd->iconf->use_driver_iface_addr) { addr = NULL; } else { /* Allocate the next available BSSID. */ do { inc_byte_array(hapd->own_addr, ETH_ALEN); } while (mac_in_conf(hapd->iconf, hapd->own_addr)); } hapd->interface_added = 1; if (hostapd_if_add(hapd->iface->bss[0], WPA_IF_AP_BSS, conf->iface, addr, hapd, &hapd->drv_priv, force_ifname, if_addr, conf->bridge[0] ? conf->bridge : NULL, first == -1)) { wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID=" MACSTR ")", MAC2STR(hapd->own_addr)); hapd->interface_added = 0; return -1; } if (!addr) os_memcpy(hapd->own_addr, if_addr, ETH_ALEN); } if (conf->wmm_enabled < 0) conf->wmm_enabled = hapd->iconf->ieee80211n; #ifdef CONFIG_IEEE80211R if (is_zero_ether_addr(conf->r1_key_holder)) os_memcpy(conf->r1_key_holder, hapd->own_addr, ETH_ALEN); #endif /* CONFIG_IEEE80211R */ #ifdef CONFIG_MESH if (hapd->iface->mconf == NULL) flush_old_stations = 0; #endif /* CONFIG_MESH */ if (flush_old_stations) hostapd_flush_old_stations(hapd, WLAN_REASON_PREV_AUTH_NOT_VALID); hostapd_set_privacy(hapd, 0); hostapd_broadcast_wep_clear(hapd); if (hostapd_setup_encryption(conf->iface, hapd)) return -1; /* * Fetch the SSID from the system and use it or, * if one was specified in the config file, verify they * match. */ ssid_len = hostapd_get_ssid(hapd, ssid, sizeof(ssid)); if (ssid_len < 0) { wpa_printf(MSG_ERROR, "Could not read SSID from system"); return -1; } if (conf->ssid.ssid_set) { /* * If SSID is specified in the config file and it differs * from what is being used then force installation of the * new SSID. */ set_ssid = (conf->ssid.ssid_len != (size_t) ssid_len || os_memcmp(conf->ssid.ssid, ssid, ssid_len) != 0); } else { /* * No SSID in the config file; just use the one we got * from the system. */ set_ssid = 0; conf->ssid.ssid_len = ssid_len; os_memcpy(conf->ssid.ssid, ssid, conf->ssid.ssid_len); } if (!hostapd_drv_none(hapd)) { wpa_printf(MSG_ERROR, "Using interface %s with hwaddr " MACSTR " and ssid \"%s\"", conf->iface, MAC2STR(hapd->own_addr), wpa_ssid_txt(conf->ssid.ssid, conf->ssid.ssid_len)); } if (hostapd_setup_wpa_psk(conf)) { wpa_printf(MSG_ERROR, "WPA-PSK setup failed."); return -1; } /* Set SSID for the kernel driver (to be used in beacon and probe * response frames) */ if (set_ssid && hostapd_set_ssid(hapd, conf->ssid.ssid, conf->ssid.ssid_len)) { wpa_printf(MSG_ERROR, "Could not set SSID for kernel driver"); return -1; } if (wpa_debug_level <= MSG_MSGDUMP) conf->radius->msg_dumps = 1; #ifndef CONFIG_NO_RADIUS hapd->radius = radius_client_init(hapd, conf->radius); if (hapd->radius == NULL) { wpa_printf(MSG_ERROR, "RADIUS client initialization failed."); return -1; } if (conf->radius_das_port) { struct radius_das_conf das_conf; os_memset(&das_conf, 0, sizeof(das_conf)); das_conf.port = conf->radius_das_port; das_conf.shared_secret = conf->radius_das_shared_secret; das_conf.shared_secret_len = conf->radius_das_shared_secret_len; das_conf.client_addr = &conf->radius_das_client_addr; das_conf.time_window = conf->radius_das_time_window; das_conf.require_event_timestamp = conf->radius_das_require_event_timestamp; das_conf.require_message_authenticator = conf->radius_das_require_message_authenticator; das_conf.ctx = hapd; das_conf.disconnect = hostapd_das_disconnect; hapd->radius_das = radius_das_init(&das_conf); if (hapd->radius_das == NULL) { wpa_printf(MSG_ERROR, "RADIUS DAS initialization " "failed."); return -1; } } #endif /* CONFIG_NO_RADIUS */ if (hostapd_acl_init(hapd)) { wpa_printf(MSG_ERROR, "ACL initialization failed."); return -1; } if (hostapd_init_wps(hapd, conf)) return -1; if (authsrv_init(hapd) < 0) return -1; if (ieee802_1x_init(hapd)) { wpa_printf(MSG_ERROR, "IEEE 802.1X initialization failed."); return -1; } if ((conf->wpa || conf->osen) && hostapd_setup_wpa(hapd)) return -1; if (accounting_init(hapd)) { wpa_printf(MSG_ERROR, "Accounting initialization failed."); return -1; } if (conf->ieee802_11f && (hapd->iapp = iapp_init(hapd, conf->iapp_iface)) == NULL) { wpa_printf(MSG_ERROR, "IEEE 802.11F (IAPP) initialization " "failed."); return -1; } #ifdef CONFIG_INTERWORKING if (gas_serv_init(hapd)) { wpa_printf(MSG_ERROR, "GAS server initialization failed"); return -1; } if (conf->qos_map_set_len && hostapd_drv_set_qos_map(hapd, conf->qos_map_set, conf->qos_map_set_len)) { wpa_printf(MSG_ERROR, "Failed to initialize QoS Map"); return -1; } #endif /* CONFIG_INTERWORKING */ if (conf->bss_load_update_period && bss_load_update_init(hapd)) { wpa_printf(MSG_ERROR, "BSS Load initialization failed"); return -1; } if (conf->proxy_arp) { if (x_snoop_init(hapd)) { wpa_printf(MSG_ERROR, "Generic snooping infrastructure initialization failed"); return -1; } if (dhcp_snoop_init(hapd)) { wpa_printf(MSG_ERROR, "DHCP snooping initialization failed"); return -1; } if (ndisc_snoop_init(hapd)) { wpa_printf(MSG_ERROR, "Neighbor Discovery snooping initialization failed"); return -1; } } if (!hostapd_drv_none(hapd) && vlan_init(hapd)) { wpa_printf(MSG_ERROR, "VLAN initialization failed."); return -1; } if (!conf->start_disabled && ieee802_11_set_beacon(hapd) < 0) return -1; if (hapd->wpa_auth && wpa_init_keys(hapd->wpa_auth) < 0) return -1; if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); return 0; } static void hostapd_tx_queue_params(struct hostapd_iface *iface) { struct hostapd_data *hapd = iface->bss[0]; int i; struct hostapd_tx_queue_params *p; #ifdef CONFIG_MESH if (iface->mconf == NULL) return; #endif /* CONFIG_MESH */ for (i = 0; i < NUM_TX_QUEUES; i++) { p = &iface->conf->tx_queue[i]; if (hostapd_set_tx_queue_params(hapd, i, p->aifs, p->cwmin, p->cwmax, p->burst)) { wpa_printf(MSG_DEBUG, "Failed to set TX queue " "parameters for queue %d.", i); /* Continue anyway */ } } } static int hostapd_set_acl_list(struct hostapd_data *hapd, struct mac_acl_entry *mac_acl, int n_entries, u8 accept_acl) { struct hostapd_acl_params *acl_params; int i, err; acl_params = os_zalloc(sizeof(*acl_params) + (n_entries * sizeof(acl_params->mac_acl[0]))); if (!acl_params) return -ENOMEM; for (i = 0; i < n_entries; i++) os_memcpy(acl_params->mac_acl[i].addr, mac_acl[i].addr, ETH_ALEN); acl_params->acl_policy = accept_acl; acl_params->num_mac_acl = n_entries; err = hostapd_drv_set_acl(hapd, acl_params); os_free(acl_params); return err; } static void hostapd_set_acl(struct hostapd_data *hapd) { struct hostapd_config *conf = hapd->iconf; int err; u8 accept_acl; if (hapd->iface->drv_max_acl_mac_addrs == 0) return; if (conf->bss[0]->macaddr_acl == DENY_UNLESS_ACCEPTED) { accept_acl = 1; err = hostapd_set_acl_list(hapd, conf->bss[0]->accept_mac, conf->bss[0]->num_accept_mac, accept_acl); if (err) { wpa_printf(MSG_DEBUG, "Failed to set accept acl"); return; } } else if (conf->bss[0]->macaddr_acl == ACCEPT_UNLESS_DENIED) { accept_acl = 0; err = hostapd_set_acl_list(hapd, conf->bss[0]->deny_mac, conf->bss[0]->num_deny_mac, accept_acl); if (err) { wpa_printf(MSG_DEBUG, "Failed to set deny acl"); return; } } } static int start_ctrl_iface_bss(struct hostapd_data *hapd) { if (!hapd->iface->interfaces || !hapd->iface->interfaces->ctrl_iface_init) return 0; if (hapd->iface->interfaces->ctrl_iface_init(hapd)) { wpa_printf(MSG_ERROR, "Failed to setup control interface for %s", hapd->conf->iface); return -1; } return 0; } static int start_ctrl_iface(struct hostapd_iface *iface) { size_t i; if (!iface->interfaces || !iface->interfaces->ctrl_iface_init) return 0; for (i = 0; i < iface->num_bss; i++) { struct hostapd_data *hapd = iface->bss[i]; if (iface->interfaces->ctrl_iface_init(hapd)) { wpa_printf(MSG_ERROR, "Failed to setup control interface for %s", hapd->conf->iface); return -1; } } return 0; } static void channel_list_update_timeout(void *eloop_ctx, void *timeout_ctx) { struct hostapd_iface *iface = eloop_ctx; if (!iface->wait_channel_update) { wpa_printf(MSG_INFO, "Channel list update timeout, but interface was not waiting for it"); return; } /* * It is possible that the existing channel list is acceptable, so try * to proceed. */ wpa_printf(MSG_DEBUG, "Channel list update timeout - try to continue anyway"); setup_interface2(iface); } void hostapd_channel_list_updated(struct hostapd_iface *iface, int initiator) { if (!iface->wait_channel_update || initiator != REGDOM_SET_BY_USER) return; wpa_printf(MSG_DEBUG, "Channel list updated - continue setup"); eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); setup_interface2(iface); } static int setup_interface(struct hostapd_iface *iface) { struct hostapd_data *hapd = iface->bss[0]; size_t i; /* * It is possible that setup_interface() is called after the interface * was disabled etc., in which case driver_ap_teardown is possibly set * to 1. Clear it here so any other key/station deletion, which is not * part of a teardown flow, would also call the relevant driver * callbacks. */ iface->driver_ap_teardown = 0; if (!iface->phy[0]) { const char *phy = hostapd_drv_get_radio_name(hapd); if (phy) { wpa_printf(MSG_DEBUG, "phy: %s", phy); os_strlcpy(iface->phy, phy, sizeof(iface->phy)); } } /* * Make sure that all BSSes get configured with a pointer to the same * driver interface. */ for (i = 1; i < iface->num_bss; i++) { iface->bss[i]->driver = hapd->driver; iface->bss[i]->drv_priv = hapd->drv_priv; } if (hostapd_validate_bssid_configuration(iface)) return -1; /* * Initialize control interfaces early to allow external monitoring of * channel setup operations that may take considerable amount of time * especially for DFS cases. */ if (start_ctrl_iface(iface)) return -1; if (hapd->iconf->country[0] && hapd->iconf->country[1]) { char country[4], previous_country[4]; hostapd_set_state(iface, HAPD_IFACE_COUNTRY_UPDATE); if (hostapd_get_country(hapd, previous_country) < 0) previous_country[0] = '\0'; os_memcpy(country, hapd->iconf->country, 3); country[3] = '\0'; if (hostapd_set_country(hapd, country) < 0) { wpa_printf(MSG_ERROR, "Failed to set country code"); return -1; } wpa_printf(MSG_DEBUG, "Previous country code %s, new country code %s", previous_country, country); if (os_strncmp(previous_country, country, 2) != 0) { wpa_printf(MSG_DEBUG, "Continue interface setup after channel list update"); iface->wait_channel_update = 1; eloop_register_timeout(5, 0, channel_list_update_timeout, iface, NULL); return 0; } } return setup_interface2(iface); } static int setup_interface2(struct hostapd_iface *iface) { iface->wait_channel_update = 0; if (hostapd_get_hw_features(iface)) { /* Not all drivers support this yet, so continue without hw * feature data. */ } else { int ret = hostapd_select_hw_mode(iface); if (ret < 0) { wpa_printf(MSG_ERROR, "Could not select hw_mode and " "channel. (%d)", ret); goto fail; } if (ret == 1) { wpa_printf(MSG_DEBUG, "Interface initialization will be completed in a callback (ACS)"); return 0; } ret = hostapd_check_ht_capab(iface); if (ret < 0) goto fail; if (ret == 1) { wpa_printf(MSG_DEBUG, "Interface initialization will " "be completed in a callback"); return 0; } if (iface->conf->ieee80211h) wpa_printf(MSG_DEBUG, "DFS support is enabled"); } return hostapd_setup_interface_complete(iface, 0); fail: hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); if (iface->interfaces && iface->interfaces->terminate_on_error) eloop_terminate(); return -1; } #ifdef CONFIG_FST static const u8 * fst_hostapd_get_bssid_cb(void *ctx) { struct hostapd_data *hapd = ctx; return hapd->own_addr; } static void fst_hostapd_get_channel_info_cb(void *ctx, enum hostapd_hw_mode *hw_mode, u8 *channel) { struct hostapd_data *hapd = ctx; *hw_mode = ieee80211_freq_to_chan(hapd->iface->freq, channel); } static void fst_hostapd_set_ies_cb(void *ctx, const struct wpabuf *fst_ies) { struct hostapd_data *hapd = ctx; if (hapd->iface->fst_ies != fst_ies) { hapd->iface->fst_ies = fst_ies; if (ieee802_11_set_beacon(hapd)) wpa_printf(MSG_WARNING, "FST: Cannot set beacon"); } } static int fst_hostapd_send_action_cb(void *ctx, const u8 *da, struct wpabuf *buf) { struct hostapd_data *hapd = ctx; return hostapd_drv_send_action(hapd, hapd->iface->freq, 0, da, wpabuf_head(buf), wpabuf_len(buf)); } static const struct wpabuf * fst_hostapd_get_mb_ie_cb(void *ctx, const u8 *addr) { struct hostapd_data *hapd = ctx; struct sta_info *sta = ap_get_sta(hapd, addr); return sta ? sta->mb_ies : NULL; } static void fst_hostapd_update_mb_ie_cb(void *ctx, const u8 *addr, const u8 *buf, size_t size) { struct hostapd_data *hapd = ctx; struct sta_info *sta = ap_get_sta(hapd, addr); if (sta) { struct mb_ies_info info; if (!mb_ies_info_by_ies(&info, buf, size)) { wpabuf_free(sta->mb_ies); sta->mb_ies = mb_ies_by_info(&info); } } } static const u8 * fst_hostapd_get_sta(struct fst_get_peer_ctx **get_ctx, Boolean mb_only) { struct sta_info *s = (struct sta_info *) *get_ctx; if (mb_only) { for (; s && !s->mb_ies; s = s->next) ; } if (s) { *get_ctx = (struct fst_get_peer_ctx *) s->next; return s->addr; } *get_ctx = NULL; return NULL; } static const u8 * fst_hostapd_get_peer_first(void *ctx, struct fst_get_peer_ctx **get_ctx, Boolean mb_only) { struct hostapd_data *hapd = ctx; *get_ctx = (struct fst_get_peer_ctx *) hapd->sta_list; return fst_hostapd_get_sta(get_ctx, mb_only); } static const u8 * fst_hostapd_get_peer_next(void *ctx, struct fst_get_peer_ctx **get_ctx, Boolean mb_only) { return fst_hostapd_get_sta(get_ctx, mb_only); } void fst_hostapd_fill_iface_obj(struct hostapd_data *hapd, struct fst_wpa_obj *iface_obj) { iface_obj->ctx = hapd; iface_obj->get_bssid = fst_hostapd_get_bssid_cb; iface_obj->get_channel_info = fst_hostapd_get_channel_info_cb; iface_obj->set_ies = fst_hostapd_set_ies_cb; iface_obj->send_action = fst_hostapd_send_action_cb; iface_obj->get_mb_ie = fst_hostapd_get_mb_ie_cb; iface_obj->update_mb_ie = fst_hostapd_update_mb_ie_cb; iface_obj->get_peer_first = fst_hostapd_get_peer_first; iface_obj->get_peer_next = fst_hostapd_get_peer_next; } #endif /* CONFIG_FST */ #ifdef NEED_AP_MLME static enum nr_chan_width hostapd_get_nr_chan_width(struct hostapd_data *hapd, int ht, int vht) { if (!ht && !vht) return NR_CHAN_WIDTH_20; if (!hapd->iconf->secondary_channel) return NR_CHAN_WIDTH_20; if (!vht || hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_USE_HT) return NR_CHAN_WIDTH_40; if (hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_80MHZ) return NR_CHAN_WIDTH_80; if (hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_160MHZ) return NR_CHAN_WIDTH_160; if (hapd->iconf->vht_oper_chwidth == VHT_CHANWIDTH_80P80MHZ) return NR_CHAN_WIDTH_80P80; return NR_CHAN_WIDTH_20; } #endif /* NEED_AP_MLME */ static void hostapd_set_own_neighbor_report(struct hostapd_data *hapd) { #ifdef NEED_AP_MLME u16 capab = hostapd_own_capab_info(hapd); int ht = hapd->iconf->ieee80211n && !hapd->conf->disable_11n; int vht = hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac; struct wpa_ssid_value ssid; u8 channel, op_class; int center_freq1 = 0, center_freq2 = 0; enum nr_chan_width width; u32 bssid_info; struct wpabuf *nr; if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) return; bssid_info = 3; /* AP is reachable */ bssid_info |= NEI_REP_BSSID_INFO_SECURITY; /* "same as the AP" */ bssid_info |= NEI_REP_BSSID_INFO_KEY_SCOPE; /* "same as the AP" */ if (capab & WLAN_CAPABILITY_SPECTRUM_MGMT) bssid_info |= NEI_REP_BSSID_INFO_SPECTRUM_MGMT; bssid_info |= NEI_REP_BSSID_INFO_RM; /* RRM is supported */ if (hapd->conf->wmm_enabled) { bssid_info |= NEI_REP_BSSID_INFO_QOS; if (hapd->conf->wmm_uapsd && (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_UAPSD)) bssid_info |= NEI_REP_BSSID_INFO_APSD; } if (ht) { bssid_info |= NEI_REP_BSSID_INFO_HT | NEI_REP_BSSID_INFO_DELAYED_BA; /* VHT bit added in IEEE P802.11-REVmc/D4.3 */ if (vht) bssid_info |= NEI_REP_BSSID_INFO_VHT; } /* TODO: Set NEI_REP_BSSID_INFO_MOBILITY_DOMAIN if MDE is set */ ieee80211_freq_to_channel_ext(hapd->iface->freq, hapd->iconf->secondary_channel, hapd->iconf->vht_oper_chwidth, &op_class, &channel); width = hostapd_get_nr_chan_width(hapd, ht, vht); if (vht) { center_freq1 = ieee80211_chan_to_freq( NULL, op_class, hapd->iconf->vht_oper_centr_freq_seg0_idx); if (width == NR_CHAN_WIDTH_80P80) center_freq2 = ieee80211_chan_to_freq( NULL, op_class, hapd->iconf->vht_oper_centr_freq_seg1_idx); } else if (ht) { center_freq1 = hapd->iface->freq + 10 * hapd->iconf->secondary_channel; } ssid.ssid_len = hapd->conf->ssid.ssid_len; os_memcpy(ssid.ssid, hapd->conf->ssid.ssid, ssid.ssid_len); /* * Neighbor Report element size = BSSID + BSSID info + op_class + chan + * phy type + wide bandwidth channel subelement. */ nr = wpabuf_alloc(ETH_ALEN + 4 + 1 + 1 + 1 + 5); if (!nr) return; wpabuf_put_data(nr, hapd->own_addr, ETH_ALEN); wpabuf_put_le32(nr, bssid_info); wpabuf_put_u8(nr, op_class); wpabuf_put_u8(nr, channel); wpabuf_put_u8(nr, ieee80211_get_phy_type(hapd->iface->freq, ht, vht)); /* * Wide Bandwidth Channel subelement may be needed to allow the * receiving STA to send packets to the AP. See IEEE P802.11-REVmc/D5.0 * Figure 9-301. */ wpabuf_put_u8(nr, WNM_NEIGHBOR_WIDE_BW_CHAN); wpabuf_put_u8(nr, 3); wpabuf_put_u8(nr, width); wpabuf_put_u8(nr, center_freq1); wpabuf_put_u8(nr, center_freq2); hostapd_neighbor_set(hapd, hapd->own_addr, &ssid, nr, hapd->iconf->lci, hapd->iconf->civic); wpabuf_free(nr); #endif /* NEED_AP_MLME */ } static int hostapd_setup_interface_complete_sync(struct hostapd_iface *iface, int err) { struct hostapd_data *hapd = iface->bss[0]; size_t j; u8 *prev_addr; int delay_apply_cfg = 0; int res_dfs_offload = 0; if (err) goto fail; wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->conf->channel) { #ifdef NEED_AP_MLME int res; #endif /* NEED_AP_MLME */ iface->freq = hostapd_hw_get_freq(hapd, iface->conf->channel); wpa_printf(MSG_DEBUG, "Mode: %s Channel: %d " "Frequency: %d MHz", hostapd_hw_mode_txt(iface->conf->hw_mode), iface->conf->channel, iface->freq); #ifdef NEED_AP_MLME /* Handle DFS only if it is not offloaded to the driver */ if (!(iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD)) { /* Check DFS */ res = hostapd_handle_dfs(iface); if (res <= 0) { if (res < 0) goto fail; return res; } } else { /* If DFS is offloaded to the driver */ res_dfs_offload = hostapd_handle_dfs_offload(iface); if (res_dfs_offload <= 0) { if (res_dfs_offload < 0) goto fail; } else { wpa_printf(MSG_DEBUG, "Proceed with AP/channel setup"); /* * If this is a DFS channel, move to completing * AP setup. */ if (res_dfs_offload == 1) goto dfs_offload; /* Otherwise fall through. */ } } #endif /* NEED_AP_MLME */ #ifdef CONFIG_MESH if (iface->mconf != NULL) { wpa_printf(MSG_DEBUG, "%s: Mesh configuration will be applied while joining the mesh network", iface->bss[0]->conf->iface); delay_apply_cfg = 1; } #endif /* CONFIG_MESH */ if (!delay_apply_cfg && hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq, hapd->iconf->channel, hapd->iconf->ieee80211n, hapd->iconf->ieee80211ac, hapd->iconf->secondary_channel, hapd->iconf->vht_oper_chwidth, hapd->iconf->vht_oper_centr_freq_seg0_idx, hapd->iconf->vht_oper_centr_freq_seg1_idx)) { wpa_printf(MSG_ERROR, "Could not set channel for " "kernel driver"); goto fail; } } if (iface->current_mode) { if (hostapd_prepare_rates(iface, iface->current_mode)) { wpa_printf(MSG_ERROR, "Failed to prepare rates " "table."); hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_WARNING, "Failed to prepare rates table."); goto fail; } } if (hapd->iconf->rts_threshold > -1 && hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) { wpa_printf(MSG_ERROR, "Could not set RTS threshold for " "kernel driver"); goto fail; } if (hapd->iconf->fragm_threshold > -1 && hostapd_set_frag(hapd, hapd->iconf->fragm_threshold)) { wpa_printf(MSG_ERROR, "Could not set fragmentation threshold " "for kernel driver"); goto fail; } prev_addr = hapd->own_addr; for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; if (j) os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); if (hostapd_setup_bss(hapd, j == 0)) { do { hapd = iface->bss[j]; hostapd_bss_deinit_no_free(hapd); hostapd_free_hapd_data(hapd); } while (j-- > 0); goto fail; } if (is_zero_ether_addr(hapd->conf->bssid)) prev_addr = hapd->own_addr; } hapd = iface->bss[0]; hostapd_tx_queue_params(iface); ap_list_init(iface); hostapd_set_acl(hapd); if (hostapd_driver_commit(hapd) < 0) { wpa_printf(MSG_ERROR, "%s: Failed to commit driver " "configuration", __func__); goto fail; } /* * WPS UPnP module can be initialized only when the "upnp_iface" is up. * If "interface" and "upnp_iface" are the same (e.g., non-bridge * mode), the interface is up only after driver_commit, so initialize * WPS after driver_commit. */ for (j = 0; j < iface->num_bss; j++) { if (hostapd_init_wps_complete(iface->bss[j])) goto fail; } if ((iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) && !res_dfs_offload) { /* * If freq is DFS, and DFS is offloaded to the driver, then wait * for CAC to complete. */ wpa_printf(MSG_DEBUG, "%s: Wait for CAC to complete", __func__); return res_dfs_offload; } #ifdef NEED_AP_MLME dfs_offload: #endif /* NEED_AP_MLME */ #ifdef CONFIG_FST if (hapd->iconf->fst_cfg.group_id[0]) { struct fst_wpa_obj iface_obj; fst_hostapd_fill_iface_obj(hapd, &iface_obj); iface->fst = fst_attach(hapd->conf->iface, hapd->own_addr, &iface_obj, &hapd->iconf->fst_cfg); if (!iface->fst) { wpa_printf(MSG_ERROR, "Could not attach to FST %s", hapd->iconf->fst_cfg.group_id); goto fail; } } #endif /* CONFIG_FST */ hostapd_set_state(iface, HAPD_IFACE_ENABLED); wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_ENABLED); if (hapd->setup_complete_cb) hapd->setup_complete_cb(hapd->setup_complete_cb_ctx); wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", iface->bss[0]->conf->iface); if (iface->interfaces && iface->interfaces->terminate_on_error > 0) iface->interfaces->terminate_on_error--; for (j = 0; j < iface->num_bss; j++) hostapd_set_own_neighbor_report(iface->bss[j]); return 0; fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); #ifdef CONFIG_FST if (iface->fst) { fst_detach(iface->fst); iface->fst = NULL; } #endif /* CONFIG_FST */ if (iface->interfaces && iface->interfaces->terminate_on_error) eloop_terminate(); return -1; } /** * hostapd_setup_interface_complete - Complete interface setup * * This function is called when previous steps in the interface setup has been * completed. This can also start operations, e.g., DFS, that will require * additional processing before interface is ready to be enabled. Such * operations will call this function from eloop callbacks when finished. */ int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err) { struct hapd_interfaces *interfaces = iface->interfaces; struct hostapd_data *hapd = iface->bss[0]; unsigned int i; int not_ready_in_sync_ifaces = 0; if (!iface->need_to_start_in_sync) return hostapd_setup_interface_complete_sync(iface, err); if (err) { wpa_printf(MSG_ERROR, "Interface initialization failed"); hostapd_set_state(iface, HAPD_IFACE_DISABLED); iface->need_to_start_in_sync = 0; wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); if (interfaces && interfaces->terminate_on_error) eloop_terminate(); return -1; } if (iface->ready_to_start_in_sync) { /* Already in ready and waiting. should never happpen */ return 0; } for (i = 0; i < interfaces->count; i++) { if (interfaces->iface[i]->need_to_start_in_sync && !interfaces->iface[i]->ready_to_start_in_sync) not_ready_in_sync_ifaces++; } /* * Check if this is the last interface, if yes then start all the other * waiting interfaces. If not, add this interface to the waiting list. */ if (not_ready_in_sync_ifaces > 1 && iface->state == HAPD_IFACE_DFS) { /* * If this interface went through CAC, do not synchronize, just * start immediately. */ iface->need_to_start_in_sync = 0; wpa_printf(MSG_INFO, "%s: Finished CAC - bypass sync and start interface", iface->bss[0]->conf->iface); return hostapd_setup_interface_complete_sync(iface, err); } if (not_ready_in_sync_ifaces > 1) { /* need to wait as there are other interfaces still coming up */ iface->ready_to_start_in_sync = 1; wpa_printf(MSG_INFO, "%s: Interface waiting to sync with other interfaces", iface->bss[0]->conf->iface); return 0; } wpa_printf(MSG_INFO, "%s: Last interface to sync - starting all interfaces", iface->bss[0]->conf->iface); iface->need_to_start_in_sync = 0; hostapd_setup_interface_complete_sync(iface, err); for (i = 0; i < interfaces->count; i++) { if (interfaces->iface[i]->need_to_start_in_sync && interfaces->iface[i]->ready_to_start_in_sync) { hostapd_setup_interface_complete_sync( interfaces->iface[i], 0); /* Only once the interfaces are sync started */ interfaces->iface[i]->need_to_start_in_sync = 0; } } return 0; } /** * hostapd_setup_interface - Setup of an interface * @iface: Pointer to interface data. * Returns: 0 on success, -1 on failure * * Initializes the driver interface, validates the configuration, * and sets driver parameters based on the configuration. * Flushes old stations, sets the channel, encryption, * beacons, and WDS links based on the configuration. * * If interface setup requires more time, e.g., to perform HT co-ex scans, ACS, * or DFS operations, this function returns 0 before such operations have been * completed. The pending operations are registered into eloop and will be * completed from eloop callbacks. Those callbacks end up calling * hostapd_setup_interface_complete() once setup has been completed. */ int hostapd_setup_interface(struct hostapd_iface *iface) { int ret; ret = setup_interface(iface); if (ret) { wpa_printf(MSG_ERROR, "%s: Unable to setup interface.", iface->bss[0]->conf->iface); return -1; } return 0; } /** * hostapd_alloc_bss_data - Allocate and initialize per-BSS data * @hapd_iface: Pointer to interface data * @conf: Pointer to per-interface configuration * @bss: Pointer to per-BSS configuration for this BSS * Returns: Pointer to allocated BSS data * * This function is used to allocate per-BSS data structure. This data will be * freed after hostapd_cleanup() is called for it during interface * deinitialization. */ struct hostapd_data * hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, struct hostapd_config *conf, struct hostapd_bss_config *bss) { struct hostapd_data *hapd; hapd = os_zalloc(sizeof(*hapd)); if (hapd == NULL) return NULL; hapd->new_assoc_sta_cb = hostapd_new_assoc_sta; hapd->iconf = conf; hapd->conf = bss; hapd->iface = hapd_iface; hapd->driver = hapd->iconf->driver; hapd->ctrl_sock = -1; dl_list_init(&hapd->ctrl_dst); dl_list_init(&hapd->nr_db); return hapd; } static void hostapd_bss_deinit(struct hostapd_data *hapd) { if (!hapd) return; wpa_printf(MSG_DEBUG, "%s: deinit bss %s", __func__, hapd->conf->iface); hostapd_bss_deinit_no_free(hapd); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); hostapd_cleanup(hapd); } void hostapd_interface_deinit(struct hostapd_iface *iface) { int j; wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); if (iface == NULL) return; hostapd_set_state(iface, HAPD_IFACE_DISABLED); #ifdef CONFIG_IEEE80211N #ifdef NEED_AP_MLME hostapd_stop_setup_timers(iface); eloop_cancel_timeout(ap_ht2040_timeout, iface, NULL); #endif /* NEED_AP_MLME */ #endif /* CONFIG_IEEE80211N */ eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); iface->wait_channel_update = 0; #ifdef CONFIG_FST if (iface->fst) { fst_detach(iface->fst); iface->fst = NULL; } #endif /* CONFIG_FST */ for (j = iface->num_bss - 1; j >= 0; j--) { if (!iface->bss) break; hostapd_bss_deinit(iface->bss[j]); } } void hostapd_interface_free(struct hostapd_iface *iface) { size_t j; wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); for (j = 0; j < iface->num_bss; j++) { if (!iface->bss) break; wpa_printf(MSG_DEBUG, "%s: free hapd %p", __func__, iface->bss[j]); os_free(iface->bss[j]); } hostapd_cleanup_iface(iface); } struct hostapd_iface * hostapd_alloc_iface(void) { struct hostapd_iface *hapd_iface; hapd_iface = os_zalloc(sizeof(*hapd_iface)); if (!hapd_iface) return NULL; dl_list_init(&hapd_iface->sta_seen); return hapd_iface; } /** * hostapd_init - Allocate and initialize per-interface data * @config_file: Path to the configuration file * Returns: Pointer to the allocated interface data or %NULL on failure * * This function is used to allocate main data structures for per-interface * data. The allocated data buffer will be freed by calling * hostapd_cleanup_iface(). */ struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces, const char *config_file) { struct hostapd_iface *hapd_iface = NULL; struct hostapd_config *conf = NULL; struct hostapd_data *hapd; size_t i; hapd_iface = hostapd_alloc_iface(); if (hapd_iface == NULL) goto fail; hapd_iface->config_fname = os_strdup(config_file); if (hapd_iface->config_fname == NULL) goto fail; conf = interfaces->config_read_cb(hapd_iface->config_fname); if (conf == NULL) goto fail; hapd_iface->conf = conf; hapd_iface->num_bss = conf->num_bss; hapd_iface->bss = os_calloc(conf->num_bss, sizeof(struct hostapd_data *)); if (hapd_iface->bss == NULL) goto fail; for (i = 0; i < conf->num_bss; i++) { hapd = hapd_iface->bss[i] = hostapd_alloc_bss_data(hapd_iface, conf, conf->bss[i]); if (hapd == NULL) goto fail; hapd->msg_ctx = hapd; } #ifdef CONFIG_KARMA_ATTACK g_hapd_data = hapd_iface->bss[0]; #endif return hapd_iface; fail: wpa_printf(MSG_ERROR, "Failed to set up interface with %s", config_file); if (conf) hostapd_config_free(conf); if (hapd_iface) { os_free(hapd_iface->config_fname); os_free(hapd_iface->bss); wpa_printf(MSG_DEBUG, "%s: free iface %p", __func__, hapd_iface); os_free(hapd_iface); } return NULL; } static int ifname_in_use(struct hapd_interfaces *interfaces, const char *ifname) { size_t i, j; for (i = 0; i < interfaces->count; i++) { struct hostapd_iface *iface = interfaces->iface[i]; for (j = 0; j < iface->num_bss; j++) { struct hostapd_data *hapd = iface->bss[j]; if (os_strcmp(ifname, hapd->conf->iface) == 0) return 1; } } return 0; } /** * hostapd_interface_init_bss - Read configuration file and init BSS data * * This function is used to parse configuration file for a BSS. This BSS is * added to an existing interface sharing the same radio (if any) or a new * interface is created if this is the first interface on a radio. This * allocate memory for the BSS. No actual driver operations are started. * * This is similar to hostapd_interface_init(), but for a case where the * configuration is used to add a single BSS instead of all BSSes for a radio. */ struct hostapd_iface * hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy, const char *config_fname, int debug) { struct hostapd_iface *new_iface = NULL, *iface = NULL; struct hostapd_data *hapd; int k; size_t i, bss_idx; if (!phy || !*phy) return NULL; for (i = 0; i < interfaces->count; i++) { if (os_strcmp(interfaces->iface[i]->phy, phy) == 0) { iface = interfaces->iface[i]; break; } } wpa_printf(MSG_INFO, "Configuration file: %s (phy %s)%s", config_fname, phy, iface ? "" : " --> new PHY"); if (iface) { struct hostapd_config *conf; struct hostapd_bss_config **tmp_conf; struct hostapd_data **tmp_bss; struct hostapd_bss_config *bss; const char *ifname; /* Add new BSS to existing iface */ conf = interfaces->config_read_cb(config_fname); if (conf == NULL) return NULL; if (conf->num_bss > 1) { wpa_printf(MSG_ERROR, "Multiple BSSes specified in BSS-config"); hostapd_config_free(conf); return NULL; } ifname = conf->bss[0]->iface; if (ifname[0] != '\0' && ifname_in_use(interfaces, ifname)) { wpa_printf(MSG_ERROR, "Interface name %s already in use", ifname); hostapd_config_free(conf); return NULL; } tmp_conf = os_realloc_array( iface->conf->bss, iface->conf->num_bss + 1, sizeof(struct hostapd_bss_config *)); tmp_bss = os_realloc_array(iface->bss, iface->num_bss + 1, sizeof(struct hostapd_data *)); if (tmp_bss) iface->bss = tmp_bss; if (tmp_conf) { iface->conf->bss = tmp_conf; iface->conf->last_bss = tmp_conf[0]; } if (tmp_bss == NULL || tmp_conf == NULL) { hostapd_config_free(conf); return NULL; } bss = iface->conf->bss[iface->conf->num_bss] = conf->bss[0]; iface->conf->num_bss++; hapd = hostapd_alloc_bss_data(iface, iface->conf, bss); if (hapd == NULL) { iface->conf->num_bss--; hostapd_config_free(conf); return NULL; } iface->conf->last_bss = bss; iface->bss[iface->num_bss] = hapd; hapd->msg_ctx = hapd; bss_idx = iface->num_bss++; conf->num_bss--; conf->bss[0] = NULL; hostapd_config_free(conf); } else { /* Add a new iface with the first BSS */ new_iface = iface = hostapd_init(interfaces, config_fname); if (!iface) return NULL; os_strlcpy(iface->phy, phy, sizeof(iface->phy)); iface->interfaces = interfaces; bss_idx = 0; } for (k = 0; k < debug; k++) { if (iface->bss[bss_idx]->conf->logger_stdout_level > 0) iface->bss[bss_idx]->conf->logger_stdout_level--; } if (iface->conf->bss[bss_idx]->iface[0] == '\0' && !hostapd_drv_none(iface->bss[bss_idx])) { wpa_printf(MSG_ERROR, "Interface name not specified in %s", config_fname); if (new_iface) hostapd_interface_deinit_free(new_iface); return NULL; } return iface; } void hostapd_interface_deinit_free(struct hostapd_iface *iface) { const struct wpa_driver_ops *driver; void *drv_priv; wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); if (iface == NULL) return; wpa_printf(MSG_DEBUG, "%s: num_bss=%u conf->num_bss=%u", __func__, (unsigned int) iface->num_bss, (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; hostapd_interface_deinit(iface); wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); if (driver && driver->hapd_deinit && drv_priv) { driver->hapd_deinit(drv_priv); iface->bss[0]->drv_priv = NULL; } hostapd_interface_free(iface); } static void hostapd_deinit_driver(const struct wpa_driver_ops *driver, void *drv_priv, struct hostapd_iface *hapd_iface) { size_t j; wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); if (driver && driver->hapd_deinit && drv_priv) { driver->hapd_deinit(drv_priv); for (j = 0; j < hapd_iface->num_bss; j++) { wpa_printf(MSG_DEBUG, "%s:bss[%d]->drv_priv=%p", __func__, (int) j, hapd_iface->bss[j]->drv_priv); if (hapd_iface->bss[j]->drv_priv == drv_priv) hapd_iface->bss[j]->drv_priv = NULL; } } } int hostapd_enable_iface(struct hostapd_iface *hapd_iface) { size_t j; if (hapd_iface->bss[0]->drv_priv != NULL) { wpa_printf(MSG_ERROR, "Interface %s already enabled", hapd_iface->conf->bss[0]->iface); return -1; } wpa_printf(MSG_DEBUG, "Enable interface %s", hapd_iface->conf->bss[0]->iface); for (j = 0; j < hapd_iface->num_bss; j++) hostapd_set_security_params(hapd_iface->conf->bss[j], 1); if (hostapd_config_check(hapd_iface->conf, 1) < 0) { wpa_printf(MSG_INFO, "Invalid configuration - cannot enable"); return -1; } if (hapd_iface->interfaces == NULL || hapd_iface->interfaces->driver_init == NULL || hapd_iface->interfaces->driver_init(hapd_iface)) return -1; if (hostapd_setup_interface(hapd_iface)) { hostapd_deinit_driver(hapd_iface->bss[0]->driver, hapd_iface->bss[0]->drv_priv, hapd_iface); return -1; } return 0; } int hostapd_reload_iface(struct hostapd_iface *hapd_iface) { size_t j; wpa_printf(MSG_DEBUG, "Reload interface %s", hapd_iface->conf->bss[0]->iface); for (j = 0; j < hapd_iface->num_bss; j++) hostapd_set_security_params(hapd_iface->conf->bss[j], 1); if (hostapd_config_check(hapd_iface->conf, 1) < 0) { wpa_printf(MSG_ERROR, "Updated configuration is invalid"); return -1; } hostapd_clear_old(hapd_iface); for (j = 0; j < hapd_iface->num_bss; j++) hostapd_reload_bss(hapd_iface->bss[j]); return 0; } int hostapd_disable_iface(struct hostapd_iface *hapd_iface) { size_t j; const struct wpa_driver_ops *driver; void *drv_priv; if (hapd_iface == NULL) return -1; if (hapd_iface->bss[0]->drv_priv == NULL) { wpa_printf(MSG_INFO, "Interface %s already disabled", hapd_iface->conf->bss[0]->iface); return -1; } wpa_msg(hapd_iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); driver = hapd_iface->bss[0]->driver; drv_priv = hapd_iface->bss[0]->drv_priv; hapd_iface->driver_ap_teardown = !!(hapd_iface->drv_flags & WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT); /* same as hostapd_interface_deinit without deinitializing ctrl-iface */ for (j = 0; j < hapd_iface->num_bss; j++) { struct hostapd_data *hapd = hapd_iface->bss[j]; hostapd_bss_deinit_no_free(hapd); hostapd_free_hapd_data(hapd); } hostapd_deinit_driver(driver, drv_priv, hapd_iface); /* From hostapd_cleanup_iface: These were initialized in * hostapd_setup_interface and hostapd_setup_interface_complete */ hostapd_cleanup_iface_partial(hapd_iface); wpa_printf(MSG_DEBUG, "Interface %s disabled", hapd_iface->bss[0]->conf->iface); hostapd_set_state(hapd_iface, HAPD_IFACE_DISABLED); return 0; } static struct hostapd_iface * hostapd_iface_alloc(struct hapd_interfaces *interfaces) { struct hostapd_iface **iface, *hapd_iface; iface = os_realloc_array(interfaces->iface, interfaces->count + 1, sizeof(struct hostapd_iface *)); if (iface == NULL) return NULL; interfaces->iface = iface; hapd_iface = interfaces->iface[interfaces->count] = hostapd_alloc_iface(); if (hapd_iface == NULL) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory for " "the interface", __func__); return NULL; } interfaces->count++; hapd_iface->interfaces = interfaces; return hapd_iface; } static struct hostapd_config * hostapd_config_alloc(struct hapd_interfaces *interfaces, const char *ifname, const char *ctrl_iface, const char *driver) { struct hostapd_bss_config *bss; struct hostapd_config *conf; /* Allocates memory for bss and conf */ conf = hostapd_config_defaults(); if (conf == NULL) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory for " "configuration", __func__); return NULL; } if (driver) { int j; for (j = 0; wpa_drivers[j]; j++) { if (os_strcmp(driver, wpa_drivers[j]->name) == 0) { conf->driver = wpa_drivers[j]; goto skip; } } wpa_printf(MSG_ERROR, "Invalid/unknown driver '%s' - registering the default driver", driver); } conf->driver = wpa_drivers[0]; if (conf->driver == NULL) { wpa_printf(MSG_ERROR, "No driver wrappers registered!"); hostapd_config_free(conf); return NULL; } skip: bss = conf->last_bss = conf->bss[0]; os_strlcpy(bss->iface, ifname, sizeof(bss->iface)); bss->ctrl_interface = os_strdup(ctrl_iface); if (bss->ctrl_interface == NULL) { hostapd_config_free(conf); return NULL; } /* Reading configuration file skipped, will be done in SET! * From reading the configuration till the end has to be done in * SET */ return conf; } static int hostapd_data_alloc(struct hostapd_iface *hapd_iface, struct hostapd_config *conf) { size_t i; struct hostapd_data *hapd; hapd_iface->bss = os_calloc(conf->num_bss, sizeof(struct hostapd_data *)); if (hapd_iface->bss == NULL) return -1; for (i = 0; i < conf->num_bss; i++) { hapd = hapd_iface->bss[i] = hostapd_alloc_bss_data(hapd_iface, conf, conf->bss[i]); if (hapd == NULL) { while (i > 0) { i--; os_free(hapd_iface->bss[i]); hapd_iface->bss[i] = NULL; } os_free(hapd_iface->bss); hapd_iface->bss = NULL; return -1; } hapd->msg_ctx = hapd; } hapd_iface->conf = conf; hapd_iface->num_bss = conf->num_bss; return 0; } int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) { struct hostapd_config *conf = NULL; struct hostapd_iface *hapd_iface = NULL, *new_iface = NULL; struct hostapd_data *hapd; char *ptr; size_t i, j; const char *conf_file = NULL, *phy_name = NULL; if (os_strncmp(buf, "bss_config=", 11) == 0) { char *pos; phy_name = buf + 11; pos = os_strchr(phy_name, ':'); if (!pos) return -1; *pos++ = '\0'; conf_file = pos; if (!os_strlen(conf_file)) return -1; hapd_iface = hostapd_interface_init_bss(interfaces, phy_name, conf_file, 0); if (!hapd_iface) return -1; for (j = 0; j < interfaces->count; j++) { if (interfaces->iface[j] == hapd_iface) break; } if (j == interfaces->count) { struct hostapd_iface **tmp; tmp = os_realloc_array(interfaces->iface, interfaces->count + 1, sizeof(struct hostapd_iface *)); if (!tmp) { hostapd_interface_deinit_free(hapd_iface); return -1; } interfaces->iface = tmp; interfaces->iface[interfaces->count++] = hapd_iface; new_iface = hapd_iface; } if (new_iface) { if (interfaces->driver_init(hapd_iface)) goto fail; if (hostapd_setup_interface(hapd_iface)) { hostapd_deinit_driver( hapd_iface->bss[0]->driver, hapd_iface->bss[0]->drv_priv, hapd_iface); goto fail; } } else { /* Assign new BSS with bss[0]'s driver info */ hapd = hapd_iface->bss[hapd_iface->num_bss - 1]; hapd->driver = hapd_iface->bss[0]->driver; hapd->drv_priv = hapd_iface->bss[0]->drv_priv; os_memcpy(hapd->own_addr, hapd_iface->bss[0]->own_addr, ETH_ALEN); if (start_ctrl_iface_bss(hapd) < 0 || (hapd_iface->state == HAPD_IFACE_ENABLED && hostapd_setup_bss(hapd, -1))) { hostapd_cleanup(hapd); hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; hapd_iface->conf->num_bss--; hapd_iface->num_bss--; wpa_printf(MSG_DEBUG, "%s: free hapd %p %s", __func__, hapd, hapd->conf->iface); hostapd_config_free_bss(hapd->conf); hapd->conf = NULL; os_free(hapd); return -1; } } return 0; } ptr = os_strchr(buf, ' '); if (ptr == NULL) return -1; *ptr++ = '\0'; if (os_strncmp(ptr, "config=", 7) == 0) conf_file = ptr + 7; for (i = 0; i < interfaces->count; i++) { if (!os_strcmp(interfaces->iface[i]->conf->bss[0]->iface, buf)) { wpa_printf(MSG_INFO, "Cannot add interface - it " "already exists"); return -1; } } hapd_iface = hostapd_iface_alloc(interfaces); if (hapd_iface == NULL) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory " "for interface", __func__); goto fail; } new_iface = hapd_iface; if (conf_file && interfaces->config_read_cb) { conf = interfaces->config_read_cb(conf_file); if (conf && conf->bss) os_strlcpy(conf->bss[0]->iface, buf, sizeof(conf->bss[0]->iface)); } else { char *driver = os_strchr(ptr, ' '); if (driver) *driver++ = '\0'; conf = hostapd_config_alloc(interfaces, buf, ptr, driver); } if (conf == NULL || conf->bss == NULL) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory " "for configuration", __func__); goto fail; } if (hostapd_data_alloc(hapd_iface, conf) < 0) { wpa_printf(MSG_ERROR, "%s: Failed to allocate memory " "for hostapd", __func__); goto fail; } conf = NULL; if (start_ctrl_iface(hapd_iface) < 0) goto fail; wpa_printf(MSG_INFO, "Add interface '%s'", hapd_iface->conf->bss[0]->iface); return 0; fail: if (conf) hostapd_config_free(conf); if (hapd_iface) { if (hapd_iface->bss) { for (i = 0; i < hapd_iface->num_bss; i++) { hapd = hapd_iface->bss[i]; if (!hapd) continue; if (hapd_iface->interfaces && hapd_iface->interfaces->ctrl_iface_deinit) hapd_iface->interfaces-> ctrl_iface_deinit(hapd); wpa_printf(MSG_DEBUG, "%s: free hapd %p (%s)", __func__, hapd_iface->bss[i], hapd->conf->iface); hostapd_cleanup(hapd); os_free(hapd); hapd_iface->bss[i] = NULL; } os_free(hapd_iface->bss); hapd_iface->bss = NULL; } if (new_iface) { interfaces->count--; interfaces->iface[interfaces->count] = NULL; } hostapd_cleanup_iface(hapd_iface); } return -1; } static int hostapd_remove_bss(struct hostapd_iface *iface, unsigned int idx) { size_t i; wpa_printf(MSG_INFO, "Remove BSS '%s'", iface->conf->bss[idx]->iface); /* Remove hostapd_data only if it has already been initialized */ if (idx < iface->num_bss) { struct hostapd_data *hapd = iface->bss[idx]; hostapd_bss_deinit(hapd); wpa_printf(MSG_DEBUG, "%s: free hapd %p (%s)", __func__, hapd, hapd->conf->iface); hostapd_config_free_bss(hapd->conf); hapd->conf = NULL; os_free(hapd); iface->num_bss--; for (i = idx; i < iface->num_bss; i++) iface->bss[i] = iface->bss[i + 1]; } else { hostapd_config_free_bss(iface->conf->bss[idx]); iface->conf->bss[idx] = NULL; } iface->conf->num_bss--; for (i = idx; i < iface->conf->num_bss; i++) iface->conf->bss[i] = iface->conf->bss[i + 1]; return 0; } int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf) { struct hostapd_iface *hapd_iface; size_t i, j, k = 0; for (i = 0; i < interfaces->count; i++) { hapd_iface = interfaces->iface[i]; if (hapd_iface == NULL) return -1; if (!os_strcmp(hapd_iface->conf->bss[0]->iface, buf)) { wpa_printf(MSG_INFO, "Remove interface '%s'", buf); hapd_iface->driver_ap_teardown = !!(hapd_iface->drv_flags & WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT); hostapd_interface_deinit_free(hapd_iface); k = i; while (k < (interfaces->count - 1)) { interfaces->iface[k] = interfaces->iface[k + 1]; k++; } interfaces->count--; return 0; } for (j = 0; j < hapd_iface->conf->num_bss; j++) { if (!os_strcmp(hapd_iface->conf->bss[j]->iface, buf)) { hapd_iface->driver_ap_teardown = !(hapd_iface->drv_flags & WPA_DRIVER_FLAGS_AP_TEARDOWN_SUPPORT); return hostapd_remove_bss(hapd_iface, j); } } } return -1; } /** * hostapd_new_assoc_sta - Notify that a new station associated with the AP * @hapd: Pointer to BSS data * @sta: Pointer to the associated STA data * @reassoc: 1 to indicate this was a re-association; 0 = first association * * This function will be called whenever a station associates with the AP. It * can be called from ieee802_11.c for drivers that export MLME to hostapd and * from drv_callbacks.c based on driver events for drivers that take care of * management frames (IEEE 802.11 authentication and association) internally. */ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, int reassoc) { if (hapd->tkip_countermeasures) { hostapd_drv_sta_deauth(hapd, sta->addr, WLAN_REASON_MICHAEL_MIC_FAILURE); return; } hostapd_prune_associations(hapd, sta->addr); ap_sta_clear_disconnect_timeouts(hapd, sta); /* IEEE 802.11F (IAPP) */ if (hapd->conf->ieee802_11f) iapp_new_station(hapd->iapp, sta); #ifdef CONFIG_P2P if (sta->p2p_ie == NULL && !sta->no_p2p_set) { sta->no_p2p_set = 1; hapd->num_sta_no_p2p++; if (hapd->num_sta_no_p2p == 1) hostapd_p2p_non_p2p_sta_connected(hapd); } #endif /* CONFIG_P2P */ /* Start accounting here, if IEEE 802.1X and WPA are not used. * IEEE 802.1X/WPA code will start accounting after the station has * been authorized. */ if (!hapd->conf->ieee802_1x && !hapd->conf->wpa && !hapd->conf->osen) { ap_sta_set_authorized(hapd, sta, 1); os_get_reltime(&sta->connected_time); accounting_sta_start(hapd, sta); } /* Start IEEE 802.1X authentication process for new stations */ ieee802_1x_new_station(hapd, sta); if (reassoc) { if (sta->auth_alg != WLAN_AUTH_FT && !(sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS))) wpa_auth_sm_event(sta->wpa_sm, WPA_REAUTH); } else wpa_auth_sta_associated(hapd->wpa_auth, sta->wpa_sm); if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_INACTIVITY_TIMER)) { wpa_printf(MSG_DEBUG, "%s: %s: reschedule ap_handle_timer timeout for " MACSTR " (%d seconds - ap_max_inactivity)", hapd->conf->iface, __func__, MAC2STR(sta->addr), hapd->conf->ap_max_inactivity); eloop_cancel_timeout(ap_handle_timer, hapd, sta); eloop_register_timeout(hapd->conf->ap_max_inactivity, 0, ap_handle_timer, hapd, sta); } } const char * hostapd_state_text(enum hostapd_iface_state s) { switch (s) { case HAPD_IFACE_UNINITIALIZED: return "UNINITIALIZED"; case HAPD_IFACE_DISABLED: return "DISABLED"; case HAPD_IFACE_COUNTRY_UPDATE: return "COUNTRY_UPDATE"; case HAPD_IFACE_ACS: return "ACS"; case HAPD_IFACE_HT_SCAN: return "HT_SCAN"; case HAPD_IFACE_DFS: return "DFS"; case HAPD_IFACE_ENABLED: return "ENABLED"; } return "UNKNOWN"; } void hostapd_set_state(struct hostapd_iface *iface, enum hostapd_iface_state s) { wpa_printf(MSG_INFO, "%s: interface state %s->%s", iface->conf ? iface->conf->bss[0]->iface : "N/A", hostapd_state_text(iface->state), hostapd_state_text(s)); iface->state = s; } int hostapd_csa_in_progress(struct hostapd_iface *iface) { unsigned int i; for (i = 0; i < iface->num_bss; i++) if (iface->bss[i]->csa_in_progress) return 1; return 0; } #ifdef NEED_AP_MLME static void free_beacon_data(struct beacon_data *beacon) { os_free(beacon->head); beacon->head = NULL; os_free(beacon->tail); beacon->tail = NULL; os_free(beacon->probe_resp); beacon->probe_resp = NULL; os_free(beacon->beacon_ies); beacon->beacon_ies = NULL; os_free(beacon->proberesp_ies); beacon->proberesp_ies = NULL; os_free(beacon->assocresp_ies); beacon->assocresp_ies = NULL; } static int hostapd_build_beacon_data(struct hostapd_data *hapd, struct beacon_data *beacon) { struct wpabuf *beacon_extra, *proberesp_extra, *assocresp_extra; struct wpa_driver_ap_params params; int ret; os_memset(beacon, 0, sizeof(*beacon)); ret = ieee802_11_build_ap_params(hapd, &params); if (ret < 0) return ret; ret = hostapd_build_ap_extra_ies(hapd, &beacon_extra, &proberesp_extra, &assocresp_extra); if (ret) goto free_ap_params; ret = -1; beacon->head = os_malloc(params.head_len); if (!beacon->head) goto free_ap_extra_ies; os_memcpy(beacon->head, params.head, params.head_len); beacon->head_len = params.head_len; beacon->tail = os_malloc(params.tail_len); if (!beacon->tail) goto free_beacon; os_memcpy(beacon->tail, params.tail, params.tail_len); beacon->tail_len = params.tail_len; if (params.proberesp != NULL) { beacon->probe_resp = os_malloc(params.proberesp_len); if (!beacon->probe_resp) goto free_beacon; os_memcpy(beacon->probe_resp, params.proberesp, params.proberesp_len); beacon->probe_resp_len = params.proberesp_len; } /* copy the extra ies */ if (beacon_extra) { beacon->beacon_ies = os_malloc(wpabuf_len(beacon_extra)); if (!beacon->beacon_ies) goto free_beacon; os_memcpy(beacon->beacon_ies, beacon_extra->buf, wpabuf_len(beacon_extra)); beacon->beacon_ies_len = wpabuf_len(beacon_extra); } if (proberesp_extra) { beacon->proberesp_ies = os_malloc(wpabuf_len(proberesp_extra)); if (!beacon->proberesp_ies) goto free_beacon; os_memcpy(beacon->proberesp_ies, proberesp_extra->buf, wpabuf_len(proberesp_extra)); beacon->proberesp_ies_len = wpabuf_len(proberesp_extra); } if (assocresp_extra) { beacon->assocresp_ies = os_malloc(wpabuf_len(assocresp_extra)); if (!beacon->assocresp_ies) goto free_beacon; os_memcpy(beacon->assocresp_ies, assocresp_extra->buf, wpabuf_len(assocresp_extra)); beacon->assocresp_ies_len = wpabuf_len(assocresp_extra); } ret = 0; free_beacon: /* if the function fails, the caller should not free beacon data */ if (ret) free_beacon_data(beacon); free_ap_extra_ies: hostapd_free_ap_extra_ies(hapd, beacon_extra, proberesp_extra, assocresp_extra); free_ap_params: ieee802_11_free_ap_params(&params); return ret; } /* * TODO: This flow currently supports only changing channel and width within * the same hw_mode. Any other changes to MAC parameters or provided settings * are not supported. */ static int hostapd_change_config_freq(struct hostapd_data *hapd, struct hostapd_config *conf, struct hostapd_freq_params *params, struct hostapd_freq_params *old_params) { int channel; if (!params->channel) { /* check if the new channel is supported by hw */ params->channel = hostapd_hw_get_channel(hapd, params->freq); } channel = params->channel; if (!channel) return -1; /* if a pointer to old_params is provided we save previous state */ if (old_params && hostapd_set_freq_params(old_params, conf->hw_mode, hostapd_hw_get_freq(hapd, conf->channel), conf->channel, conf->ieee80211n, conf->ieee80211ac, conf->secondary_channel, conf->vht_oper_chwidth, conf->vht_oper_centr_freq_seg0_idx, conf->vht_oper_centr_freq_seg1_idx, conf->vht_capab)) return -1; switch (params->bandwidth) { case 0: case 20: case 40: conf->vht_oper_chwidth = VHT_CHANWIDTH_USE_HT; break; case 80: if (params->center_freq2) conf->vht_oper_chwidth = VHT_CHANWIDTH_80P80MHZ; else conf->vht_oper_chwidth = VHT_CHANWIDTH_80MHZ; break; case 160: conf->vht_oper_chwidth = VHT_CHANWIDTH_160MHZ; break; default: return -1; } conf->channel = channel; conf->ieee80211n = params->ht_enabled; conf->secondary_channel = params->sec_channel_offset; ieee80211_freq_to_chan(params->center_freq1, &conf->vht_oper_centr_freq_seg0_idx); ieee80211_freq_to_chan(params->center_freq2, &conf->vht_oper_centr_freq_seg1_idx); /* TODO: maybe call here hostapd_config_check here? */ return 0; } static int hostapd_fill_csa_settings(struct hostapd_data *hapd, struct csa_settings *settings) { struct hostapd_iface *iface = hapd->iface; struct hostapd_freq_params old_freq; int ret; u8 chan, vht_bandwidth; os_memset(&old_freq, 0, sizeof(old_freq)); if (!iface || !iface->freq || hapd->csa_in_progress) return -1; switch (settings->freq_params.bandwidth) { case 80: if (settings->freq_params.center_freq2) vht_bandwidth = VHT_CHANWIDTH_80P80MHZ; else vht_bandwidth = VHT_CHANWIDTH_80MHZ; break; case 160: vht_bandwidth = VHT_CHANWIDTH_160MHZ; break; default: vht_bandwidth = VHT_CHANWIDTH_USE_HT; break; } if (ieee80211_freq_to_channel_ext( settings->freq_params.freq, settings->freq_params.sec_channel_offset, vht_bandwidth, &hapd->iface->cs_oper_class, &chan) == NUM_HOSTAPD_MODES) { wpa_printf(MSG_DEBUG, "invalid frequency for channel switch (freq=%d, sec_channel_offset=%d, vht_enabled=%d)", settings->freq_params.freq, settings->freq_params.sec_channel_offset, settings->freq_params.vht_enabled); return -1; } settings->freq_params.channel = chan; ret = hostapd_change_config_freq(iface->bss[0], iface->conf, &settings->freq_params, &old_freq); if (ret) return ret; ret = hostapd_build_beacon_data(hapd, &settings->beacon_after); /* change back the configuration */ hostapd_change_config_freq(iface->bss[0], iface->conf, &old_freq, NULL); if (ret) return ret; /* set channel switch parameters for csa ie */ hapd->cs_freq_params = settings->freq_params; hapd->cs_count = settings->cs_count; hapd->cs_block_tx = settings->block_tx; ret = hostapd_build_beacon_data(hapd, &settings->beacon_csa); if (ret) { free_beacon_data(&settings->beacon_after); return ret; } settings->counter_offset_beacon[0] = hapd->cs_c_off_beacon; settings->counter_offset_presp[0] = hapd->cs_c_off_proberesp; settings->counter_offset_beacon[1] = hapd->cs_c_off_ecsa_beacon; settings->counter_offset_presp[1] = hapd->cs_c_off_ecsa_proberesp; return 0; } void hostapd_cleanup_cs_params(struct hostapd_data *hapd) { os_memset(&hapd->cs_freq_params, 0, sizeof(hapd->cs_freq_params)); hapd->cs_count = 0; hapd->cs_block_tx = 0; hapd->cs_c_off_beacon = 0; hapd->cs_c_off_proberesp = 0; hapd->csa_in_progress = 0; hapd->cs_c_off_ecsa_beacon = 0; hapd->cs_c_off_ecsa_proberesp = 0; } int hostapd_switch_channel(struct hostapd_data *hapd, struct csa_settings *settings) { int ret; if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA)) { wpa_printf(MSG_INFO, "CSA is not supported"); return -1; } ret = hostapd_fill_csa_settings(hapd, settings); if (ret) return ret; ret = hostapd_drv_switch_channel(hapd, settings); free_beacon_data(&settings->beacon_csa); free_beacon_data(&settings->beacon_after); if (ret) { /* if we failed, clean cs parameters */ hostapd_cleanup_cs_params(hapd); return ret; } hapd->csa_in_progress = 1; return 0; } void hostapd_switch_channel_fallback(struct hostapd_iface *iface, const struct hostapd_freq_params *freq_params) { int vht_seg0_idx = 0, vht_seg1_idx = 0, vht_bw = VHT_CHANWIDTH_USE_HT; unsigned int i; wpa_printf(MSG_DEBUG, "Restarting all CSA-related BSSes"); if (freq_params->center_freq1) vht_seg0_idx = 36 + (freq_params->center_freq1 - 5180) / 5; if (freq_params->center_freq2) vht_seg1_idx = 36 + (freq_params->center_freq2 - 5180) / 5; switch (freq_params->bandwidth) { case 0: case 20: case 40: vht_bw = VHT_CHANWIDTH_USE_HT; break; case 80: if (freq_params->center_freq2) vht_bw = VHT_CHANWIDTH_80P80MHZ; else vht_bw = VHT_CHANWIDTH_80MHZ; break; case 160: vht_bw = VHT_CHANWIDTH_160MHZ; break; default: wpa_printf(MSG_WARNING, "Unknown CSA bandwidth: %d", freq_params->bandwidth); break; } iface->freq = freq_params->freq; iface->conf->channel = freq_params->channel; iface->conf->secondary_channel = freq_params->sec_channel_offset; iface->conf->vht_oper_centr_freq_seg0_idx = vht_seg0_idx; iface->conf->vht_oper_centr_freq_seg1_idx = vht_seg1_idx; iface->conf->vht_oper_chwidth = vht_bw; iface->conf->ieee80211n = freq_params->ht_enabled; iface->conf->ieee80211ac = freq_params->vht_enabled; /* * cs_params must not be cleared earlier because the freq_params * argument may actually point to one of these. */ for (i = 0; i < iface->num_bss; i++) hostapd_cleanup_cs_params(iface->bss[i]); hostapd_disable_iface(iface); hostapd_enable_iface(iface); } #endif /* NEED_AP_MLME */ struct hostapd_data * hostapd_get_iface(struct hapd_interfaces *interfaces, const char *ifname) { size_t i, j; for (i = 0; i < interfaces->count; i++) { struct hostapd_iface *iface = interfaces->iface[i]; for (j = 0; j < iface->num_bss; j++) { struct hostapd_data *hapd = iface->bss[j]; if (os_strcmp(ifname, hapd->conf->iface) == 0) return hapd; } } return NULL; } void hostapd_periodic_iface(struct hostapd_iface *iface) { size_t i; ap_list_timer(iface); for (i = 0; i < iface->num_bss; i++) { struct hostapd_data *hapd = iface->bss[i]; if (!hapd->started) continue; #ifndef CONFIG_NO_RADIUS hostapd_acl_expire(hapd); #endif /* CONFIG_NO_RADIUS */ } }
Java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__int_listen_socket_postdec_45.c Label Definition File: CWE191_Integer_Underflow__int.label.xml Template File: sources-sinks-45.tmpl.c */ /* * @description * CWE: 191 Integer Underflow * BadSource: listen_socket Read data using a listen socket (server side) * GoodSource: Set data to a small, non-zero number (negative two) * Sinks: decrement * GoodSink: Ensure there will not be an underflow before decrementing data * BadSink : Decrement data, which can cause an Underflow * Flow Variant: 45 Data flow: data passed as a static global variable from one function to another in the same source file * * */ #include "std_testcase.h" #ifdef _WIN32 #include <winsock2.h> #include <windows.h> #include <direct.h> #pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */ #define CLOSE_SOCKET closesocket #else #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define CLOSE_SOCKET close #define SOCKET int #endif #define TCP_PORT 27015 #define LISTEN_BACKLOG 5 #define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2) static int CWE191_Integer_Underflow__int_listen_socket_postdec_45_badData; static int CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodG2BData; static int CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodB2GData; #ifndef OMITBAD static void badSink() { int data = CWE191_Integer_Underflow__int_listen_socket_postdec_45_badData; { /* POTENTIAL FLAW: Decrementing data could cause an underflow */ data--; int result = data; printIntLine(result); } } void CWE191_Integer_Underflow__int_listen_socket_postdec_45_bad() { int data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE191_Integer_Underflow__int_listen_socket_postdec_45_badData = data; badSink(); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() uses the GoodSource with the BadSink */ static void goodG2BSink() { int data = CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodG2BData; { /* POTENTIAL FLAW: Decrementing data could cause an underflow */ data--; int result = data; printIntLine(result); } } static void goodG2B() { int data; /* Initialize data */ data = 0; /* FIX: Use a small, non-zero value that will not cause an integer underflow in the sinks */ data = -2; CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodG2BData = data; goodG2BSink(); } /* goodB2G() uses the BadSource with the GoodSink */ static void goodB2GSink() { int data = CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodB2GData; /* FIX: Add a check to prevent an underflow from occurring */ if (data > INT_MIN) { data--; int result = data; printIntLine(result); } else { printLine("data value is too large to perform arithmetic safely."); } } static void goodB2G() { int data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodB2GData = data; goodB2GSink(); } void CWE191_Integer_Underflow__int_listen_socket_postdec_45_good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE191_Integer_Underflow__int_listen_socket_postdec_45_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE191_Integer_Underflow__int_listen_socket_postdec_45_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
Java
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //------------------------------------------------------------------------------ // Description of the life cycle of a instance of MetricsService. // // OVERVIEW // // A MetricsService instance is typically created at application startup. It is // the central controller for the acquisition of log data, and the automatic // transmission of that log data to an external server. Its major job is to // manage logs, grouping them for transmission, and transmitting them. As part // of its grouping, MS finalizes logs by including some just-in-time gathered // memory statistics, snapshotting the current stats of numerous histograms, // closing the logs, translating to protocol buffer format, and compressing the // results for transmission. Transmission includes submitting a compressed log // as data in a URL-post, and retransmitting (or retaining at process // termination) if the attempted transmission failed. Retention across process // terminations is done using the the PrefServices facilities. The retained logs // (the ones that never got transmitted) are compressed and base64-encoded // before being persisted. // // Logs fall into one of two categories: "initial logs," and "ongoing logs." // There is at most one initial log sent for each complete run of Chrome (from // startup, to browser shutdown). An initial log is generally transmitted some // short time (1 minute?) after startup, and includes stats such as recent crash // info, the number and types of plugins, etc. The external server's response // to the initial log conceptually tells this MS if it should continue // transmitting logs (during this session). The server response can actually be // much more detailed, and always includes (at a minimum) how often additional // ongoing logs should be sent. // // After the above initial log, a series of ongoing logs will be transmitted. // The first ongoing log actually begins to accumulate information stating when // the MS was first constructed. Note that even though the initial log is // commonly sent a full minute after startup, the initial log does not include // much in the way of user stats. The most common interlog period (delay) // is 30 minutes. That time period starts when the first user action causes a // logging event. This means that if there is no user action, there may be long // periods without any (ongoing) log transmissions. Ongoing logs typically // contain very detailed records of user activities (ex: opened tab, closed // tab, fetched URL, maximized window, etc.) In addition, just before an // ongoing log is closed out, a call is made to gather memory statistics. Those // memory statistics are deposited into a histogram, and the log finalization // code is then called. In the finalization, a call to a Histogram server // acquires a list of all local histograms that have been flagged for upload // to the UMA server. The finalization also acquires the most recent number // of page loads, along with any counts of renderer or plugin crashes. // // When the browser shuts down, there will typically be a fragment of an ongoing // log that has not yet been transmitted. At shutdown time, that fragment is // closed (including snapshotting histograms), and persisted, for potential // transmission during a future run of the product. // // There are two slightly abnormal shutdown conditions. There is a // "disconnected scenario," and a "really fast startup and shutdown" scenario. // In the "never connected" situation, the user has (during the running of the // process) never established an internet connection. As a result, attempts to // transmit the initial log have failed, and a lot(?) of data has accumulated in // the ongoing log (which didn't yet get closed, because there was never even a // contemplation of sending it). There is also a kindred "lost connection" // situation, where a loss of connection prevented an ongoing log from being // transmitted, and a (still open) log was stuck accumulating a lot(?) of data, // while the earlier log retried its transmission. In both of these // disconnected situations, two logs need to be, and are, persistently stored // for future transmission. // // The other unusual shutdown condition, termed "really fast startup and // shutdown," involves the deliberate user termination of the process before // the initial log is even formed or transmitted. In that situation, no logging // is done, but the historical crash statistics remain (unlogged) for inclusion // in a future run's initial log. (i.e., we don't lose crash stats). // // With the above overview, we can now describe the state machine's various // states, based on the State enum specified in the state_ member. Those states // are: // // INITIALIZED, // Constructor was called. // INIT_TASK_SCHEDULED, // Waiting for deferred init tasks to finish. // INIT_TASK_DONE, // Waiting for timer to send initial log. // SENDING_LOGS, // Sending logs and creating new ones when we run out. // // In more detail, we have: // // INITIALIZED, // Constructor was called. // The MS has been constructed, but has taken no actions to compose the // initial log. // // INIT_TASK_SCHEDULED, // Waiting for deferred init tasks to finish. // Typically about 30 seconds after startup, a task is sent to a second thread // (the file thread) to perform deferred (lower priority and slower) // initialization steps such as getting the list of plugins. That task will // (when complete) make an async callback (via a Task) to indicate the // completion. // // INIT_TASK_DONE, // Waiting for timer to send initial log. // The callback has arrived, and it is now possible for an initial log to be // created. This callback typically arrives back less than one second after // the deferred init task is dispatched. // // SENDING_LOGS, // Sending logs an creating new ones when we run out. // Logs from previous sessions have been loaded, and initial logs have been // created (an optional stability log and the first metrics log). We will // send all of these logs, and when run out, we will start cutting new logs // to send. We will also cut a new log if we expect a shutdown. // // The progression through the above states is simple, and sequential. // States proceed from INITIAL to SENDING_LOGS, and remain in the latter until // shutdown. // // Also note that whenever we successfully send a log, we mirror the list // of logs into the PrefService. This ensures that IF we crash, we won't start // up and retransmit our old logs again. // // Due to race conditions, it is always possible that a log file could be sent // twice. For example, if a log file is sent, but not yet acknowledged by // the external server, and the user shuts down, then a copy of the log may be // saved for re-transmission. These duplicates could be filtered out server // side, but are not expected to be a significant problem. // // //------------------------------------------------------------------------------ #include "components/metrics/metrics_service.h" #include <algorithm> #include "base/bind.h" #include "base/callback.h" #include "base/metrics/histogram.h" #include "base/metrics/histogram_base.h" #include "base/metrics/histogram_samples.h" #include "base/metrics/sparse_histogram.h" #include "base/metrics/statistics_recorder.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/threading/platform_thread.h" #include "base/threading/thread.h" #include "base/threading/thread_restrictions.h" #include "base/time/time.h" #include "base/tracked_objects.h" #include "base/values.h" #include "components/metrics/metrics_log.h" #include "components/metrics/metrics_log_manager.h" #include "components/metrics/metrics_log_uploader.h" #include "components/metrics/metrics_pref_names.h" #include "components/metrics/metrics_reporting_scheduler.h" #include "components/metrics/metrics_service_client.h" #include "components/metrics/metrics_state_manager.h" #include "components/variations/entropy_provider.h" namespace metrics { namespace { // Check to see that we're being called on only one thread. bool IsSingleThreaded() { static base::PlatformThreadId thread_id = 0; if (!thread_id) thread_id = base::PlatformThread::CurrentId(); return base::PlatformThread::CurrentId() == thread_id; } // The delay, in seconds, after starting recording before doing expensive // initialization work. #if defined(OS_ANDROID) || defined(OS_IOS) // On mobile devices, a significant portion of sessions last less than a minute. // Use a shorter timer on these platforms to avoid losing data. // TODO(dfalcantara): To avoid delaying startup, tighten up initialization so // that it occurs after the user gets their initial page. const int kInitializationDelaySeconds = 5; #else const int kInitializationDelaySeconds = 30; #endif // The maximum number of events in a log uploaded to the UMA server. const int kEventLimit = 2400; // If an upload fails, and the transmission was over this byte count, then we // will discard the log, and not try to retransmit it. We also don't persist // the log to the prefs for transmission during the next chrome session if this // limit is exceeded. const size_t kUploadLogAvoidRetransmitSize = 100 * 1024; // Interval, in minutes, between state saves. const int kSaveStateIntervalMinutes = 5; enum ResponseStatus { UNKNOWN_FAILURE, SUCCESS, BAD_REQUEST, // Invalid syntax or log too large. NO_RESPONSE, NUM_RESPONSE_STATUSES }; ResponseStatus ResponseCodeToStatus(int response_code) { switch (response_code) { case -1: return NO_RESPONSE; case 200: return SUCCESS; case 400: return BAD_REQUEST; default: return UNKNOWN_FAILURE; } } #if defined(OS_ANDROID) || defined(OS_IOS) void MarkAppCleanShutdownAndCommit(CleanExitBeacon* clean_exit_beacon, PrefService* local_state) { clean_exit_beacon->WriteBeaconValue(true); local_state->SetInteger(prefs::kStabilityExecutionPhase, MetricsService::SHUTDOWN_COMPLETE); // Start writing right away (write happens on a different thread). local_state->CommitPendingWrite(); } #endif // defined(OS_ANDROID) || defined(OS_IOS) } // namespace SyntheticTrialGroup::SyntheticTrialGroup(uint32 trial, uint32 group) { id.name = trial; id.group = group; } SyntheticTrialGroup::~SyntheticTrialGroup() { } // static MetricsService::ShutdownCleanliness MetricsService::clean_shutdown_status_ = MetricsService::CLEANLY_SHUTDOWN; MetricsService::ExecutionPhase MetricsService::execution_phase_ = MetricsService::UNINITIALIZED_PHASE; // static void MetricsService::RegisterPrefs(PrefRegistrySimple* registry) { DCHECK(IsSingleThreaded()); MetricsStateManager::RegisterPrefs(registry); MetricsLog::RegisterPrefs(registry); registry->RegisterInt64Pref(prefs::kInstallDate, 0); registry->RegisterInt64Pref(prefs::kStabilityLaunchTimeSec, 0); registry->RegisterInt64Pref(prefs::kStabilityLastTimestampSec, 0); registry->RegisterStringPref(prefs::kStabilityStatsVersion, std::string()); registry->RegisterInt64Pref(prefs::kStabilityStatsBuildTime, 0); registry->RegisterBooleanPref(prefs::kStabilityExitedCleanly, true); registry->RegisterIntegerPref(prefs::kStabilityExecutionPhase, UNINITIALIZED_PHASE); registry->RegisterBooleanPref(prefs::kStabilitySessionEndCompleted, true); registry->RegisterIntegerPref(prefs::kMetricsSessionID, -1); registry->RegisterListPref(prefs::kMetricsInitialLogs); registry->RegisterListPref(prefs::kMetricsOngoingLogs); registry->RegisterInt64Pref(prefs::kUninstallLaunchCount, 0); registry->RegisterInt64Pref(prefs::kUninstallMetricsUptimeSec, 0); } MetricsService::MetricsService(MetricsStateManager* state_manager, MetricsServiceClient* client, PrefService* local_state) : log_manager_(local_state, kUploadLogAvoidRetransmitSize), histogram_snapshot_manager_(this), state_manager_(state_manager), client_(client), local_state_(local_state), clean_exit_beacon_(client->GetRegistryBackupKey(), local_state), recording_active_(false), reporting_active_(false), test_mode_active_(false), state_(INITIALIZED), log_upload_in_progress_(false), idle_since_last_transmission_(false), session_id_(-1), self_ptr_factory_(this), state_saver_factory_(this) { DCHECK(IsSingleThreaded()); DCHECK(state_manager_); DCHECK(client_); DCHECK(local_state_); // Set the install date if this is our first run. int64 install_date = local_state_->GetInt64(prefs::kInstallDate); if (install_date == 0) local_state_->SetInt64(prefs::kInstallDate, base::Time::Now().ToTimeT()); } MetricsService::~MetricsService() { DisableRecording(); } void MetricsService::InitializeMetricsRecordingState() { InitializeMetricsState(); base::Closure upload_callback = base::Bind(&MetricsService::StartScheduledUpload, self_ptr_factory_.GetWeakPtr()); scheduler_.reset( new MetricsReportingScheduler( upload_callback, // MetricsServiceClient outlives MetricsService, and // MetricsReportingScheduler is tied to the lifetime of |this|. base::Bind(&MetricsServiceClient::GetStandardUploadInterval, base::Unretained(client_)))); } void MetricsService::Start() { HandleIdleSinceLastTransmission(false); EnableRecording(); EnableReporting(); } bool MetricsService::StartIfMetricsReportingEnabled() { const bool enabled = state_manager_->IsMetricsReportingEnabled(); if (enabled) Start(); return enabled; } void MetricsService::StartRecordingForTests() { test_mode_active_ = true; EnableRecording(); DisableReporting(); } void MetricsService::Stop() { HandleIdleSinceLastTransmission(false); DisableReporting(); DisableRecording(); } void MetricsService::EnableReporting() { if (reporting_active_) return; reporting_active_ = true; StartSchedulerIfNecessary(); } void MetricsService::DisableReporting() { reporting_active_ = false; } std::string MetricsService::GetClientId() { return state_manager_->client_id(); } int64 MetricsService::GetInstallDate() { return local_state_->GetInt64(prefs::kInstallDate); } int64 MetricsService::GetMetricsReportingEnabledDate() { return local_state_->GetInt64(prefs::kMetricsReportingEnabledTimestamp); } scoped_ptr<const base::FieldTrial::EntropyProvider> MetricsService::CreateEntropyProvider() { // TODO(asvitkine): Refactor the code so that MetricsService does not expose // this method. return state_manager_->CreateEntropyProvider(); } void MetricsService::EnableRecording() { DCHECK(IsSingleThreaded()); if (recording_active_) return; recording_active_ = true; state_manager_->ForceClientIdCreation(); client_->SetMetricsClientId(state_manager_->client_id()); if (!log_manager_.current_log()) OpenNewLog(); for (size_t i = 0; i < metrics_providers_.size(); ++i) metrics_providers_[i]->OnRecordingEnabled(); base::RemoveActionCallback(action_callback_); action_callback_ = base::Bind(&MetricsService::OnUserAction, base::Unretained(this)); base::AddActionCallback(action_callback_); } void MetricsService::DisableRecording() { DCHECK(IsSingleThreaded()); if (!recording_active_) return; recording_active_ = false; client_->OnRecordingDisabled(); base::RemoveActionCallback(action_callback_); for (size_t i = 0; i < metrics_providers_.size(); ++i) metrics_providers_[i]->OnRecordingDisabled(); PushPendingLogsToPersistentStorage(); } bool MetricsService::recording_active() const { DCHECK(IsSingleThreaded()); return recording_active_; } bool MetricsService::reporting_active() const { DCHECK(IsSingleThreaded()); return reporting_active_; } void MetricsService::RecordDelta(const base::HistogramBase& histogram, const base::HistogramSamples& snapshot) { log_manager_.current_log()->RecordHistogramDelta(histogram.histogram_name(), snapshot); } void MetricsService::InconsistencyDetected( base::HistogramBase::Inconsistency problem) { UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowser", problem, base::HistogramBase::NEVER_EXCEEDED_VALUE); } void MetricsService::UniqueInconsistencyDetected( base::HistogramBase::Inconsistency problem) { UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique", problem, base::HistogramBase::NEVER_EXCEEDED_VALUE); } void MetricsService::InconsistencyDetectedInLoggedCount(int amount) { UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser", std::abs(amount)); } void MetricsService::HandleIdleSinceLastTransmission(bool in_idle) { // If there wasn't a lot of action, maybe the computer was asleep, in which // case, the log transmissions should have stopped. Here we start them up // again. if (!in_idle && idle_since_last_transmission_) StartSchedulerIfNecessary(); idle_since_last_transmission_ = in_idle; } void MetricsService::OnApplicationNotIdle() { if (recording_active_) HandleIdleSinceLastTransmission(false); } void MetricsService::RecordStartOfSessionEnd() { LogCleanShutdown(); RecordBooleanPrefValue(prefs::kStabilitySessionEndCompleted, false); } void MetricsService::RecordCompletedSessionEnd() { LogCleanShutdown(); RecordBooleanPrefValue(prefs::kStabilitySessionEndCompleted, true); } #if defined(OS_ANDROID) || defined(OS_IOS) void MetricsService::OnAppEnterBackground() { scheduler_->Stop(); MarkAppCleanShutdownAndCommit(&clean_exit_beacon_, local_state_); // At this point, there's no way of knowing when the process will be // killed, so this has to be treated similar to a shutdown, closing and // persisting all logs. Unlinke a shutdown, the state is primed to be ready // to continue logging and uploading if the process does return. if (recording_active() && state_ >= SENDING_LOGS) { PushPendingLogsToPersistentStorage(); // Persisting logs closes the current log, so start recording a new log // immediately to capture any background work that might be done before the // process is killed. OpenNewLog(); } } void MetricsService::OnAppEnterForeground() { clean_exit_beacon_.WriteBeaconValue(false); StartSchedulerIfNecessary(); } #else void MetricsService::LogNeedForCleanShutdown() { clean_exit_beacon_.WriteBeaconValue(false); // Redundant setting to be sure we call for a clean shutdown. clean_shutdown_status_ = NEED_TO_SHUTDOWN; } #endif // defined(OS_ANDROID) || defined(OS_IOS) // static void MetricsService::SetExecutionPhase(ExecutionPhase execution_phase, PrefService* local_state) { execution_phase_ = execution_phase; local_state->SetInteger(prefs::kStabilityExecutionPhase, execution_phase_); } void MetricsService::RecordBreakpadRegistration(bool success) { if (!success) IncrementPrefValue(prefs::kStabilityBreakpadRegistrationFail); else IncrementPrefValue(prefs::kStabilityBreakpadRegistrationSuccess); } void MetricsService::RecordBreakpadHasDebugger(bool has_debugger) { if (!has_debugger) IncrementPrefValue(prefs::kStabilityDebuggerNotPresent); else IncrementPrefValue(prefs::kStabilityDebuggerPresent); } void MetricsService::ClearSavedStabilityMetrics() { for (size_t i = 0; i < metrics_providers_.size(); ++i) metrics_providers_[i]->ClearSavedStabilityMetrics(); // Reset the prefs that are managed by MetricsService/MetricsLog directly. local_state_->SetInteger(prefs::kStabilityCrashCount, 0); local_state_->SetInteger(prefs::kStabilityExecutionPhase, UNINITIALIZED_PHASE); local_state_->SetInteger(prefs::kStabilityIncompleteSessionEndCount, 0); local_state_->SetInteger(prefs::kStabilityLaunchCount, 0); local_state_->SetBoolean(prefs::kStabilitySessionEndCompleted, true); } void MetricsService::PushExternalLog(const std::string& log) { log_manager_.StoreLog(log, MetricsLog::ONGOING_LOG); } //------------------------------------------------------------------------------ // private methods //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Initialization methods void MetricsService::InitializeMetricsState() { const int64 buildtime = MetricsLog::GetBuildTime(); const std::string version = client_->GetVersionString(); bool version_changed = false; if (local_state_->GetInt64(prefs::kStabilityStatsBuildTime) != buildtime || local_state_->GetString(prefs::kStabilityStatsVersion) != version) { local_state_->SetString(prefs::kStabilityStatsVersion, version); local_state_->SetInt64(prefs::kStabilityStatsBuildTime, buildtime); version_changed = true; } log_manager_.LoadPersistedUnsentLogs(); session_id_ = local_state_->GetInteger(prefs::kMetricsSessionID); if (!clean_exit_beacon_.exited_cleanly()) { IncrementPrefValue(prefs::kStabilityCrashCount); // Reset flag, and wait until we call LogNeedForCleanShutdown() before // monitoring. clean_exit_beacon_.WriteBeaconValue(true); } bool has_initial_stability_log = false; if (!clean_exit_beacon_.exited_cleanly() || ProvidersHaveStabilityMetrics()) { // TODO(rtenneti): On windows, consider saving/getting execution_phase from // the registry. int execution_phase = local_state_->GetInteger(prefs::kStabilityExecutionPhase); UMA_HISTOGRAM_SPARSE_SLOWLY("Chrome.Browser.CrashedExecutionPhase", execution_phase); // If the previous session didn't exit cleanly, or if any provider // explicitly requests it, prepare an initial stability log - // provided UMA is enabled. if (state_manager_->IsMetricsReportingEnabled()) has_initial_stability_log = PrepareInitialStabilityLog(); } // If no initial stability log was generated and there was a version upgrade, // clear the stability stats from the previous version (so that they don't get // attributed to the current version). This could otherwise happen due to a // number of different edge cases, such as if the last version crashed before // it could save off a system profile or if UMA reporting is disabled (which // normally results in stats being accumulated). if (!has_initial_stability_log && version_changed) ClearSavedStabilityMetrics(); // Update session ID. ++session_id_; local_state_->SetInteger(prefs::kMetricsSessionID, session_id_); // Stability bookkeeping IncrementPrefValue(prefs::kStabilityLaunchCount); DCHECK_EQ(UNINITIALIZED_PHASE, execution_phase_); SetExecutionPhase(START_METRICS_RECORDING, local_state_); if (!local_state_->GetBoolean(prefs::kStabilitySessionEndCompleted)) { IncrementPrefValue(prefs::kStabilityIncompleteSessionEndCount); // This is marked false when we get a WM_ENDSESSION. local_state_->SetBoolean(prefs::kStabilitySessionEndCompleted, true); } // Call GetUptimes() for the first time, thus allowing all later calls // to record incremental uptimes accurately. base::TimeDelta ignored_uptime_parameter; base::TimeDelta startup_uptime; GetUptimes(local_state_, &startup_uptime, &ignored_uptime_parameter); DCHECK_EQ(0, startup_uptime.InMicroseconds()); // For backwards compatibility, leave this intact in case Omaha is checking // them. prefs::kStabilityLastTimestampSec may also be useless now. // TODO(jar): Delete these if they have no uses. local_state_->SetInt64(prefs::kStabilityLaunchTimeSec, base::Time::Now().ToTimeT()); // Bookkeeping for the uninstall metrics. IncrementLongPrefsValue(prefs::kUninstallLaunchCount); // Kick off the process of saving the state (so the uptime numbers keep // getting updated) every n minutes. ScheduleNextStateSave(); } void MetricsService::OnUserAction(const std::string& action) { if (!ShouldLogEvents()) return; log_manager_.current_log()->RecordUserAction(action); HandleIdleSinceLastTransmission(false); } void MetricsService::FinishedGatheringInitialMetrics() { DCHECK_EQ(INIT_TASK_SCHEDULED, state_); state_ = INIT_TASK_DONE; // Create the initial log. if (!initial_metrics_log_.get()) { initial_metrics_log_ = CreateLog(MetricsLog::ONGOING_LOG); NotifyOnDidCreateMetricsLog(); } scheduler_->InitTaskComplete(); } void MetricsService::GetUptimes(PrefService* pref, base::TimeDelta* incremental_uptime, base::TimeDelta* uptime) { base::TimeTicks now = base::TimeTicks::Now(); // If this is the first call, init |first_updated_time_| and // |last_updated_time_|. if (last_updated_time_.is_null()) { first_updated_time_ = now; last_updated_time_ = now; } *incremental_uptime = now - last_updated_time_; *uptime = now - first_updated_time_; last_updated_time_ = now; const int64 incremental_time_secs = incremental_uptime->InSeconds(); if (incremental_time_secs > 0) { int64 metrics_uptime = pref->GetInt64(prefs::kUninstallMetricsUptimeSec); metrics_uptime += incremental_time_secs; pref->SetInt64(prefs::kUninstallMetricsUptimeSec, metrics_uptime); } } void MetricsService::NotifyOnDidCreateMetricsLog() { DCHECK(IsSingleThreaded()); for (size_t i = 0; i < metrics_providers_.size(); ++i) metrics_providers_[i]->OnDidCreateMetricsLog(); } //------------------------------------------------------------------------------ // State save methods void MetricsService::ScheduleNextStateSave() { state_saver_factory_.InvalidateWeakPtrs(); base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&MetricsService::SaveLocalState, state_saver_factory_.GetWeakPtr()), base::TimeDelta::FromMinutes(kSaveStateIntervalMinutes)); } void MetricsService::SaveLocalState() { RecordCurrentState(local_state_); // TODO(jar):110021 Does this run down the batteries???? ScheduleNextStateSave(); } //------------------------------------------------------------------------------ // Recording control methods void MetricsService::OpenNewLog() { DCHECK(!log_manager_.current_log()); log_manager_.BeginLoggingWithLog(CreateLog(MetricsLog::ONGOING_LOG)); NotifyOnDidCreateMetricsLog(); if (state_ == INITIALIZED) { // We only need to schedule that run once. state_ = INIT_TASK_SCHEDULED; base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&MetricsService::StartGatheringMetrics, self_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromSeconds(kInitializationDelaySeconds)); } } void MetricsService::StartGatheringMetrics() { client_->StartGatheringMetrics( base::Bind(&MetricsService::FinishedGatheringInitialMetrics, self_ptr_factory_.GetWeakPtr())); } void MetricsService::CloseCurrentLog() { if (!log_manager_.current_log()) return; // TODO(jar): Integrate bounds on log recording more consistently, so that we // can stop recording logs that are too big much sooner. if (log_manager_.current_log()->num_events() > kEventLimit) { UMA_HISTOGRAM_COUNTS("UMA.Discarded Log Events", log_manager_.current_log()->num_events()); log_manager_.DiscardCurrentLog(); OpenNewLog(); // Start trivial log to hold our histograms. } // Put incremental data (histogram deltas, and realtime stats deltas) at the // end of all log transmissions (initial log handles this separately). // RecordIncrementalStabilityElements only exists on the derived // MetricsLog class. MetricsLog* current_log = log_manager_.current_log(); DCHECK(current_log); RecordCurrentEnvironment(current_log); base::TimeDelta incremental_uptime; base::TimeDelta uptime; GetUptimes(local_state_, &incremental_uptime, &uptime); current_log->RecordStabilityMetrics(metrics_providers_.get(), incremental_uptime, uptime); current_log->RecordGeneralMetrics(metrics_providers_.get()); RecordCurrentHistograms(); log_manager_.FinishCurrentLog(); } void MetricsService::PushPendingLogsToPersistentStorage() { if (state_ < SENDING_LOGS) return; // We didn't and still don't have time to get plugin list etc. CloseCurrentLog(); log_manager_.PersistUnsentLogs(); } //------------------------------------------------------------------------------ // Transmission of logs methods void MetricsService::StartSchedulerIfNecessary() { // Never schedule cutting or uploading of logs in test mode. if (test_mode_active_) return; // Even if reporting is disabled, the scheduler is needed to trigger the // creation of the initial log, which must be done in order for any logs to be // persisted on shutdown or backgrounding. if (recording_active() && (reporting_active() || state_ < SENDING_LOGS)) { scheduler_->Start(); } } void MetricsService::StartScheduledUpload() { DCHECK(state_ >= INIT_TASK_DONE); // If we're getting no notifications, then the log won't have much in it, and // it's possible the computer is about to go to sleep, so don't upload and // stop the scheduler. // If recording has been turned off, the scheduler doesn't need to run. // If reporting is off, proceed if the initial log hasn't been created, since // that has to happen in order for logs to be cut and stored when persisting. // TODO(stuartmorgan): Call Stop() on the scheduler when reporting and/or // recording are turned off instead of letting it fire and then aborting. if (idle_since_last_transmission_ || !recording_active() || (!reporting_active() && state_ >= SENDING_LOGS)) { scheduler_->Stop(); scheduler_->UploadCancelled(); return; } // If there are unsent logs, send the next one. If not, start the asynchronous // process of finalizing the current log for upload. if (state_ == SENDING_LOGS && log_manager_.has_unsent_logs()) { SendNextLog(); } else { // There are no logs left to send, so start creating a new one. client_->CollectFinalMetrics( base::Bind(&MetricsService::OnFinalLogInfoCollectionDone, self_ptr_factory_.GetWeakPtr())); } } void MetricsService::OnFinalLogInfoCollectionDone() { // If somehow there is a log upload in progress, we return and hope things // work out. The scheduler isn't informed since if this happens, the scheduler // will get a response from the upload. DCHECK(!log_upload_in_progress_); if (log_upload_in_progress_) return; // Abort if metrics were turned off during the final info gathering. if (!recording_active()) { scheduler_->Stop(); scheduler_->UploadCancelled(); return; } if (state_ == INIT_TASK_DONE) { PrepareInitialMetricsLog(); } else { DCHECK_EQ(SENDING_LOGS, state_); CloseCurrentLog(); OpenNewLog(); } SendNextLog(); } void MetricsService::SendNextLog() { DCHECK_EQ(SENDING_LOGS, state_); if (!reporting_active()) { scheduler_->Stop(); scheduler_->UploadCancelled(); return; } if (!log_manager_.has_unsent_logs()) { // Should only get here if serializing the log failed somehow. // Just tell the scheduler it was uploaded and wait for the next log // interval. scheduler_->UploadFinished(true, log_manager_.has_unsent_logs()); return; } if (!log_manager_.has_staged_log()) log_manager_.StageNextLogForUpload(); SendStagedLog(); } bool MetricsService::ProvidersHaveStabilityMetrics() { // Check whether any metrics provider has stability metrics. for (size_t i = 0; i < metrics_providers_.size(); ++i) { if (metrics_providers_[i]->HasStabilityMetrics()) return true; } return false; } bool MetricsService::PrepareInitialStabilityLog() { DCHECK_EQ(INITIALIZED, state_); scoped_ptr<MetricsLog> initial_stability_log( CreateLog(MetricsLog::INITIAL_STABILITY_LOG)); // Do not call NotifyOnDidCreateMetricsLog here because the stability // log describes stats from the _previous_ session. if (!initial_stability_log->LoadSavedEnvironmentFromPrefs()) return false; log_manager_.PauseCurrentLog(); log_manager_.BeginLoggingWithLog(initial_stability_log.Pass()); // Note: Some stability providers may record stability stats via histograms, // so this call has to be after BeginLoggingWithLog(). log_manager_.current_log()->RecordStabilityMetrics( metrics_providers_.get(), base::TimeDelta(), base::TimeDelta()); RecordCurrentStabilityHistograms(); // Note: RecordGeneralMetrics() intentionally not called since this log is for // stability stats from a previous session only. log_manager_.FinishCurrentLog(); log_manager_.ResumePausedLog(); // Store unsent logs, including the stability log that was just saved, so // that they're not lost in case of a crash before upload time. log_manager_.PersistUnsentLogs(); return true; } void MetricsService::PrepareInitialMetricsLog() { DCHECK_EQ(INIT_TASK_DONE, state_); RecordCurrentEnvironment(initial_metrics_log_.get()); base::TimeDelta incremental_uptime; base::TimeDelta uptime; GetUptimes(local_state_, &incremental_uptime, &uptime); // Histograms only get written to the current log, so make the new log current // before writing them. log_manager_.PauseCurrentLog(); log_manager_.BeginLoggingWithLog(initial_metrics_log_.Pass()); // Note: Some stability providers may record stability stats via histograms, // so this call has to be after BeginLoggingWithLog(). MetricsLog* current_log = log_manager_.current_log(); current_log->RecordStabilityMetrics(metrics_providers_.get(), base::TimeDelta(), base::TimeDelta()); current_log->RecordGeneralMetrics(metrics_providers_.get()); RecordCurrentHistograms(); log_manager_.FinishCurrentLog(); log_manager_.ResumePausedLog(); // Store unsent logs, including the initial log that was just saved, so // that they're not lost in case of a crash before upload time. log_manager_.PersistUnsentLogs(); state_ = SENDING_LOGS; } void MetricsService::SendStagedLog() { DCHECK(log_manager_.has_staged_log()); if (!log_manager_.has_staged_log()) return; DCHECK(!log_upload_in_progress_); log_upload_in_progress_ = true; if (!log_uploader_) { log_uploader_ = client_->CreateUploader( base::Bind(&MetricsService::OnLogUploadComplete, self_ptr_factory_.GetWeakPtr())); } const std::string hash = base::HexEncode(log_manager_.staged_log_hash().data(), log_manager_.staged_log_hash().size()); bool success = log_uploader_->UploadLog(log_manager_.staged_log(), hash); UMA_HISTOGRAM_BOOLEAN("UMA.UploadCreation", success); if (!success) { // Skip this upload and hope things work out next time. log_manager_.DiscardStagedLog(); scheduler_->UploadCancelled(); log_upload_in_progress_ = false; return; } HandleIdleSinceLastTransmission(true); } void MetricsService::OnLogUploadComplete(int response_code) { DCHECK_EQ(SENDING_LOGS, state_); DCHECK(log_upload_in_progress_); log_upload_in_progress_ = false; // Log a histogram to track response success vs. failure rates. UMA_HISTOGRAM_ENUMERATION("UMA.UploadResponseStatus.Protobuf", ResponseCodeToStatus(response_code), NUM_RESPONSE_STATUSES); bool upload_succeeded = response_code == 200; // Provide boolean for error recovery (allow us to ignore response_code). bool discard_log = false; const size_t log_size = log_manager_.staged_log().length(); if (upload_succeeded) { UMA_HISTOGRAM_COUNTS_10000("UMA.LogSize.OnSuccess", log_size / 1024); } else if (log_size > kUploadLogAvoidRetransmitSize) { UMA_HISTOGRAM_COUNTS("UMA.Large Rejected Log was Discarded", static_cast<int>(log_size)); discard_log = true; } else if (response_code == 400) { // Bad syntax. Retransmission won't work. discard_log = true; } if (upload_succeeded || discard_log) { log_manager_.DiscardStagedLog(); // Store the updated list to disk now that the removed log is uploaded. log_manager_.PersistUnsentLogs(); } // Error 400 indicates a problem with the log, not with the server, so // don't consider that a sign that the server is in trouble. bool server_is_healthy = upload_succeeded || response_code == 400; scheduler_->UploadFinished(server_is_healthy, log_manager_.has_unsent_logs()); if (server_is_healthy) client_->OnLogUploadComplete(); } void MetricsService::IncrementPrefValue(const char* path) { int value = local_state_->GetInteger(path); local_state_->SetInteger(path, value + 1); } void MetricsService::IncrementLongPrefsValue(const char* path) { int64 value = local_state_->GetInt64(path); local_state_->SetInt64(path, value + 1); } bool MetricsService::UmaMetricsProperlyShutdown() { CHECK(clean_shutdown_status_ == CLEANLY_SHUTDOWN || clean_shutdown_status_ == NEED_TO_SHUTDOWN); return clean_shutdown_status_ == CLEANLY_SHUTDOWN; } void MetricsService::AddSyntheticTrialObserver( SyntheticTrialObserver* observer) { synthetic_trial_observer_list_.AddObserver(observer); if (!synthetic_trial_groups_.empty()) observer->OnSyntheticTrialsChanged(synthetic_trial_groups_); } void MetricsService::RemoveSyntheticTrialObserver( SyntheticTrialObserver* observer) { synthetic_trial_observer_list_.RemoveObserver(observer); } void MetricsService::RegisterSyntheticFieldTrial( const SyntheticTrialGroup& trial) { for (size_t i = 0; i < synthetic_trial_groups_.size(); ++i) { if (synthetic_trial_groups_[i].id.name == trial.id.name) { if (synthetic_trial_groups_[i].id.group != trial.id.group) { synthetic_trial_groups_[i].id.group = trial.id.group; synthetic_trial_groups_[i].start_time = base::TimeTicks::Now(); NotifySyntheticTrialObservers(); } return; } } SyntheticTrialGroup trial_group = trial; trial_group.start_time = base::TimeTicks::Now(); synthetic_trial_groups_.push_back(trial_group); NotifySyntheticTrialObservers(); } void MetricsService::RegisterMetricsProvider( scoped_ptr<MetricsProvider> provider) { DCHECK_EQ(INITIALIZED, state_); metrics_providers_.push_back(provider.release()); } void MetricsService::CheckForClonedInstall( scoped_refptr<base::SingleThreadTaskRunner> task_runner) { state_manager_->CheckForClonedInstall(task_runner); } void MetricsService::NotifySyntheticTrialObservers() { FOR_EACH_OBSERVER(SyntheticTrialObserver, synthetic_trial_observer_list_, OnSyntheticTrialsChanged(synthetic_trial_groups_)); } void MetricsService::GetCurrentSyntheticFieldTrials( std::vector<variations::ActiveGroupId>* synthetic_trials) { DCHECK(synthetic_trials); synthetic_trials->clear(); const MetricsLog* current_log = log_manager_.current_log(); for (size_t i = 0; i < synthetic_trial_groups_.size(); ++i) { if (synthetic_trial_groups_[i].start_time <= current_log->creation_time()) synthetic_trials->push_back(synthetic_trial_groups_[i].id); } } scoped_ptr<MetricsLog> MetricsService::CreateLog(MetricsLog::LogType log_type) { return make_scoped_ptr(new MetricsLog(state_manager_->client_id(), session_id_, log_type, client_, local_state_)); } void MetricsService::RecordCurrentEnvironment(MetricsLog* log) { std::vector<variations::ActiveGroupId> synthetic_trials; GetCurrentSyntheticFieldTrials(&synthetic_trials); log->RecordEnvironment(metrics_providers_.get(), synthetic_trials, GetInstallDate(), GetMetricsReportingEnabledDate()); UMA_HISTOGRAM_COUNTS_100("UMA.SyntheticTrials.Count", synthetic_trials.size()); } void MetricsService::RecordCurrentHistograms() { DCHECK(log_manager_.current_log()); histogram_snapshot_manager_.PrepareDeltas( base::Histogram::kNoFlags, base::Histogram::kUmaTargetedHistogramFlag); } void MetricsService::RecordCurrentStabilityHistograms() { DCHECK(log_manager_.current_log()); histogram_snapshot_manager_.PrepareDeltas( base::Histogram::kNoFlags, base::Histogram::kUmaStabilityHistogramFlag); } void MetricsService::LogCleanShutdown() { // Redundant setting to assure that we always reset this value at shutdown // (and that we don't use some alternate path, and not call LogCleanShutdown). clean_shutdown_status_ = CLEANLY_SHUTDOWN; clean_exit_beacon_.WriteBeaconValue(true); RecordCurrentState(local_state_); local_state_->SetInteger(prefs::kStabilityExecutionPhase, MetricsService::SHUTDOWN_COMPLETE); } bool MetricsService::ShouldLogEvents() { // We simply don't log events to UMA if there is a single incognito // session visible. The problem is that we always notify using the orginal // profile in order to simplify notification processing. return !client_->IsOffTheRecordSessionActive(); } void MetricsService::RecordBooleanPrefValue(const char* path, bool value) { DCHECK(IsSingleThreaded()); local_state_->SetBoolean(path, value); RecordCurrentState(local_state_); } void MetricsService::RecordCurrentState(PrefService* pref) { pref->SetInt64(prefs::kStabilityLastTimestampSec, base::Time::Now().ToTimeT()); } } // namespace metrics
Java
/* * PROJECT: Atomix Development * LICENSE: BSD 3-Clause (LICENSE.md) * PURPOSE: Cgt MSIL * PROGRAMMERS: Aman Priyadarshi (aman.eureka@gmail.com) */ using System; using System.Reflection; using Atomixilc.Machine; using Atomixilc.Attributes; using Atomixilc.Machine.x86; namespace Atomixilc.IL { [ILImpl(ILCode.Cgt)] internal class Cgt_il : MSIL { public Cgt_il() : base(ILCode.Cgt) { } /* * URL : https://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes.Cgt(v=vs.110).aspx * Description : Compares two values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack. */ internal override void Execute(Options Config, OpCodeType xOp, MethodBase method, Optimizer Optimizer) { if (Optimizer.vStack.Count < 2) throw new Exception("Internal Compiler Error: vStack.Count < 2"); var itemA = Optimizer.vStack.Pop(); var itemB = Optimizer.vStack.Pop(); var xCurrentLabel = Helper.GetLabel(xOp.Position); var xNextLabel = Helper.GetLabel(xOp.NextPosition); var size = Math.Max(Helper.GetTypeSize(itemA.OperandType, Config.TargetPlatform), Helper.GetTypeSize(itemB.OperandType, Config.TargetPlatform)); /* The stack transitional behavior, in sequential order, is: * value1 is pushed onto the stack. * value2 is pushed onto the stack. * value2 and value1 are popped from the stack; cgt tests if value1 is greater than value2. * If value1 is greater than value2, 1 is pushed onto the stack; otherwise 0 is pushed onto the stack. */ switch (Config.TargetPlatform) { case Architecture.x86: { if (itemA.IsFloat || itemB.IsFloat || size > 4) throw new Exception(string.Format("UnImplemented '{0}'", msIL)); if (!itemA.SystemStack || !itemB.SystemStack) throw new Exception(string.Format("UnImplemented-RegisterType '{0}'", msIL)); new Pop { DestinationReg = Register.EAX }; new Pop { DestinationReg = Register.EDX }; new Cmp { DestinationReg = Register.EDX, SourceReg = Register.EAX }; new Setg { DestinationReg = Register.AL }; new Movzx { DestinationReg = Register.EAX, SourceReg = Register.AL, Size = 8 }; new Push { DestinationReg = Register.EAX }; Optimizer.vStack.Push(new StackItem(typeof(bool))); Optimizer.SaveStack(xOp.NextPosition); } break; default: throw new Exception(string.Format("Unsupported target platform '{0}' for MSIL '{1}'", Config.TargetPlatform, msIL)); } } } }
Java
{{ define "footer" }} <div class="ui inverted footer vertical segment"> <div class="ui stackable center aligned page grid"> <!-- <div class="ten wide column"> <div class="ui three column center aligned stackable grid"> <div class="column"> <h5 class="ui inverted header">Courses</h5> <div class="ui inverted link list"> <a class="item">Registration</a> <a class="item">Course Calendar</a> <a class="item">Professors</a> </div> </div> <div class="column"> <h5 class="ui inverted header">Library</h5> <div class="ui inverted link list"> <a class="item">A-Z</a> <a class="item">Most Popular</a> <a class="item">Recently Changed</a> </div> </div> <div class="column"> <h5 class="ui inverted header">Community</h5> <div class="ui inverted link list"> <a class="item">BBS</a> <a class="item">Careers</a> <a class="item">Privacy Policy</a> </div> </div> </div> </div> --> <div class="six wide column"> <h5 class="ui inverted header">Contact Us</h5> <addr> 22 Acacia Avenue <br> Chiswick, London <br> </addr> <p>(44) 123-4567</p> </div> </div> </div> {{ end }}
Java
# itten
Java
/** * This code is free software; you can redistribute it and/or modify it under * the terms of the new BSD License. * * Copyright (c) 2008-2011, Sebastian Staudt */ package com.github.koraktor.steamcondenser.steam.community; import static com.github.koraktor.steamcondenser.steam.community.XMLUtil.loadXml; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import static org.powermock.api.mockito.PowerMockito.mockStatic; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import com.github.koraktor.steamcondenser.steam.community.portal2.Portal2Stats; /** * @author Guto Maia */ @RunWith(PowerMockRunner.class) @PrepareForTest({ DocumentBuilderFactory.class, DocumentBuilder.class }) public class Portal2StatsTest extends StatsTestCase<Portal2Stats>{ public Portal2StatsTest() { super("gutomaia", "portal2"); } @Test public void getPortal2Stats() throws Exception { assertEquals("Portal 2", stats.getGameName()); assertEquals("Portal2", stats.getGameFriendlyName()); assertEquals(620, stats.getAppId()); assertEquals("0", stats.getHoursPlayed()); assertEquals(76561197985077150l, stats.getSteamId64()); } @Test public void achievements() throws Exception { assertEquals(17, stats.getAchievementsDone()); } }
Java
package com.atlassian.pageobjects.components.aui; import com.atlassian.pageobjects.PageBinder; import com.atlassian.pageobjects.binder.Init; import com.atlassian.pageobjects.binder.InvalidPageStateException; import com.atlassian.pageobjects.components.TabbedComponent; import com.atlassian.pageobjects.elements.PageElement; import com.atlassian.pageobjects.elements.PageElementFinder; import com.atlassian.pageobjects.elements.query.Poller; import org.openqa.selenium.By; import javax.inject.Inject; import java.util.List; /** * Represents a tabbed content area created via AUI. * * This is an example of a reusable components. */ public class AuiTabs implements TabbedComponent { @Inject protected PageBinder pageBinder; @Inject protected PageElementFinder elementFinder; private final By rootLocator; private PageElement rootElement; public AuiTabs(By locator) { this.rootLocator = locator; } @Init public void initialize() { this.rootElement = elementFinder.find(rootLocator); } public PageElement selectedTab() { List<PageElement> items = rootElement.find(By.className("tabs-menu")).findAll(By.tagName("li")); for(int i = 0; i < items.size(); i++) { PageElement tab = items.get(i); if(tab.hasClass("active-tab")) { return tab; } } throw new InvalidPageStateException("A tab must be active.", this); } public PageElement selectedView() { List<PageElement> panes = rootElement.findAll(By.className("tabs-pane")); for(int i = 0; i < panes.size(); i++) { PageElement pane = panes.get(i); if(pane.hasClass("active-pane")) { return pane; } } throw new InvalidPageStateException("A pane must be active", this); } public List<PageElement> tabs() { return rootElement.find(By.className("tabs-menu")).findAll(By.tagName("li")); } public PageElement openTab(String tabText) { List<PageElement> tabs = rootElement.find(By.className("tabs-menu")).findAll(By.tagName("a")); for(int i = 0; i < tabs.size(); i++) { if(tabs.get(i).getText().equals(tabText)) { PageElement listItem = tabs.get(i); listItem.click(); // find the pane and wait until it has class "active-pane" String tabViewHref = listItem.getAttribute("href"); String tabViewClassName = tabViewHref.substring(tabViewHref.indexOf('#') + 1); PageElement pane = rootElement.find(By.id(tabViewClassName)); Poller.waitUntilTrue(pane.timed().hasClass("active-pane")); return pane; } } throw new InvalidPageStateException("Tab not found", this); } public PageElement openTab(PageElement tab) { String tabIdentifier = tab.getText(); return openTab(tabIdentifier); } }
Java
<?php /** * iDatabase数据管理控制器 * * @author young * @version 2013.11.22 * */ namespace Idatabase\Controller; use My\Common\Controller\Action; class ImportController extends Action { /** * 读取当前数据集合的mongocollection实例 * * @var object */ private $_data; /** * 读取数据属性结构的mongocollection实例 * * @var object */ private $_structure; /** * 读取集合列表集合的mongocollection实例 * * @var object */ private $_collection; /** * 当前集合所属项目 * * @var string */ private $_project_id = ''; /** * 当前集合所属集合 集合的alias别名或者_id的__toString()结果 * * @var string */ private $_collection_id = ''; /** * 存储数据的物理集合名称 * * @var string */ private $_collection_name = ''; /** * 存储当前集合的结局结构信息 * * @var array */ private $_schema = null; /** * 存储查询显示字段列表 * * @var array */ private $_fields = array(); /** * Gearman客户端 * * @var object */ private $_gmClient; /** * 存储文件 * * @var object */ private $_file; /** * 初始化函数 * * @see \My\Common\ActionController::init() */ public function init() { resetTimeMemLimit(); $this->_project_id = isset($_REQUEST['__PROJECT_ID__']) ? trim($_REQUEST['__PROJECT_ID__']) : ''; if (empty($this->_project_id)) throw new \Exception('$this->_project_id值未设定'); $this->_collection = $this->model('Idatabase\Model\Collection'); $this->_collection_id = isset($_REQUEST['__COLLECTION_ID__']) ? trim($_REQUEST['__COLLECTION_ID__']) : ''; if (empty($this->_collection_id)) throw new \Exception('$this->_collection_id值未设定'); $this->_collection_id = $this->getCollectionIdByName($this->_collection_id); $this->_collection_name = 'idatabase_collection_' . $this->_collection_id; $this->_data = $this->collection($this->_collection_name); $this->_structure = $this->model('Idatabase\Model\Structure'); $this->_file = $this->model('Idatabase\Model\File'); // 建立gearman客户端连接 $this->_gmClient = $this->gearman()->client(); $this->getSchema(); } /** * 将导入数据脚本放置到gearman中进行,加快页面的响应速度 */ public function importCsvJobAction() { // 大数据量导采用mongoimport直接导入的方式导入数据 $collection_id = trim($this->params()->fromPost('__COLLECTION_ID__', null)); $physicalDrop = filter_var($this->params()->fromPost('physicalDrop', false), FILTER_VALIDATE_BOOLEAN); $upload = $this->params()->fromFiles('import'); if (empty($collection_id) || empty($upload)) { return $this->msg(false, '上传文件或者集合编号不能为空'); } $uploadFileNameLower = strtolower($upload['name']); if (strpos($uploadFileNameLower, '.zip') !== false) { $bytes = file_get_contents($upload['tmp_name']); $fileInfo = $this->_file->storeBytesToGridFS($bytes, 'import.zip'); $key = $fileInfo['_id']->__toString(); } else { if (strpos($uploadFileNameLower, '.csv') === false) { return $this->msg(false, '请上传csv格式的文件'); } $bytes = file_get_contents($upload['tmp_name']); if (! detectUTF8($bytes)) { return $this->msg(false, '请使用文本编辑器将文件转化为UTF-8格式'); } $fileInfo = $this->_file->storeBytesToGridFS($bytes, 'import.csv'); $key = $fileInfo['_id']->__toString(); } $workload = array(); $workload['key'] = $key; $workload['collection_id'] = $collection_id; $workload['physicalDrop'] = $physicalDrop; // $jobHandle = $this->_gmClient->doBackground('dataImport', serialize($workload), $key); $jobHandle = $this->_gmClient->doBackground('bsonImport', serialize($workload), $key); $stat = $this->_gmClient->jobStatus($jobHandle); if (isset($stat[0]) && $stat[0]) { return $this->msg(true, '数据导入任务已经被受理,请稍后片刻若干分钟,导入时间取决于数据量(1w/s)。'); } else { return $this->msg(false, '任务提交失败'); } } /** * 导入数据到集合内 */ public function importAction() { try { $importSheetName = trim($this->params()->fromPost('sheetName', null)); $file = $this->params()->fromFiles('import', null); if ($importSheetName == null) { return $this->msg(false, '请设定需要导入的sheet'); } if ($file == null) { return $this->msg(false, '请上传Excel数据表格文件'); } if ($file['error'] === UPLOAD_ERR_OK) { $fileName = $file['name']; $filePath = $file['tmp_name']; $ext = strtolower(pathinfo($fileName, PATHINFO_EXTENSION)); switch ($ext) { case 'xlsx': $inputFileType = 'Excel2007'; break; default: return $this->msg(false, '很抱歉,您上传的文件格式无法识别,格式要求:*.xlsx'); } $objReader = \PHPExcel_IOFactory::createReader($inputFileType); $objReader->setReadDataOnly(true); $objReader->setLoadSheetsOnly($importSheetName); $objPHPExcel = $objReader->load($filePath); if (! in_array($importSheetName, array_values($objPHPExcel->getSheetNames()))) { return $this->msg(false, 'Sheet:"' . $importSheetName . '",不存在,请检查您导入的Excel表格'); } $objPHPExcel->setActiveSheetIndexByName($importSheetName); $objActiveSheet = $objPHPExcel->getActiveSheet(); $sheetData = $objActiveSheet->toArray(null, true, true, true); $objPHPExcel->disconnectWorksheets(); unset($objReader, $objPHPExcel, $objActiveSheet); if (empty($sheetData)) { return $this->msg(false, '请确认表格中未包含有效数据,请复核'); } $firstRow = array_shift($sheetData); if (count($firstRow) == 0) { return $this->msg(false, '标题行数据为空'); } $titles = array(); foreach ($firstRow as $col => $value) { $value = trim($value); if (in_array($value, array_keys($this->_schema), true)) { $titles[$col] = $this->_schema[$value]; } else if (in_array($value, array_values($this->_schema), true)) { $titles[$col] = $value; } } if (count($titles) == 0) { return $this->msg(false, '无匹配的标题或者标题字段,请检查导入数据的格式是否正确'); } array_walk($sheetData, function ($row, $rowNumber) use($titles) { $insertData = array(); foreach ($titles as $col => $colName) { $insertData[$colName] = formatData($row[$col], $this->_fields[$colName]); } $this->_data->insertByFindAndModify($insertData); unset($insertData); }); // 用bson文件代替插入数据 // $bson = ''; // foreach ($sheetData as $rowNumber=>$row) { // $insertData = array(); // foreach ($titles as $col => $colName) { // $insertData[$colName] = formatData($row[$col], $this->_fields[$colName]); // } // $bson .= bson_encode($insertData); // } unset($sheetData); return $this->msg(true, '导入成功'); } else { return $this->msg(false, '上传文件失败'); } } catch (\Exception $e) { fb(exceptionMsg($e), \FirePHP::LOG); return $this->msg(false, '导入失败,发生异常'); } } /** * 获取集合的数据结构 * * @return array */ private function getSchema() { $this->_schema = array(); $this->_fields = array(); $cursor = $this->_structure->find(array( 'collection_id' => $this->_collection_id )); while ($cursor->hasNext()) { $row = $cursor->getNext(); $this->_schema[$row['label']] = $row['field']; $this->_fields[$row['field']] = $row['type']; } return true; } /** * 根据集合的名称获取集合的_id * * @param string $name * @throws \Exception or string */ private function getCollectionIdByName($name) { try { new \MongoId($name); return $name; } catch (\MongoException $ex) {} $collectionInfo = $this->_collection->findOne(array( 'project_id' => $this->_project_id, 'name' => $name )); if ($collectionInfo == null) { throw new \Exception('集合名称不存在于指定项目'); } return $collectionInfo['_id']->__toString(); } }
Java
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model app\models\IzinmenutupjalanSearch */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="izinmenutupjalan-search"> <?php $form = ActiveForm::begin([ 'action' => ['index'], 'method' => 'get', ]); ?> <?= $form->field($model, 'id_imj') ?> <?= $form->field($model, 'id_akun') ?> <?= $form->field($model, 'nomor_imj') ?> <?= $form->field($model, 'tglDikeluarkan_imj') ?> <?= $form->field($model, 'tglPengajuan_imj') ?> <?php // echo $form->field($model, 'kepada_imj') ?> <?php // echo $form->field($model, 'alamat_imj') ?> <?php // echo $form->field($model, 'namaAcara_imj') ?> <?php // echo $form->field($model, 'jalanDitutup_imj') ?> <?php // echo $form->field($model, 'penutupanJalanMaksimal_imj') ?> <?php // echo $form->field($model, 'tglAcara_imj') ?> <?php // echo $form->field($model, 'JamAcara_imj') ?> <?php // echo $form->field($model, 'tglAcaraSelesai_imj') ?> <?php // echo $form->field($model, 'jamAcaraSelesai_imj') ?> <?php // echo $form->field($model, 'tembusan_imj') ?> <?php // echo $form->field($model, 'keterangan_imj') ?> <div class="form-group"> <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?> <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?> </div> <?php ActiveForm::end(); ?> </div>
Java
# -*- coding: utf-8 -*- """ Display currently playing song from Google Play Music Desktop Player. Configuration parameters: cache_timeout: how often we refresh this module in seconds (default 5) format: specify the items and ordering of the data in the status bar. These area 1:1 match to gpmdp-remote's options (default is '♫ {info}'). Format of status string placeholders: See `gpmdp-remote help`. Simply surround the items you want displayed (i.e. `album`) with curly braces (i.e. `{album}`) and place as-desired in the format string. {info} Print info about now playing song {title} Print current song title {artist} Print current song artist {album} Print current song album {album_art} Print current song album art URL {time_current} Print current song time in milliseconds {time_total} Print total song time in milliseconds {status} Print whether GPMDP is paused or playing {current} Print now playing song in "artist - song" format {help} Print this help message Requires: gpmdp: http://www.googleplaymusicdesktopplayer.com/ gpmdp-remote: https://github.com/iandrewt/gpmdp-remote @author Aaron Fields https://twitter.com/spirotot @license BSD """ from time import time from subprocess import check_output class Py3status: """ """ # available configuration parameters cache_timeout = 5 format = u'♫ {info}' @staticmethod def _run_cmd(cmd): return check_output(['gpmdp-remote', cmd]).decode('utf-8').strip() def gpmdp(self, i3s_output_list, i3s_config): if self._run_cmd('status') == 'Paused': result = '' else: cmds = ['info', 'title', 'artist', 'album', 'status', 'current', 'time_total', 'time_current', 'album_art'] data = {} for cmd in cmds: if '{%s}' % cmd in self.format: data[cmd] = self._run_cmd(cmd) result = self.format.format(**data) response = { 'cached_until': time() + self.cache_timeout, 'full_text': result } return response if __name__ == "__main__": """ Run module in test mode. """ from py3status.module_test import module_test module_test(Py3status)
Java
<!DOCTYPE html> <html> <meta charset="utf-8"> <title>Date parser test — 100&lt;=x&lt;=999 and January&lt;=y&lt;=December and 100&lt;=z&lt;=999 — 100 december 100</title> <script src="../date_test.js"></script> <p>Failed (Script did not run)</p> <script> test_date_invalid("100 december 100", "Invalid Date") </script> </html>
Java
// // buffered_write_stream.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // 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 BOOST_ASIO_BUFFERED_WRITE_STREAM_HPP #define BOOST_ASIO_BUFFERED_WRITE_STREAM_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <boost/asio/detail/config.hpp> #include <cstddef> #include <boost/asio/buffered_write_stream_fwd.hpp> #include <boost/asio/buffer.hpp> #include <boost/asio/completion_condition.hpp> #include <boost/asio/detail/bind_handler.hpp> #include <boost/asio/detail/buffered_stream_storage.hpp> #include <boost/asio/detail/noncopyable.hpp> #include <boost/asio/detail/type_traits.hpp> #include <boost/asio/error.hpp> #include <boost/asio/io_service.hpp> #include <boost/asio/write.hpp> #include <boost/asio/detail/push_options.hpp> namespace pdalboost {} namespace boost = pdalboost; namespace pdalboost { namespace asio { /// Adds buffering to the write-related operations of a stream. /** * The buffered_write_stream class template can be used to add buffering to the * synchronous and asynchronous write operations of a stream. * * @par Thread Safety * @e Distinct @e objects: Safe.@n * @e Shared @e objects: Unsafe. * * @par Concepts: * AsyncReadStream, AsyncWriteStream, Stream, SyncReadStream, SyncWriteStream. */ template <typename Stream> class buffered_write_stream : private noncopyable { public: /// The type of the next layer. typedef typename remove_reference<Stream>::type next_layer_type; /// The type of the lowest layer. typedef typename next_layer_type::lowest_layer_type lowest_layer_type; #if defined(GENERATING_DOCUMENTATION) /// The default buffer size. static const std::size_t default_buffer_size = implementation_defined; #else BOOST_ASIO_STATIC_CONSTANT(std::size_t, default_buffer_size = 1024); #endif /// Construct, passing the specified argument to initialise the next layer. template <typename Arg> explicit buffered_write_stream(Arg& a) : next_layer_(a), storage_(default_buffer_size) { } /// Construct, passing the specified argument to initialise the next layer. template <typename Arg> buffered_write_stream(Arg& a, std::size_t buffer_size) : next_layer_(a), storage_(buffer_size) { } /// Get a reference to the next layer. next_layer_type& next_layer() { return next_layer_; } /// Get a reference to the lowest layer. lowest_layer_type& lowest_layer() { return next_layer_.lowest_layer(); } /// Get a const reference to the lowest layer. const lowest_layer_type& lowest_layer() const { return next_layer_.lowest_layer(); } /// Get the io_service associated with the object. pdalboost::asio::io_service& get_io_service() { return next_layer_.get_io_service(); } /// Close the stream. void close() { next_layer_.close(); } /// Close the stream. pdalboost::system::error_code close(pdalboost::system::error_code& ec) { return next_layer_.close(ec); } /// Flush all data from the buffer to the next layer. Returns the number of /// bytes written to the next layer on the last write operation. Throws an /// exception on failure. std::size_t flush(); /// Flush all data from the buffer to the next layer. Returns the number of /// bytes written to the next layer on the last write operation, or 0 if an /// error occurred. std::size_t flush(pdalboost::system::error_code& ec); /// Start an asynchronous flush. template <typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (pdalboost::system::error_code, std::size_t)) async_flush(BOOST_ASIO_MOVE_ARG(WriteHandler) handler); /// Write the given data to the stream. Returns the number of bytes written. /// Throws an exception on failure. template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers); /// Write the given data to the stream. Returns the number of bytes written, /// or 0 if an error occurred and the error handler did not throw. template <typename ConstBufferSequence> std::size_t write_some(const ConstBufferSequence& buffers, pdalboost::system::error_code& ec); /// Start an asynchronous write. The data being written must be valid for the /// lifetime of the asynchronous operation. template <typename ConstBufferSequence, typename WriteHandler> BOOST_ASIO_INITFN_RESULT_TYPE(WriteHandler, void (pdalboost::system::error_code, std::size_t)) async_write_some(const ConstBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(WriteHandler) handler); /// Read some data from the stream. Returns the number of bytes read. Throws /// an exception on failure. template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers) { return next_layer_.read_some(buffers); } /// Read some data from the stream. Returns the number of bytes read or 0 if /// an error occurred. template <typename MutableBufferSequence> std::size_t read_some(const MutableBufferSequence& buffers, pdalboost::system::error_code& ec) { return next_layer_.read_some(buffers, ec); } /// Start an asynchronous read. The buffer into which the data will be read /// must be valid for the lifetime of the asynchronous operation. template <typename MutableBufferSequence, typename ReadHandler> BOOST_ASIO_INITFN_RESULT_TYPE(ReadHandler, void (pdalboost::system::error_code, std::size_t)) async_read_some(const MutableBufferSequence& buffers, BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { detail::async_result_init< ReadHandler, void (pdalboost::system::error_code, std::size_t)> init( BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); next_layer_.async_read_some(buffers, BOOST_ASIO_MOVE_CAST(BOOST_ASIO_HANDLER_TYPE(ReadHandler, void (pdalboost::system::error_code, std::size_t)))(init.handler)); return init.result.get(); } /// Peek at the incoming data on the stream. Returns the number of bytes read. /// Throws an exception on failure. template <typename MutableBufferSequence> std::size_t peek(const MutableBufferSequence& buffers) { return next_layer_.peek(buffers); } /// Peek at the incoming data on the stream. Returns the number of bytes read, /// or 0 if an error occurred. template <typename MutableBufferSequence> std::size_t peek(const MutableBufferSequence& buffers, pdalboost::system::error_code& ec) { return next_layer_.peek(buffers, ec); } /// Determine the amount of data that may be read without blocking. std::size_t in_avail() { return next_layer_.in_avail(); } /// Determine the amount of data that may be read without blocking. std::size_t in_avail(pdalboost::system::error_code& ec) { return next_layer_.in_avail(ec); } private: /// Copy data into the internal buffer from the specified source buffer. /// Returns the number of bytes copied. template <typename ConstBufferSequence> std::size_t copy(const ConstBufferSequence& buffers); /// The next layer. Stream next_layer_; // The data in the buffer. detail::buffered_stream_storage storage_; }; } // namespace asio } // namespace pdalboost #include <boost/asio/detail/pop_options.hpp> #include <boost/asio/impl/buffered_write_stream.hpp> #endif // BOOST_ASIO_BUFFERED_WRITE_STREAM_HPP
Java
//////////////////////////////////////////////////////////////////////////////////// /// /// \file reporttimeout.cpp /// \brief This file contains the implementation of a JAUS message. /// /// <br>Author(s): Bo Sun /// <br>Created: 17 November 2009 /// <br>Copyright (c) 2009 /// <br>Applied Cognition and Training in Immersive Virtual Environments /// <br>(ACTIVE) Laboratory /// <br>Institute for Simulation and Training (IST) /// <br>University of Central Florida (UCF) /// <br>All rights reserved. /// <br>Email: bsun@ist.ucf.edu /// <br>Web: http://active.ist.ucf.edu /// /// Redistribution and use in source and binary forms, with or without /// modification, are permitted provided that the following conditions are met: /// * Redistributions of source code must retain the above copyright /// notice, this list of conditions and the following disclaimer. /// * Redistributions in binary form must reproduce the above copyright /// notice, this list of conditions and the following disclaimer in the /// documentation and/or other materials provided with the distribution. /// * Neither the name of the ACTIVE LAB, IST, UCF, nor the /// names of its contributors may be used to endorse or promote products /// derived from this software without specific prior written permission. /// /// THIS SOFTWARE IS PROVIDED BY THE ACTIVE LAB''AS IS'' AND ANY /// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED /// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE /// DISCLAIMED. IN NO EVENT SHALL UCF BE LIABLE FOR ANY /// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES /// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; /// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND /// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT /// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS /// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /// //////////////////////////////////////////////////////////////////////////////////// #include "jaus/core/control/reporttimeout.h" using namespace JAUS; //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Constructor, initializes default values. /// /// \param[in] src Source ID of message sender. /// \param[in] dest Destination ID of message. /// //////////////////////////////////////////////////////////////////////////////////// ReportTimeout::ReportTimeout(const Address& dest, const Address& src) : Message(REPORT_TIMEOUT, dest, src) { mTimeoutSeconds = 0; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Copy constructor. /// //////////////////////////////////////////////////////////////////////////////////// ReportTimeout::ReportTimeout(const ReportTimeout& message) : Message(REPORT_TIMEOUT) { *this = message; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Destructor. /// //////////////////////////////////////////////////////////////////////////////////// ReportTimeout::~ReportTimeout() { } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Writes message payload to the packet. /// /// Message contents are written to the packet following the JAUS standard. /// /// \param[out] packet Packet to write payload to. /// /// \return -1 on error, otherwise number of bytes written. /// //////////////////////////////////////////////////////////////////////////////////// int ReportTimeout::WriteMessageBody(Packet& packet) const { int expected = BYTE_SIZE; int written = 0; written += packet.Write(mTimeoutSeconds); return expected == written ? written : -1; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Reads message payload from the packet. /// /// Message contents are read from the packet following the JAUS standard. /// /// \param[in] packet Packet containing message payload data to read. /// /// \return -1 on error, otherwise number of bytes written. /// //////////////////////////////////////////////////////////////////////////////////// int ReportTimeout::ReadMessageBody(const Packet& packet) { int expected = BYTE_SIZE; int read = 0; read += packet.Read(mTimeoutSeconds); return expected == read ? read : -1; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Clears message payload data. /// //////////////////////////////////////////////////////////////////////////////////// void ReportTimeout::ClearMessageBody() { mTimeoutSeconds = 0; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Runs a test case to validate the message class. /// /// \return 1 on success, otherwise 0. /// //////////////////////////////////////////////////////////////////////////////////// int ReportTimeout::RunTestCase() const { int result = 0; Packet packet; ReportTimeout msg1, msg2; msg1.SetTimeoutSeconds(100); if( msg1.WriteMessageBody(packet) != -1 && msg2.ReadMessageBody(packet) != -1 && msg1.GetTimeoutSeconds() == msg2.GetTimeoutSeconds()) { result = 1; } return result; } //////////////////////////////////////////////////////////////////////////////////// /// /// \brief Sets equal to. /// //////////////////////////////////////////////////////////////////////////////////// ReportTimeout& ReportTimeout::operator=(const ReportTimeout& message) { if(this != &message) { CopyHeaderData(&message); mTimeoutSeconds = message.mTimeoutSeconds; } return *this; } /* End of File */
Java
/*! normalize.css v3.0.1 | MIT License | git.io/normalize */ 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, 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: 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 { -moz-box-sizing: content-box; 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; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; 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; } @media print { * { text-shadow: none !important; color: #000 !important; background: transparent !important; box-shadow: none !important; } a, a:visited { text-decoration: underline; } a[href]:after { content: " (" attr(href) ")"; } abbr[title]:after { content: " (" attr(title) ")"; } a[href^="javascript:"]:after, a[href^="#"]: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; } select { background: #fff !important; } .navbar { display: none; } .table td, .table th { background-color: #fff !important; } .btn > .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table-bordered th, .table-bordered td { border: 1px solid #ddd !important; } } @font-face { font-family: 'Glyphicons Halflings'; src: url('bootstrap-3.2.0/fonts/glyphicons-halflings-regular.eot'); src: url('bootstrap-3.2.0/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('bootstrap-3.2.0/fonts/glyphicons-halflings-regular.woff') format('woff'), url('bootstrap-3.2.0/fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('bootstrap-3.2.0/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: "\2a"; } .glyphicon-plus:before { content: "\2b"; } .glyphicon-euro: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"; } * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } *:before, *:after { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html { font-size: 10px; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.42857143; color: #333333; background-color: #ffffff; } input, button, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; } a { color: #428bca; text-decoration: none; } a:hover, a:focus { color: #2a6496; text-decoration: underline; } a:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } figure { margin: 0; } img { vertical-align: middle; } .img-responsive, .thumbnail > img, .thumbnail a > img, .carousel-inner > .item > img, .carousel-inner > .item > a > img { display: block; width: 100% \9; max-width: 100%; height: auto; } .img-rounded { border-radius: 6px; } .img-thumbnail { padding: 4px; line-height: 1.42857143; background-color: #ffffff; border: 1px solid #dddddd; 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; width: 100% \9; max-width: 100%; height: auto; } .img-circle { border-radius: 50%; } hr { margin-top: 20px; margin-bottom: 20px; border: 0; border-top: 1px solid #eeeeee; } .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; } h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { font-weight: normal; line-height: 1; color: #777777; } h1, .h1, h2, .h2, h3, .h3 { margin-top: 20px; margin-bottom: 10px; } h1 small, .h1 small, h2 small, .h2 small, h3 small, .h3 small, h1 .small, .h1 .small, h2 .small, .h2 .small, h3 .small, .h3 .small { font-size: 65%; } h4, .h4, h5, .h5, h6, .h6 { margin-top: 10px; margin-bottom: 10px; } h4 small, .h4 small, h5 small, .h5 small, h6 small, .h6 small, h4 .small, .h4 .small, h5 .small, .h5 .small, h6 .small, .h6 .small { font-size: 75%; } h1, .h1 { font-size: 36px; } h2, .h2 { font-size: 30px; } h3, .h3 { font-size: 24px; } h4, .h4 { font-size: 18px; } h5, .h5 { font-size: 14px; } h6, .h6 { font-size: 12px; } p { margin: 0 0 10px; } .lead { margin-bottom: 20px; font-size: 16px; font-weight: 300; line-height: 1.4; } @media (min-width: 768px) { .lead { font-size: 21px; } } small, .small { font-size: 85%; } cite { font-style: normal; } mark, .mark { background-color: #fcf8e3; 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 { text-transform: uppercase; } .text-capitalize { text-transform: capitalize; } .text-muted { color: #777777; } .text-primary { color: #428bca; } a.text-primary:hover { color: #3071a9; } .text-success { color: #3c763d; } a.text-success:hover { color: #2b542c; } .text-info { color: #31708f; } a.text-info:hover { color: #245269; } .text-warning { color: #8a6d3b; } a.text-warning:hover { color: #66512c; } .text-danger { color: #a94442; } a.text-danger:hover { color: #843534; } .bg-primary { color: #fff; background-color: #428bca; } a.bg-primary:hover { background-color: #3071a9; } .bg-success { background-color: #dff0d8; } a.bg-success:hover { background-color: #c1e2b3; } .bg-info { background-color: #d9edf7; } a.bg-info:hover { background-color: #afd9ee; } .bg-warning { background-color: #fcf8e3; } a.bg-warning:hover { background-color: #f7ecb5; } .bg-danger { background-color: #f2dede; } a.bg-danger:hover { background-color: #e4b9b9; } .page-header { padding-bottom: 9px; margin: 40px 0 20px; border-bottom: 1px solid #eeeeee; } ul, ol { margin-top: 0; margin-bottom: 10px; } ul ul, ol ul, ul ol, ol ol { margin-bottom: 0; } .list-unstyled { padding-left: 0; list-style: none; } .list-inline { padding-left: 0; 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.42857143; } dt { font-weight: bold; } dd { margin-left: 0; } @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 #777777; } .initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 10px 20px; margin: 0 0 20px; font-size: 17.5px; border-left: 5px solid #eeeeee; } blockquote p:last-child, blockquote ul:last-child, blockquote ol:last-child { margin-bottom: 0; } blockquote footer, blockquote small, blockquote .small { display: block; font-size: 80%; line-height: 1.42857143; color: #777777; } 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 #eeeeee; border-left: 0; text-align: right; } .blockquote-reverse footer:before, blockquote.pull-right footer:before, .blockquote-reverse small:before, blockquote.pull-right small:before, .blockquote-reverse .small:before, blockquote.pull-right .small:before { content: ''; } .blockquote-reverse footer:after, blockquote.pull-right footer:after, .blockquote-reverse small:after, blockquote.pull-right small:after, .blockquote-reverse .small:after, blockquote.pull-right .small:after { content: '\00A0 \2014'; } blockquote:before, blockquote:after { content: ""; } address { margin-bottom: 20px; font-style: normal; line-height: 1.42857143; } code, kbd, pre, samp { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; border-radius: 4px; } kbd { padding: 2px 4px; font-size: 90%; color: #ffffff; background-color: #333333; border-radius: 3px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); } kbd kbd { padding: 0; font-size: 100%; box-shadow: none; } pre { display: block; padding: 9.5px; margin: 0 0 10px; font-size: 13px; line-height: 1.42857143; word-break: break-all; word-wrap: break-word; color: #333333; background-color: #f5f5f5; border: 1px solid #cccccc; 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; } @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; } .row { margin-left: -15px; margin-right: -15px; } .col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 { position: relative; min-height: 1px; padding-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-12 { width: 100%; } .col-xs-11 { width: 91.66666667%; } .col-xs-10 { width: 83.33333333%; } .col-xs-9 { width: 75%; } .col-xs-8 { width: 66.66666667%; } .col-xs-7 { width: 58.33333333%; } .col-xs-6 { width: 50%; } .col-xs-5 { width: 41.66666667%; } .col-xs-4 { width: 33.33333333%; } .col-xs-3 { width: 25%; } .col-xs-2 { width: 16.66666667%; } .col-xs-1 { width: 8.33333333%; } .col-xs-pull-12 { right: 100%; } .col-xs-pull-11 { right: 91.66666667%; } .col-xs-pull-10 { right: 83.33333333%; } .col-xs-pull-9 { right: 75%; } .col-xs-pull-8 { right: 66.66666667%; } .col-xs-pull-7 { right: 58.33333333%; } .col-xs-pull-6 { right: 50%; } .col-xs-pull-5 { right: 41.66666667%; } .col-xs-pull-4 { right: 33.33333333%; } .col-xs-pull-3 { right: 25%; } .col-xs-pull-2 { right: 16.66666667%; } .col-xs-pull-1 { right: 8.33333333%; } .col-xs-pull-0 { right: auto; } .col-xs-push-12 { left: 100%; } .col-xs-push-11 { left: 91.66666667%; } .col-xs-push-10 { left: 83.33333333%; } .col-xs-push-9 { left: 75%; } .col-xs-push-8 { left: 66.66666667%; } .col-xs-push-7 { left: 58.33333333%; } .col-xs-push-6 { left: 50%; } .col-xs-push-5 { left: 41.66666667%; } .col-xs-push-4 { left: 33.33333333%; } .col-xs-push-3 { left: 25%; } .col-xs-push-2 { left: 16.66666667%; } .col-xs-push-1 { left: 8.33333333%; } .col-xs-push-0 { left: auto; } .col-xs-offset-12 { margin-left: 100%; } .col-xs-offset-11 { margin-left: 91.66666667%; } .col-xs-offset-10 { margin-left: 83.33333333%; } .col-xs-offset-9 { margin-left: 75%; } .col-xs-offset-8 { margin-left: 66.66666667%; } .col-xs-offset-7 { margin-left: 58.33333333%; } .col-xs-offset-6 { margin-left: 50%; } .col-xs-offset-5 { margin-left: 41.66666667%; } .col-xs-offset-4 { margin-left: 33.33333333%; } .col-xs-offset-3 { margin-left: 25%; } .col-xs-offset-2 { margin-left: 16.66666667%; } .col-xs-offset-1 { margin-left: 8.33333333%; } .col-xs-offset-0 { margin-left: 0%; } @media (min-width: 768px) { .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 { float: left; } .col-sm-12 { width: 100%; } .col-sm-11 { width: 91.66666667%; } .col-sm-10 { width: 83.33333333%; } .col-sm-9 { width: 75%; } .col-sm-8 { width: 66.66666667%; } .col-sm-7 { width: 58.33333333%; } .col-sm-6 { width: 50%; } .col-sm-5 { width: 41.66666667%; } .col-sm-4 { width: 33.33333333%; } .col-sm-3 { width: 25%; } .col-sm-2 { width: 16.66666667%; } .col-sm-1 { width: 8.33333333%; } .col-sm-pull-12 { right: 100%; } .col-sm-pull-11 { right: 91.66666667%; } .col-sm-pull-10 { right: 83.33333333%; } .col-sm-pull-9 { right: 75%; } .col-sm-pull-8 { right: 66.66666667%; } .col-sm-pull-7 { right: 58.33333333%; } .col-sm-pull-6 { right: 50%; } .col-sm-pull-5 { right: 41.66666667%; } .col-sm-pull-4 { right: 33.33333333%; } .col-sm-pull-3 { right: 25%; } .col-sm-pull-2 { right: 16.66666667%; } .col-sm-pull-1 { right: 8.33333333%; } .col-sm-pull-0 { right: auto; } .col-sm-push-12 { left: 100%; } .col-sm-push-11 { left: 91.66666667%; } .col-sm-push-10 { left: 83.33333333%; } .col-sm-push-9 { left: 75%; } .col-sm-push-8 { left: 66.66666667%; } .col-sm-push-7 { left: 58.33333333%; } .col-sm-push-6 { left: 50%; } .col-sm-push-5 { left: 41.66666667%; } .col-sm-push-4 { left: 33.33333333%; } .col-sm-push-3 { left: 25%; } .col-sm-push-2 { left: 16.66666667%; } .col-sm-push-1 { left: 8.33333333%; } .col-sm-push-0 { left: auto; } .col-sm-offset-12 { margin-left: 100%; } .col-sm-offset-11 { margin-left: 91.66666667%; } .col-sm-offset-10 { margin-left: 83.33333333%; } .col-sm-offset-9 { margin-left: 75%; } .col-sm-offset-8 { margin-left: 66.66666667%; } .col-sm-offset-7 { margin-left: 58.33333333%; } .col-sm-offset-6 { margin-left: 50%; } .col-sm-offset-5 { margin-left: 41.66666667%; } .col-sm-offset-4 { margin-left: 33.33333333%; } .col-sm-offset-3 { margin-left: 25%; } .col-sm-offset-2 { margin-left: 16.66666667%; } .col-sm-offset-1 { margin-left: 8.33333333%; } .col-sm-offset-0 { margin-left: 0%; } } @media (min-width: 992px) { .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 { float: left; } .col-md-12 { width: 100%; } .col-md-11 { width: 91.66666667%; } .col-md-10 { width: 83.33333333%; } .col-md-9 { width: 75%; } .col-md-8 { width: 66.66666667%; } .col-md-7 { width: 58.33333333%; } .col-md-6 { width: 50%; } .col-md-5 { width: 41.66666667%; } .col-md-4 { width: 33.33333333%; } .col-md-3 { width: 25%; } .col-md-2 { width: 16.66666667%; } .col-md-1 { width: 8.33333333%; } .col-md-pull-12 { right: 100%; } .col-md-pull-11 { right: 91.66666667%; } .col-md-pull-10 { right: 83.33333333%; } .col-md-pull-9 { right: 75%; } .col-md-pull-8 { right: 66.66666667%; } .col-md-pull-7 { right: 58.33333333%; } .col-md-pull-6 { right: 50%; } .col-md-pull-5 { right: 41.66666667%; } .col-md-pull-4 { right: 33.33333333%; } .col-md-pull-3 { right: 25%; } .col-md-pull-2 { right: 16.66666667%; } .col-md-pull-1 { right: 8.33333333%; } .col-md-pull-0 { right: auto; } .col-md-push-12 { left: 100%; } .col-md-push-11 { left: 91.66666667%; } .col-md-push-10 { left: 83.33333333%; } .col-md-push-9 { left: 75%; } .col-md-push-8 { left: 66.66666667%; } .col-md-push-7 { left: 58.33333333%; } .col-md-push-6 { left: 50%; } .col-md-push-5 { left: 41.66666667%; } .col-md-push-4 { left: 33.33333333%; } .col-md-push-3 { left: 25%; } .col-md-push-2 { left: 16.66666667%; } .col-md-push-1 { left: 8.33333333%; } .col-md-push-0 { left: auto; } .col-md-offset-12 { margin-left: 100%; } .col-md-offset-11 { margin-left: 91.66666667%; } .col-md-offset-10 { margin-left: 83.33333333%; } .col-md-offset-9 { margin-left: 75%; } .col-md-offset-8 { margin-left: 66.66666667%; } .col-md-offset-7 { margin-left: 58.33333333%; } .col-md-offset-6 { margin-left: 50%; } .col-md-offset-5 { margin-left: 41.66666667%; } .col-md-offset-4 { margin-left: 33.33333333%; } .col-md-offset-3 { margin-left: 25%; } .col-md-offset-2 { margin-left: 16.66666667%; } .col-md-offset-1 { margin-left: 8.33333333%; } .col-md-offset-0 { margin-left: 0%; } } @media (min-width: 1200px) { .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 { float: left; } .col-lg-12 { width: 100%; } .col-lg-11 { width: 91.66666667%; } .col-lg-10 { width: 83.33333333%; } .col-lg-9 { width: 75%; } .col-lg-8 { width: 66.66666667%; } .col-lg-7 { width: 58.33333333%; } .col-lg-6 { width: 50%; } .col-lg-5 { width: 41.66666667%; } .col-lg-4 { width: 33.33333333%; } .col-lg-3 { width: 25%; } .col-lg-2 { width: 16.66666667%; } .col-lg-1 { width: 8.33333333%; } .col-lg-pull-12 { right: 100%; } .col-lg-pull-11 { right: 91.66666667%; } .col-lg-pull-10 { right: 83.33333333%; } .col-lg-pull-9 { right: 75%; } .col-lg-pull-8 { right: 66.66666667%; } .col-lg-pull-7 { right: 58.33333333%; } .col-lg-pull-6 { right: 50%; } .col-lg-pull-5 { right: 41.66666667%; } .col-lg-pull-4 { right: 33.33333333%; } .col-lg-pull-3 { right: 25%; } .col-lg-pull-2 { right: 16.66666667%; } .col-lg-pull-1 { right: 8.33333333%; } .col-lg-pull-0 { right: auto; } .col-lg-push-12 { left: 100%; } .col-lg-push-11 { left: 91.66666667%; } .col-lg-push-10 { left: 83.33333333%; } .col-lg-push-9 { left: 75%; } .col-lg-push-8 { left: 66.66666667%; } .col-lg-push-7 { left: 58.33333333%; } .col-lg-push-6 { left: 50%; } .col-lg-push-5 { left: 41.66666667%; } .col-lg-push-4 { left: 33.33333333%; } .col-lg-push-3 { left: 25%; } .col-lg-push-2 { left: 16.66666667%; } .col-lg-push-1 { left: 8.33333333%; } .col-lg-push-0 { left: auto; } .col-lg-offset-12 { margin-left: 100%; } .col-lg-offset-11 { margin-left: 91.66666667%; } .col-lg-offset-10 { margin-left: 83.33333333%; } .col-lg-offset-9 { margin-left: 75%; } .col-lg-offset-8 { margin-left: 66.66666667%; } .col-lg-offset-7 { margin-left: 58.33333333%; } .col-lg-offset-6 { margin-left: 50%; } .col-lg-offset-5 { margin-left: 41.66666667%; } .col-lg-offset-4 { margin-left: 33.33333333%; } .col-lg-offset-3 { margin-left: 25%; } .col-lg-offset-2 { margin-left: 16.66666667%; } .col-lg-offset-1 { margin-left: 8.33333333%; } .col-lg-offset-0 { margin-left: 0%; } } table { background-color: transparent; } th { text-align: left; } .table { width: 100%; max-width: 100%; margin-bottom: 20px; } .table > thead > tr > th, .table > tbody > tr > th, .table > tfoot > tr > th, .table > thead > tr > td, .table > tbody > tr > td, .table > tfoot > tr > td { padding: 8px; line-height: 1.42857143; vertical-align: top; border-top: 1px solid #dddddd; } .table > thead > tr > th { vertical-align: bottom; border-bottom: 2px solid #dddddd; } .table > caption + thead > tr:first-child > th, .table > colgroup + thead > tr:first-child > th, .table > thead:first-child > tr:first-child > th, .table > caption + thead > tr:first-child > td, .table > colgroup + thead > tr:first-child > td, .table > thead:first-child > tr:first-child > td { border-top: 0; } .table > tbody + tbody { border-top: 2px solid #dddddd; } .table .table { background-color: #ffffff; } .table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td { padding: 5px; } .table-bordered { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td { border: 1px solid #dddddd; } .table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 2px; } .table-striped > tbody > tr:nth-child(odd) > td, .table-striped > tbody > tr:nth-child(odd) > th { background-color: #f9f9f9; } .table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover > th { background-color: #f5f5f5; } 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 > tbody > tr > td.active, .table > tfoot > tr > td.active, .table > thead > tr > th.active, .table > tbody > tr > th.active, .table > tfoot > tr > th.active, .table > thead > tr.active > td, .table > tbody > tr.active > td, .table > tfoot > tr.active > td, .table > thead > tr.active > th, .table > tbody > tr.active > th, .table > tfoot > tr.active > th { background-color: #f5f5f5; } .table-hover > tbody > tr > td.active:hover, .table-hover > tbody > tr > th.active:hover, .table-hover > tbody > tr.active:hover > td, .table-hover > tbody > tr:hover > .active, .table-hover > tbody > tr.active:hover > th { background-color: #e8e8e8; } .table > thead > tr > td.success, .table > tbody > tr > td.success, .table > tfoot > tr > td.success, .table > thead > tr > th.success, .table > tbody > tr > th.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > tbody > tr.success > td, .table > tfoot > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr.success > th, .table > tfoot > tr.success > th { background-color: #dff0d8; } .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr:hover > .success, .table-hover > tbody > tr.success:hover > th { background-color: #d0e9c6; } .table > thead > tr > td.info, .table > tbody > tr > td.info, .table > tfoot > tr > td.info, .table > thead > tr > th.info, .table > tbody > tr > th.info, .table > tfoot > tr > th.info, .table > thead > tr.info > td, .table > tbody > tr.info > td, .table > tfoot > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr.info > th, .table > tfoot > tr.info > th { background-color: #d9edf7; } .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr:hover > .info, .table-hover > tbody > tr.info:hover > th { background-color: #c4e3f3; } .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot > tr > td.warning, .table > thead > tr > th.warning, .table > tbody > tr > th.warning, .table > tfoot > tr > th.warning, .table > thead > tr.warning > td, .table > tbody > tr.warning > td, .table > tfoot > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr.warning > th, .table > tfoot > tr.warning > th { background-color: #fcf8e3; } .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr:hover > .warning, .table-hover > tbody > tr.warning:hover > th { background-color: #faf2cc; } .table > thead > tr > td.danger, .table > tbody > tr > td.danger, .table > tfoot > tr > td.danger, .table > thead > tr > th.danger, .table > tbody > tr > th.danger, .table > tfoot > tr > th.danger, .table > thead > tr.danger > td, .table > tbody > tr.danger > td, .table > tfoot > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr.danger > th, .table > tfoot > tr.danger > th { background-color: #f2dede; } .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr:hover > .danger, .table-hover > tbody > tr.danger:hover > th { background-color: #ebcccc; } @media screen and (max-width: 767px) { .table-responsive { width: 100%; margin-bottom: 15px; overflow-y: hidden; overflow-x: auto; -ms-overflow-style: -ms-autohiding-scrollbar; border: 1px solid #dddddd; -webkit-overflow-scrolling: touch; } .table-responsive > .table { margin-bottom: 0; } .table-responsive > .table > thead > tr > th, .table-responsive > .table > tbody > tr > th, .table-responsive > .table > tfoot > tr > th, .table-responsive > .table > thead > tr > td, .table-responsive > .table > tbody > tr > td, .table-responsive > .table > tfoot > tr > td { white-space: nowrap; } .table-responsive > .table-bordered { border: 0; } .table-responsive > .table-bordered > thead > tr > th:first-child, .table-responsive > .table-bordered > tbody > tr > th:first-child, .table-responsive > .table-bordered > tfoot > tr > th:first-child, .table-responsive > .table-bordered > thead > tr > td:first-child, .table-responsive > .table-bordered > tbody > tr > td:first-child, .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .table-responsive > .table-bordered > thead > tr > th:last-child, .table-responsive > .table-bordered > tbody > tr > th:last-child, .table-responsive > .table-bordered > tfoot > tr > th:last-child, .table-responsive > .table-bordered > thead > tr > td:last-child, .table-responsive > .table-bordered > tbody > tr > td:last-child, .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .table-responsive > .table-bordered > tbody > tr:last-child > th, .table-responsive > .table-bordered > tfoot > tr:last-child > th, .table-responsive > .table-bordered > tbody > tr:last-child > td, .table-responsive > .table-bordered > tfoot > tr:last-child > td { border-bottom: 0; } } fieldset { 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: #333333; border: 0; border-bottom: 1px solid #e5e5e5; } label { display: inline-block; max-width: 100%; margin-bottom: 5px; font-weight: bold; } input[type="search"] { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } input[type="radio"], input[type="checkbox"] { margin: 4px 0 0; margin-top: 1px \9; line-height: normal; } input[type="file"] { display: block; } input[type="range"] { display: block; width: 100%; } select[multiple], select[size] { height: auto; } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } output { display: block; padding-top: 7px; font-size: 14px; line-height: 1.42857143; color: #555555; } .form-control { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555555; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; 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 .15s, box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } .form-control:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); } .form-control::-moz-placeholder { color: #777777; opacity: 1; } .form-control:-ms-input-placeholder { color: #777777; } .form-control::-webkit-input-placeholder { color: #777777; } .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { cursor: not-allowed; background-color: #eeeeee; opacity: 1; } textarea.form-control { height: auto; } input[type="search"] { -webkit-appearance: none; } input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] { line-height: 34px; line-height: 1.42857143 \0; } input[type="date"].input-sm, input[type="time"].input-sm, input[type="datetime-local"].input-sm, input[type="month"].input-sm { line-height: 30px; } input[type="date"].input-lg, input[type="time"].input-lg, input[type="datetime-local"].input-lg, input[type="month"].input-lg { line-height: 46px; } .form-group { margin-bottom: 15px; } .radio, .checkbox { position: relative; display: block; min-height: 20px; margin-top: 10px; margin-bottom: 10px; } .radio label, .checkbox label { 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 { 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="checkbox"][disabled], input[type="radio"].disabled, input[type="checkbox"].disabled, fieldset[disabled] input[type="radio"], fieldset[disabled] input[type="checkbox"] { cursor: not-allowed; } .radio-inline.disabled, .checkbox-inline.disabled, fieldset[disabled] .radio-inline, fieldset[disabled] .checkbox-inline { cursor: not-allowed; } .radio.disabled label, .checkbox.disabled label, fieldset[disabled] .radio label, fieldset[disabled] .checkbox label { cursor: not-allowed; } .form-control-static { padding-top: 7px; padding-bottom: 7px; margin-bottom: 0; } .form-control-static.input-lg, .form-control-static.input-sm { padding-left: 0; padding-right: 0; } .input-sm, .form-horizontal .form-group-sm .form-control { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-sm { height: 30px; line-height: 30px; } textarea.input-sm, select[multiple].input-sm { height: auto; } .input-lg, .form-horizontal .form-group-lg .form-control { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.33; border-radius: 6px; } select.input-lg { height: 46px; line-height: 46px; } textarea.input-lg, select[multiple].input-lg { height: auto; } .has-feedback { position: relative; } .has-feedback .form-control { padding-right: 42.5px; } .form-control-feedback { position: absolute; top: 25px; right: 0; z-index: 2; display: block; width: 34px; height: 34px; line-height: 34px; text-align: center; } .input-lg + .form-control-feedback { width: 46px; height: 46px; line-height: 46px; } .input-sm + .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 { color: #3c763d; } .has-success .form-control { border-color: #3c763d; -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: #2b542c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; } .has-success .input-group-addon { color: #3c763d; border-color: #3c763d; background-color: #dff0d8; } .has-success .form-control-feedback { color: #3c763d; } .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline { color: #8a6d3b; } .has-warning .form-control { border-color: #8a6d3b; -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: #66512c; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; } .has-warning .input-group-addon { color: #8a6d3b; border-color: #8a6d3b; background-color: #fcf8e3; } .has-warning .form-control-feedback { color: #8a6d3b; } .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline { color: #a94442; } .has-error .form-control { border-color: #a94442; -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: #843534; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; } .has-error .input-group-addon { color: #a94442; border-color: #a94442; background-color: #f2dede; } .has-error .form-control-feedback { color: #a94442; } .has-feedback label.sr-only ~ .form-control-feedback { top: 0; } .help-block { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; } @media (min-width: 768px) { .form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; } .form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; } .form-inline .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: 7px; } .form-horizontal .radio, .form-horizontal .checkbox { min-height: 27px; } .form-horizontal .form-group { margin-left: -15px; margin-right: -15px; } @media (min-width: 768px) { .form-horizontal .control-label { text-align: right; margin-bottom: 0; padding-top: 7px; } } .form-horizontal .has-feedback .form-control-feedback { top: 0; right: 15px; } @media (min-width: 768px) { .form-horizontal .form-group-lg .control-label { padding-top: 14.3px; } } @media (min-width: 768px) { .form-horizontal .form-group-sm .control-label { padding-top: 6px; } } .btn { display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .btn:focus, .btn:active:focus, .btn.active:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn:hover, .btn:focus { color: #333333; 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; pointer-events: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; } .btn-default { color: #333333; background-color: #ffffff; border-color: #cccccc; } .btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { color: #333333; background-color: #e6e6e6; border-color: #adadad; } .btn-default:active, .btn-default.active, .open > .dropdown-toggle.btn-default { background-image: none; } .btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active { background-color: #ffffff; border-color: #cccccc; } .btn-default .badge { color: #ffffff; background-color: #333333; } .btn-primary { color: #ffffff; background-color: #428bca; border-color: #357ebd; } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { color: #ffffff; background-color: #3071a9; border-color: #285e8e; } .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary { background-image: none; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #428bca; border-color: #357ebd; } .btn-primary .badge { color: #428bca; background-color: #ffffff; } .btn-success { color: #ffffff; background-color: #5cb85c; border-color: #4cae4c; } .btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { color: #ffffff; background-color: #449d44; border-color: #398439; } .btn-success:active, .btn-success.active, .open > .dropdown-toggle.btn-success { background-image: none; } .btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active { background-color: #5cb85c; border-color: #4cae4c; } .btn-success .badge { color: #5cb85c; background-color: #ffffff; } .btn-info { color: #ffffff; background-color: #5bc0de; border-color: #46b8da; } .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { color: #ffffff; background-color: #31b0d5; border-color: #269abc; } .btn-info:active, .btn-info.active, .open > .dropdown-toggle.btn-info { background-image: none; } .btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active { background-color: #5bc0de; border-color: #46b8da; } .btn-info .badge { color: #5bc0de; background-color: #ffffff; } .btn-warning { color: #ffffff; background-color: #f0ad4e; border-color: #eea236; } .btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { color: #ffffff; background-color: #ec971f; border-color: #d58512; } .btn-warning:active, .btn-warning.active, .open > .dropdown-toggle.btn-warning { background-image: none; } .btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active { background-color: #f0ad4e; border-color: #eea236; } .btn-warning .badge { color: #f0ad4e; background-color: #ffffff; } .btn-danger { color: #ffffff; background-color: #d9534f; border-color: #d43f3a; } .btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { color: #ffffff; background-color: #c9302c; border-color: #ac2925; } .btn-danger:active, .btn-danger.active, .open > .dropdown-toggle.btn-danger { background-image: none; } .btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active { background-color: #d9534f; border-color: #d43f3a; } .btn-danger .badge { color: #d9534f; background-color: #ffffff; } .btn-link { color: #428bca; font-weight: normal; cursor: pointer; border-radius: 0; } .btn-link, .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: #2a6496; text-decoration: underline; background-color: transparent; } .btn-link[disabled]:hover, fieldset[disabled] .btn-link:hover, .btn-link[disabled]:focus, fieldset[disabled] .btn-link:focus { color: #777777; text-decoration: none; } .btn-lg, .btn-group-lg > .btn { padding: 10px 16px; font-size: 18px; line-height: 1.33; 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: height 0.35s ease; -o-transition: height 0.35s ease; transition: height 0.35s ease; } .caret { display: inline-block; width: 0; height: 0; margin-left: 2px; vertical-align: middle; border-top: 4px solid; border-right: 4px solid transparent; border-left: 4px solid transparent; } .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: #ffffff; border: 1px solid #cccccc; border: 1px solid rgba(0, 0, 0, 0.15); 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: #e5e5e5; } .dropdown-menu > li > a { display: block; padding: 3px 20px; clear: both; font-weight: normal; line-height: 1.42857143; color: #333333; white-space: nowrap; } .dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { text-decoration: none; color: #262626; background-color: #f5f5f5; } .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus { color: #ffffff; text-decoration: none; outline: 0; background-color: #428bca; } .dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus { color: #777777; } .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.42857143; color: #777777; 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 solid; content: ""; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 1px; } @media (min-width: 768px) { .navbar-right .dropdown-menu { left: auto; right: 0; } .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-vertical > .btn:hover, .btn-group > .btn:focus, .btn-group-vertical > .btn:focus, .btn-group > .btn:active, .btn-group-vertical > .btn:active, .btn-group > .btn.active, .btn-group-vertical > .btn.active { z-index: 2; } .btn-group > .btn:focus, .btn-group-vertical > .btn:focus { outline: 0; } .btn-group .btn + .btn, .btn-group .btn + .btn-group, .btn-group .btn-group + .btn, .btn-group .btn-group + .btn-group { margin-left: -1px; } .btn-toolbar { margin-left: -5px; } .btn-toolbar .btn-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 > .btn:last-child, .btn-group > .btn-group:first-child > .dropdown-toggle { border-bottom-right-radius: 0; border-top-right-radius: 0; } .btn-group > .btn-group:last-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 { 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 { border-width: 5px 5px 0; border-bottom-width: 0; } .dropup .btn-lg .caret { border-width: 0 5px 5px; } .btn-group-vertical > .btn, .btn-group-vertical > .btn-group, .btn-group-vertical > .btn-group > .btn { display: block; float: none; width: 100%; max-width: 100%; } .btn-group-vertical > .btn-group > .btn { float: none; } .btn-group-vertical > .btn + .btn, .btn-group-vertical > .btn + .btn-group, .btn-group-vertical > .btn-group + .btn, .btn-group-vertical > .btn-group + .btn-group { margin-top: -1px; margin-left: 0; } .btn-group-vertical > .btn:not(:first-child):not(:last-child) { border-radius: 0; } .btn-group-vertical > .btn:first-child:not(:last-child) { border-top-right-radius: 4px; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .btn-group-vertical > .btn:last-child:not(:first-child) { border-bottom-left-radius: 4px; border-top-right-radius: 0; border-top-left-radius: 0; } .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"] { position: absolute; z-index: -1; opacity: 0; filter: alpha(opacity=0); } .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-lg > .form-control, .input-group-lg > .input-group-addon, .input-group-lg > .input-group-btn > .btn { height: 46px; padding: 10px 16px; font-size: 18px; line-height: 1.33; border-radius: 6px; } select.input-group-lg > .form-control, select.input-group-lg > .input-group-addon, select.input-group-lg > .input-group-btn > .btn { height: 46px; line-height: 46px; } textarea.input-group-lg > .form-control, textarea.input-group-lg > .input-group-addon, textarea.input-group-lg > .input-group-btn > .btn, select[multiple].input-group-lg > .form-control, select[multiple].input-group-lg > .input-group-addon, select[multiple].input-group-lg > .input-group-btn > .btn { height: auto; } .input-group-sm > .form-control, .input-group-sm > .input-group-addon, .input-group-sm > .input-group-btn > .btn { height: 30px; padding: 5px 10px; font-size: 12px; line-height: 1.5; border-radius: 3px; } select.input-group-sm > .form-control, select.input-group-sm > .input-group-addon, select.input-group-sm > .input-group-btn > .btn { height: 30px; line-height: 30px; } textarea.input-group-sm > .form-control, textarea.input-group-sm > .input-group-addon, textarea.input-group-sm > .input-group-btn > .btn, select[multiple].input-group-sm > .form-control, select[multiple].input-group-sm > .input-group-addon, select[multiple].input-group-sm > .input-group-btn > .btn { height: auto; } .input-group-addon, .input-group-btn, .input-group .form-control { display: table-cell; } .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child), .input-group .form-control:not(:first-child):not(:last-child) { border-radius: 0; } .input-group-addon, .input-group-btn { width: 1%; white-space: nowrap; vertical-align: middle; } .input-group-addon { padding: 6px 12px; font-size: 14px; font-weight: normal; line-height: 1; color: #555555; text-align: center; background-color: #eeeeee; border: 1px solid #cccccc; border-radius: 4px; } .input-group-addon.input-sm { padding: 5px 10px; font-size: 12px; border-radius: 3px; } .input-group-addon.input-lg { padding: 10px 16px; font-size: 18px; border-radius: 6px; } .input-group-addon input[type="radio"], .input-group-addon input[type="checkbox"] { margin-top: 0; } .input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child > .btn, .input-group-btn:first-child > .btn-group > .btn, .input-group-btn:first-child > .dropdown-toggle, .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), .input-group-btn:last-child > .btn-group:not(:last-child) > .btn { border-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 { margin-left: -1px; } .nav { margin-bottom: 0; padding-left: 0; list-style: none; } .nav > li { position: relative; display: block; } .nav > li > a { position: relative; display: block; padding: 10px 15px; } .nav > li > a:hover, .nav > li > a:focus { text-decoration: none; background-color: #eeeeee; } .nav > li.disabled > a { color: #777777; } .nav > li.disabled > a:hover, .nav > li.disabled > a:focus { color: #777777; text-decoration: none; background-color: transparent; cursor: not-allowed; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background-color: #eeeeee; border-color: #428bca; } .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 #dddddd; } .nav-tabs > li { float: left; margin-bottom: -1px; } .nav-tabs > li > a { margin-right: 2px; line-height: 1.42857143; border: 1px solid transparent; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #dddddd; } .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { color: #555555; background-color: #ffffff; border: 1px solid #dddddd; border-bottom-color: transparent; cursor: default; } .nav-tabs.nav-justified { width: 100%; border-bottom: 0; } .nav-tabs.nav-justified > li { float: none; } .nav-tabs.nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-tabs.nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-tabs.nav-justified > li { display: table-cell; width: 1%; } .nav-tabs.nav-justified > li > a { margin-bottom: 0; } } .nav-tabs.nav-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border: 1px solid #dddddd; } @media (min-width: 768px) { .nav-tabs.nav-justified > li > a { border-bottom: 1px solid #dddddd; border-radius: 4px 4px 0 0; } .nav-tabs.nav-justified > .active > a, .nav-tabs.nav-justified > .active > a:hover, .nav-tabs.nav-justified > .active > a:focus { border-bottom-color: #ffffff; } } .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: #ffffff; background-color: #428bca; } .nav-stacked > li { float: none; } .nav-stacked > li + li { margin-top: 2px; margin-left: 0; } .nav-justified { width: 100%; } .nav-justified > li { float: none; } .nav-justified > li > a { text-align: center; margin-bottom: 5px; } .nav-justified > .dropdown .dropdown-menu { top: auto; left: auto; } @media (min-width: 768px) { .nav-justified > li { display: table-cell; width: 1%; } .nav-justified > li > a { margin-bottom: 0; } } .nav-tabs-justified { border-bottom: 0; } .nav-tabs-justified > li > a { margin-right: 0; border-radius: 4px; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border: 1px solid #dddddd; } @media (min-width: 768px) { .nav-tabs-justified > li > a { border-bottom: 1px solid #dddddd; border-radius: 4px 4px 0 0; } .nav-tabs-justified > .active > a, .nav-tabs-justified > .active > a:hover, .nav-tabs-justified > .active > a:focus { border-bottom-color: #ffffff; } } .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; } @media (min-width: 768px) { .navbar { border-radius: 4px; } } @media (min-width: 768px) { .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.in { overflow-y: auto; } @media (min-width: 768px) { .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-width: 480px) and (orientation: landscape) { .navbar-fixed-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse { max-height: 200px; } } .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { .container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse { margin-right: 0; margin-left: 0; } } .navbar-static-top { z-index: 1000; border-width: 0 0 1px; } @media (min-width: 768px) { .navbar-static-top { border-radius: 0; } } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } @media (min-width: 768px) { .navbar-fixed-top, .navbar-fixed-bottom { border-radius: 0; } } .navbar-fixed-top { top: 0; border-width: 0 0 1px; } .navbar-fixed-bottom { bottom: 0; margin-bottom: 0; border-width: 1px 0 0; } .navbar-brand { float: left; padding: 15px 15px; font-size: 18px; line-height: 20px; height: 50px; } .navbar-brand:hover, .navbar-brand:focus { text-decoration: none; } @media (min-width: 768px) { .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: 768px) { .navbar-toggle { display: none; } } .navbar-nav { margin: 7.5px -15px; } .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; line-height: 20px; } @media (max-width: 767px) { .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin-top: 0; background-color: transparent; border: 0; box-shadow: none; } .navbar-nav .open .dropdown-menu > li > a, .navbar-nav .open .dropdown-menu .dropdown-header { padding: 5px 15px 5px 25px; } .navbar-nav .open .dropdown-menu > li > a { line-height: 20px; } .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-nav .open .dropdown-menu > li > a:focus { background-image: none; } } @media (min-width: 768px) { .navbar-nav { float: left; margin: 0; } .navbar-nav > li { float: left; } .navbar-nav > li > a { padding-top: 15px; padding-bottom: 15px; } .navbar-nav.navbar-right:last-child { margin-right: -15px; } } @media (min-width: 768px) { .navbar-left { float: left !important; float: left; } .navbar-right { float: right !important; float: right; } } .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: 8px; margin-bottom: 8px; } @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 .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; } } @media (min-width: 768px) { .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-form.navbar-right:last-child { margin-right: -15px; } } .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 { border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .navbar-btn { margin-top: 8px; margin-bottom: 8px; } .navbar-btn.btn-sm { margin-top: 10px; margin-bottom: 10px; } .navbar-btn.btn-xs { margin-top: 14px; margin-bottom: 14px; } .navbar-text { margin-top: 15px; margin-bottom: 15px; } @media (min-width: 768px) { .navbar-text { float: left; margin-left: 15px; margin-right: 15px; } .navbar-text.navbar-right:last-child { margin-right: 0; } } .navbar-default { background-color: #f8f8f8; border-color: #e7e7e7; } .navbar-default .navbar-brand { color: #777777; } .navbar-default .navbar-brand:hover, .navbar-default .navbar-brand:focus { color: #5e5e5e; background-color: transparent; } .navbar-default .navbar-text { color: #777777; } .navbar-default .navbar-nav > li > a { color: #777777; } .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus { color: #333333; background-color: transparent; } .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus { color: #555555; background-color: #e7e7e7; } .navbar-default .navbar-nav > .disabled > a, .navbar-default .navbar-nav > .disabled > a:hover, .navbar-default .navbar-nav > .disabled > a:focus { color: #cccccc; background-color: transparent; } .navbar-default .navbar-toggle { border-color: #dddddd; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { background-color: #dddddd; } .navbar-default .navbar-toggle .icon-bar { background-color: #888888; } .navbar-default .navbar-collapse, .navbar-default .navbar-form { border-color: #e7e7e7; } .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { background-color: #e7e7e7; color: #555555; } @media (max-width: 767px) { .navbar-default .navbar-nav .open .dropdown-menu > li > a { color: #777777; } .navbar-default .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > li > a:focus { color: #333333; 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: #555555; background-color: #e7e7e7; } .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-default .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #cccccc; background-color: transparent; } } .navbar-default .navbar-link { color: #777777; } .navbar-default .navbar-link:hover { color: #333333; } .navbar-default .btn-link { color: #777777; } .navbar-default .btn-link:hover, .navbar-default .btn-link:focus { color: #333333; } .navbar-default .btn-link[disabled]:hover, fieldset[disabled] .navbar-default .btn-link:hover, .navbar-default .btn-link[disabled]:focus, fieldset[disabled] .navbar-default .btn-link:focus { color: #cccccc; } .navbar-inverse { background-color: #222222; border-color: #080808; } .navbar-inverse .navbar-brand { color: #777777; } .navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-text { color: #777777; } .navbar-inverse .navbar-nav > li > a { color: #777777; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color: #ffffff; background-color: transparent; } .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus { color: #ffffff; background-color: #080808; } .navbar-inverse .navbar-nav > .disabled > a, .navbar-inverse .navbar-nav > .disabled > a:hover, .navbar-inverse .navbar-nav > .disabled > a:focus { color: #444444; background-color: transparent; } .navbar-inverse .navbar-toggle { border-color: #333333; } .navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { background-color: #333333; } .navbar-inverse .navbar-toggle .icon-bar { background-color: #ffffff; } .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: #080808; color: #ffffff; } @media (max-width: 767px) { .navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { border-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu .divider { background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #777777; } .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { color: #ffffff; 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: #ffffff; background-color: #080808; } .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, .navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus { color: #444444; background-color: transparent; } } .navbar-inverse .navbar-link { color: #777777; } .navbar-inverse .navbar-link:hover { color: #ffffff; } .navbar-inverse .btn-link { color: #777777; } .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link:focus { color: #ffffff; } .navbar-inverse .btn-link[disabled]:hover, fieldset[disabled] .navbar-inverse .btn-link:hover, .navbar-inverse .btn-link[disabled]:focus, fieldset[disabled] .navbar-inverse .btn-link:focus { color: #444444; } .breadcrumb { padding: 8px 15px; margin-bottom: 20px; list-style: none; background-color: #f5f5f5; border-radius: 4px; } .breadcrumb > li { display: inline-block; } .breadcrumb > li + li:before { content: "/\00a0"; padding: 0 5px; color: #cccccc; } .breadcrumb > .active { color: #777777; } .pagination { display: inline-block; padding-left: 0; margin: 20px 0; border-radius: 4px; } .pagination > li { display: inline; } .pagination > li > a, .pagination > li > span { position: relative; float: left; padding: 6px 12px; line-height: 1.42857143; text-decoration: none; color: #428bca; background-color: #ffffff; border: 1px solid #dddddd; 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 > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { color: #2a6496; background-color: #eeeeee; border-color: #dddddd; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index: 2; color: #ffffff; background-color: #428bca; border-color: #428bca; 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: #777777; background-color: #ffffff; border-color: #dddddd; cursor: not-allowed; } .pagination-lg > li > a, .pagination-lg > li > span { padding: 10px 16px; font-size: 18px; } .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; } .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 li { display: inline; } .pager li > a, .pager li > span { display: inline-block; padding: 5px 14px; background-color: #ffffff; border: 1px solid #dddddd; border-radius: 15px; } .pager li > a:hover, .pager li > a:focus { text-decoration: none; background-color: #eeeeee; } .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: #777777; background-color: #ffffff; cursor: not-allowed; } .label { display: inline; padding: .2em .6em .3em; font-size: 75%; font-weight: bold; line-height: 1; color: #ffffff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .25em; } a.label:hover, a.label:focus { color: #ffffff; text-decoration: none; cursor: pointer; } .label:empty { display: none; } .btn .label { position: relative; top: -1px; } .label-default { background-color: #777777; } .label-default[href]:hover, .label-default[href]:focus { background-color: #5e5e5e; } .label-primary { background-color: #428bca; } .label-primary[href]:hover, .label-primary[href]:focus { background-color: #3071a9; } .label-success { background-color: #5cb85c; } .label-success[href]:hover, .label-success[href]:focus { background-color: #449d44; } .label-info { background-color: #5bc0de; } .label-info[href]:hover, .label-info[href]:focus { background-color: #31b0d5; } .label-warning { background-color: #f0ad4e; } .label-warning[href]:hover, .label-warning[href]:focus { background-color: #ec971f; } .label-danger { background-color: #d9534f; } .label-danger[href]:hover, .label-danger[href]:focus { background-color: #c9302c; } .badge { display: inline-block; min-width: 10px; padding: 3px 7px; font-size: 12px; font-weight: bold; color: #ffffff; line-height: 1; vertical-align: baseline; white-space: nowrap; text-align: center; background-color: #777777; border-radius: 10px; } .badge:empty { display: none; } .btn .badge { position: relative; top: -1px; } .btn-xs .badge { top: 0; padding: 1px 5px; } a.badge:hover, a.badge:focus { color: #ffffff; text-decoration: none; cursor: pointer; } a.list-group-item.active > .badge, .nav-pills > .active > a > .badge { color: #428bca; background-color: #ffffff; } .nav-pills > li > a > .badge { margin-left: 3px; } .jumbotron { padding: 30px; margin-bottom: 30px; color: inherit; background-color: #eeeeee; } .jumbotron h1, .jumbotron .h1 { color: inherit; } .jumbotron p { margin-bottom: 15px; font-size: 21px; font-weight: 200; } .jumbotron > hr { border-top-color: #d5d5d5; } .container .jumbotron { border-radius: 6px; } .jumbotron .container { max-width: 100%; } @media screen and (min-width: 768px) { .jumbotron { padding-top: 48px; padding-bottom: 48px; } .container .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.42857143; background-color: #ffffff; border: 1px solid #dddddd; 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; } .thumbnail > img, .thumbnail a > img { margin-left: auto; margin-right: auto; } a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active { border-color: #428bca; } .thumbnail .caption { padding: 9px; color: #333333; } .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: #dff0d8; border-color: #d6e9c6; color: #3c763d; } .alert-success hr { border-top-color: #c9e2b3; } .alert-success .alert-link { color: #2b542c; } .alert-info { background-color: #d9edf7; border-color: #bce8f1; color: #31708f; } .alert-info hr { border-top-color: #a6e1ec; } .alert-info .alert-link { color: #245269; } .alert-warning { background-color: #fcf8e3; border-color: #faebcc; color: #8a6d3b; } .alert-warning hr { border-top-color: #f7e1b5; } .alert-warning .alert-link { color: #66512c; } .alert-danger { background-color: #f2dede; border-color: #ebccd1; color: #a94442; } .alert-danger hr { border-top-color: #e4b9c0; } .alert-danger .alert-link { color: #843534; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { overflow: hidden; height: 20px; margin-bottom: 20px; background-color: #f5f5f5; 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: #ffffff; text-align: center; background-color: #428bca; -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[aria-valuenow="1"], .progress-bar[aria-valuenow="2"] { min-width: 30px; } .progress-bar[aria-valuenow="0"] { color: #777777; min-width: 30px; background-color: transparent; background-image: none; box-shadow: none; } .progress-bar-success { background-color: #5cb85c; } .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: #5bc0de; } .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: #f0ad4e; } .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: #d9534f; } .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, .media-body { overflow: hidden; zoom: 1; } .media, .media .media { margin-top: 15px; } .media:first-child { margin-top: 0; } .media-object { display: block; } .media-heading { margin: 0 0 5px; } .media > .pull-left { margin-right: 10px; } .media > .pull-right { margin-left: 10px; } .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: #ffffff; border: 1px solid #dddddd; } .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; } .list-group-item > .badge { float: right; } .list-group-item > .badge + .badge { margin-right: 5px; } a.list-group-item { color: #555555; } a.list-group-item .list-group-item-heading { color: #333333; } a.list-group-item:hover, a.list-group-item:focus { text-decoration: none; color: #555555; background-color: #f5f5f5; } .list-group-item.disabled, .list-group-item.disabled:hover, .list-group-item.disabled:focus { background-color: #eeeeee; color: #777777; } .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: #777777; } .list-group-item.active, .list-group-item.active:hover, .list-group-item.active:focus { z-index: 2; color: #ffffff; background-color: #428bca; border-color: #428bca; } .list-group-item.active .list-group-item-heading, .list-group-item.active:hover .list-group-item-heading, .list-group-item.active:focus .list-group-item-heading, .list-group-item.active .list-group-item-heading > small, .list-group-item.active:hover .list-group-item-heading > small, .list-group-item.active:focus .list-group-item-heading > small, .list-group-item.active .list-group-item-heading > .small, .list-group-item.active:hover .list-group-item-heading > .small, .list-group-item.active:focus .list-group-item-heading > .small { color: inherit; } .list-group-item.active .list-group-item-text, .list-group-item.active:hover .list-group-item-text, .list-group-item.active:focus .list-group-item-text { color: #e1edf7; } .list-group-item-success { color: #3c763d; background-color: #dff0d8; } a.list-group-item-success { color: #3c763d; } a.list-group-item-success .list-group-item-heading { color: inherit; } a.list-group-item-success:hover, a.list-group-item-success:focus { color: #3c763d; background-color: #d0e9c6; } a.list-group-item-success.active, a.list-group-item-success.active:hover, a.list-group-item-success.active:focus { color: #fff; background-color: #3c763d; border-color: #3c763d; } .list-group-item-info { color: #31708f; background-color: #d9edf7; } a.list-group-item-info { color: #31708f; } a.list-group-item-info .list-group-item-heading { color: inherit; } a.list-group-item-info:hover, a.list-group-item-info:focus { color: #31708f; background-color: #c4e3f3; } a.list-group-item-info.active, a.list-group-item-info.active:hover, a.list-group-item-info.active:focus { color: #fff; background-color: #31708f; border-color: #31708f; } .list-group-item-warning { color: #8a6d3b; background-color: #fcf8e3; } a.list-group-item-warning { color: #8a6d3b; } a.list-group-item-warning .list-group-item-heading { color: inherit; } a.list-group-item-warning:hover, a.list-group-item-warning:focus { color: #8a6d3b; background-color: #faf2cc; } a.list-group-item-warning.active, a.list-group-item-warning.active:hover, a.list-group-item-warning.active:focus { color: #fff; background-color: #8a6d3b; border-color: #8a6d3b; } .list-group-item-danger { color: #a94442; background-color: #f2dede; } a.list-group-item-danger { color: #a94442; } a.list-group-item-danger .list-group-item-heading { color: inherit; } a.list-group-item-danger:hover, a.list-group-item-danger:focus { color: #a94442; background-color: #ebcccc; } a.list-group-item-danger.active, a.list-group-item-danger.active:hover, a.list-group-item-danger.active:focus { color: #fff; background-color: #a94442; border-color: #a94442; } .list-group-item-heading { margin-top: 0; margin-bottom: 5px; } .list-group-item-text { margin-bottom: 0; line-height: 1.3; } .panel { margin-bottom: 20px; background-color: #ffffff; 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-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 { color: inherit; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #dddddd; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .list-group { margin-bottom: 0; } .panel > .list-group .list-group-item { border-width: 1px 0; border-radius: 0; } .panel > .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 { border-bottom: 0; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .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: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 td:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:first-child, .panel > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:first-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:first-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:first-child { border-top-left-radius: 3px; } .panel > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child td:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child td:last-child, .panel > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > thead:first-child > tr:first-child th:last-child, .panel > .table:first-child > tbody:first-child > tr:first-child th:last-child, .panel > .table-responsive:first-child > .table:first-child > tbody:first-child > tr:first-child th:last-child { border-top-right-radius: 3px; } .panel > .table:last-child, .panel > .table-responsive:last-child > .table:last-child { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:first-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:first-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:first-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:first-child { border-bottom-left-radius: 3px; } .panel > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child td:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child td:last-child, .panel > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tbody:last-child > tr:last-child th:last-child, .panel > .table:last-child > tfoot:last-child > tr:last-child th:last-child, .panel > .table-responsive:last-child > .table:last-child > tfoot:last-child > tr:last-child th:last-child { border-bottom-right-radius: 3px; } .panel > .panel-body + .table, .panel > .panel-body + .table-responsive { border-top: 1px solid #dddddd; } .panel > .table > tbody:first-child > tr:first-child th, .panel > .table > tbody:first-child > tr:first-child td { border-top: 0; } .panel > .table-bordered, .panel > .table-responsive > .table-bordered { border: 0; } .panel > .table-bordered > thead > tr > th:first-child, .panel > .table-responsive > .table-bordered > thead > tr > th:first-child, .panel > .table-bordered > tbody > tr > th:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:first-child, .panel > .table-bordered > tfoot > tr > th:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:first-child, .panel > .table-bordered > thead > tr > td:first-child, .panel > .table-responsive > .table-bordered > thead > tr > td:first-child, .panel > .table-bordered > tbody > tr > td:first-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:first-child, .panel > .table-bordered > tfoot > tr > td:first-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:first-child { border-left: 0; } .panel > .table-bordered > thead > tr > th:last-child, .panel > .table-responsive > .table-bordered > thead > tr > th:last-child, .panel > .table-bordered > tbody > tr > th:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > th:last-child, .panel > .table-bordered > tfoot > tr > th:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > th:last-child, .panel > .table-bordered > thead > tr > td:last-child, .panel > .table-responsive > .table-bordered > thead > tr > td:last-child, .panel > .table-bordered > tbody > tr > td:last-child, .panel > .table-responsive > .table-bordered > tbody > tr > td:last-child, .panel > .table-bordered > tfoot > tr > td:last-child, .panel > .table-responsive > .table-bordered > tfoot > tr > td:last-child { border-right: 0; } .panel > .table-bordered > thead > tr:first-child > td, .panel > .table-responsive > .table-bordered > thead > tr:first-child > td, .panel > .table-bordered > tbody > tr:first-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > td, .panel > .table-bordered > thead > tr:first-child > th, .panel > .table-responsive > .table-bordered > thead > tr:first-child > th, .panel > .table-bordered > tbody > tr:first-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:first-child > th { border-bottom: 0; } .panel > .table-bordered > tbody > tr:last-child > td, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > td, .panel > .table-bordered > tfoot > tr:last-child > td, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > td, .panel > .table-bordered > tbody > tr:last-child > th, .panel > .table-responsive > .table-bordered > tbody > tr:last-child > th, .panel > .table-bordered > tfoot > tr:last-child > th, .panel > .table-responsive > .table-bordered > tfoot > tr:last-child > th { border-bottom: 0; } .panel > .table-responsive { 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 { border-top: 1px solid #dddddd; } .panel-group .panel-footer { border-top: 0; } .panel-group .panel-footer + .panel-collapse .panel-body { border-bottom: 1px solid #dddddd; } .panel-default { border-color: #dddddd; } .panel-default > .panel-heading { color: #333333; background-color: #f5f5f5; border-color: #dddddd; } .panel-default > .panel-heading + .panel-collapse > .panel-body { border-top-color: #dddddd; } .panel-default > .panel-heading .badge { color: #f5f5f5; background-color: #333333; } .panel-default > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #dddddd; } .panel-primary { border-color: #428bca; } .panel-primary > .panel-heading { color: #ffffff; background-color: #428bca; border-color: #428bca; } .panel-primary > .panel-heading + .panel-collapse > .panel-body { border-top-color: #428bca; } .panel-primary > .panel-heading .badge { color: #428bca; background-color: #ffffff; } .panel-primary > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #428bca; } .panel-success { border-color: #d6e9c6; } .panel-success > .panel-heading { color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6; } .panel-success > .panel-heading + .panel-collapse > .panel-body { border-top-color: #d6e9c6; } .panel-success > .panel-heading .badge { color: #dff0d8; background-color: #3c763d; } .panel-success > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #d6e9c6; } .panel-info { border-color: #bce8f1; } .panel-info > .panel-heading { color: #31708f; background-color: #d9edf7; border-color: #bce8f1; } .panel-info > .panel-heading + .panel-collapse > .panel-body { border-top-color: #bce8f1; } .panel-info > .panel-heading .badge { color: #d9edf7; background-color: #31708f; } .panel-info > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #bce8f1; } .panel-warning { border-color: #faebcc; } .panel-warning > .panel-heading { color: #8a6d3b; background-color: #fcf8e3; border-color: #faebcc; } .panel-warning > .panel-heading + .panel-collapse > .panel-body { border-top-color: #faebcc; } .panel-warning > .panel-heading .badge { color: #fcf8e3; background-color: #8a6d3b; } .panel-warning > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #faebcc; } .panel-danger { border-color: #ebccd1; } .panel-danger > .panel-heading { color: #a94442; background-color: #f2dede; border-color: #ebccd1; } .panel-danger > .panel-heading + .panel-collapse > .panel-body { border-top-color: #ebccd1; } .panel-danger > .panel-heading .badge { color: #f2dede; background-color: #a94442; } .panel-danger > .panel-footer + .panel-collapse > .panel-body { border-bottom-color: #ebccd1; } .embed-responsive { position: relative; display: block; height: 0; padding: 0; overflow: hidden; } .embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object { position: absolute; top: 0; left: 0; bottom: 0; height: 100%; width: 100%; border: 0; } .embed-responsive.embed-responsive-16by9 { padding-bottom: 56.25%; } .embed-responsive.embed-responsive-4by3 { padding-bottom: 75%; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #e3e3e3; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 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: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20); } .close:hover, .close:focus { color: #000000; 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: translate3d(0, -25%, 0); transform: translate3d(0, -25%, 0); -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: translate3d(0, 0, 0); transform: translate3d(0, 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: #ffffff; border: 1px solid #999999; 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: #000000; } .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 #e5e5e5; min-height: 16.42857143px; } .modal-header .close { margin-top: -2px; } .modal-title { margin: 0; line-height: 1.42857143; } .modal-body { position: relative; padding: 15px; } .modal-footer { padding: 15px; text-align: right; border-top: 1px solid #e5e5e5; } .modal-footer .btn + .btn { margin-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; visibility: visible; font-size: 12px; line-height: 1.4; 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: #ffffff; text-align: center; text-decoration: none; background-color: #000000; 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: #000000; } .tooltip.top-left .tooltip-arrow { bottom: 0; left: 5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.top-right .tooltip-arrow { bottom: 0; right: 5px; border-width: 5px 5px 0; border-top-color: #000000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #000000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #000000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .tooltip.bottom-left .tooltip-arrow { top: 0; left: 5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .tooltip.bottom-right .tooltip-arrow { top: 0; right: 5px; border-width: 0 5px 5px; border-bottom-color: #000000; } .popover { position: absolute; top: 0; left: 0; z-index: 1060; display: none; max-width: 276px; padding: 1px; text-align: left; background-color: #ffffff; background-clip: padding-box; border: 1px solid #cccccc; 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); white-space: normal; } .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; font-weight: normal; line-height: 18px; background-color: #f7f7f7; border-bottom: 1px solid #ebebeb; border-radius: 5px 5px 0 0; } .popover-content { padding: 9px 14px; } .popover > .arrow, .popover > .arrow:after { position: absolute; display: block; width: 0; height: 0; border-color: transparent; border-style: solid; } .popover > .arrow { border-width: 11px; } .popover > .arrow:after { border-width: 10px; content: ""; } .popover.top > .arrow { left: 50%; margin-left: -11px; border-bottom-width: 0; border-top-color: #999999; border-top-color: rgba(0, 0, 0, 0.25); bottom: -11px; } .popover.top > .arrow:after { content: " "; bottom: 1px; margin-left: -10px; border-bottom-width: 0; border-top-color: #ffffff; } .popover.right > .arrow { top: 50%; left: -11px; margin-top: -11px; border-left-width: 0; border-right-color: #999999; border-right-color: rgba(0, 0, 0, 0.25); } .popover.right > .arrow:after { content: " "; left: 1px; bottom: -10px; border-left-width: 0; border-right-color: #ffffff; } .popover.bottom > .arrow { left: 50%; margin-left: -11px; border-top-width: 0; border-bottom-color: #999999; border-bottom-color: rgba(0, 0, 0, 0.25); top: -11px; } .popover.bottom > .arrow:after { content: " "; top: 1px; margin-left: -10px; border-top-width: 0; border-bottom-color: #ffffff; } .popover.left > .arrow { top: 50%; right: -11px; margin-top: -11px; border-right-width: 0; border-left-color: #999999; border-left-color: rgba(0, 0, 0, 0.25); } .popover.left > .arrow:after { content: " "; right: 1px; border-right-width: 0; border-left-color: #ffffff; 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 { line-height: 1; } .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: #ffffff; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); } .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: #ffffff; 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%; 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; margin-top: -10px; 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 #ffffff; border-radius: 10px; cursor: pointer; background-color: #000 \9; background-color: rgba(0, 0, 0, 0); } .carousel-indicators .active { margin: 0; width: 12px; height: 12px; background-color: #ffffff; } .carousel-caption { position: absolute; left: 15%; right: 15%; bottom: 20px; z-index: 10; padding-top: 20px; padding-bottom: 20px; color: #ffffff; 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: -15px; font-size: 30px; } .carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev { margin-left: -15px; } .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next { margin-right: -15px; } .carousel-caption { left: 20%; right: 20%; padding-bottom: 30px; } .carousel-indicators { bottom: 20px; } } .clearfix:before, .clearfix:after, .dl-horizontal dd:before, .dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after, .form-horizontal .form-group:before, .form-horizontal .form-group:after, .btn-toolbar:before, .btn-toolbar:after, .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after, .nav:before, .nav:after, .navbar:before, .navbar:after, .navbar-header:before, .navbar-header:after, .navbar-collapse:before, .navbar-collapse:after, .pager:before, .pager:after, .panel-body:before, .panel-body:after, .modal-footer:before, .modal-footer:after, html.boxed-layout #layout-main-container:before, html.boxed-layout #layout-main-container:after, html.boxed-layout #layout-tripel-container:before, html.boxed-layout #layout-tripel-container:after, html.boxed-layout #layout-footer:before, html.boxed-layout #layout-footer:after, html.fixed-nav.boxed-layout #layout-navigation:before, html.fixed-nav.boxed-layout #layout-navigation:after, html.floating-nav.boxed-layout .navbar-wrapper:before, html.floating-nav.boxed-layout .navbar-wrapper:after, #layout-main:before, #layout-main:after, #layout-tripel:before, #layout-tripel:after, #footer-quad:before, #footer-quad:after, html.sticky-footer.boxed-layout #footer:before, html.sticky-footer.boxed-layout #footer:after, html.orchard-users form:before, html.orchard-users form:after { content: " "; display: table; } .clearfix:after, .dl-horizontal dd:after, .container:after, .container-fluid:after, .row:after, .form-horizontal .form-group:after, .btn-toolbar:after, .btn-group-vertical > .btn-group:after, .nav:after, .navbar:after, .navbar-header:after, .navbar-collapse:after, .pager:after, .panel-body:after, .modal-footer:after, html.boxed-layout #layout-main-container:after, html.boxed-layout #layout-tripel-container:after, html.boxed-layout #layout-footer:after, html.fixed-nav.boxed-layout #layout-navigation:after, html.floating-nav.boxed-layout .navbar-wrapper:after, #layout-main:after, #layout-tripel:after, #footer-quad:after, html.sticky-footer.boxed-layout #footer:after, html.orchard-users form: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; visibility: hidden !important; } .affix { position: fixed; -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); } @-ms-viewport { width: device-width; } .visible-xs, .visible-sm, .visible-md, .visible-lg { display: none !important; } .visible-xs-block, .visible-xs-inline, .visible-xs-inline-block, .visible-sm-block, .visible-sm-inline, .visible-sm-inline-block, .visible-md-block, .visible-md-inline, .visible-md-inline-block, .visible-lg-block, .visible-lg-inline, .visible-lg-inline-block { display: none !important; } @media (max-width: 767px) { .visible-xs { display: block !important; } table.visible-xs { display: table; } 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; } 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; } 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; } 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; } 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; } } /*! * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) */ /* FONT PATH * -------------------------- */ @font-face { font-family: 'FontAwesome'; src: url('font-awesome-4.2.0/fonts/fontawesome-webfont.eot?v=4.2.0'); src: url('font-awesome-4.2.0/fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('font-awesome-4.2.0/fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('font-awesome-4.2.0/fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('font-awesome-4.2.0/fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; } .fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } /* makes the font 33% larger relative to the icon container */ .fa-lg { font-size: 1.33333333em; line-height: 0.75em; vertical-align: -15%; } .fa-2x { font-size: 2em; } .fa-3x { font-size: 3em; } .fa-4x { font-size: 4em; } .fa-5x { font-size: 5em; } .fa-fw { width: 1.28571429em; text-align: center; } .fa-ul { padding-left: 0; margin-left: 2.14285714em; list-style-type: none; } .fa-ul > li { position: relative; } .fa-li { position: absolute; left: -2.14285714em; width: 2.14285714em; top: 0.14285714em; text-align: center; } .fa-li.fa-lg { left: -1.85714286em; } .fa-border { padding: .2em .25em .15em; border: solid 0.08em #eeeeee; border-radius: .1em; } .pull-right { float: right; } .pull-left { float: left; } .fa.pull-left { margin-right: .3em; } .fa.pull-right { margin-left: .3em; } .fa-spin { -webkit-animation: fa-spin 2s infinite linear; animation: fa-spin 2s infinite linear; } @-webkit-keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } @keyframes fa-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } .fa-rotate-90 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } .fa-rotate-180 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } .fa-rotate-270 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -webkit-transform: rotate(270deg); -ms-transform: rotate(270deg); transform: rotate(270deg); } .fa-flip-horizontal { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); -webkit-transform: scale(-1, 1); -ms-transform: scale(-1, 1); transform: scale(-1, 1); } .fa-flip-vertical { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); -webkit-transform: scale(1, -1); -ms-transform: scale(1, -1); transform: scale(1, -1); } :root .fa-rotate-90, :root .fa-rotate-180, :root .fa-rotate-270, :root .fa-flip-horizontal, :root .fa-flip-vertical { filter: none; } .fa-stack { position: relative; display: inline-block; width: 2em; height: 2em; line-height: 2em; vertical-align: middle; } .fa-stack-1x, .fa-stack-2x { position: absolute; left: 0; width: 100%; text-align: center; } .fa-stack-1x { line-height: inherit; } .fa-stack-2x { font-size: 2em; } .fa-inverse { color: #ffffff; } /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons */ .fa-glass:before { content: "\f000"; } .fa-music:before { content: "\f001"; } .fa-search:before { content: "\f002"; } .fa-envelope-o:before { content: "\f003"; } .fa-heart:before { content: "\f004"; } .fa-star:before { content: "\f005"; } .fa-star-o:before { content: "\f006"; } .fa-user:before { content: "\f007"; } .fa-film:before { content: "\f008"; } .fa-th-large:before { content: "\f009"; } .fa-th:before { content: "\f00a"; } .fa-th-list:before { content: "\f00b"; } .fa-check:before { content: "\f00c"; } .fa-remove:before, .fa-close:before, .fa-times:before { content: "\f00d"; } .fa-search-plus:before { content: "\f00e"; } .fa-search-minus:before { content: "\f010"; } .fa-power-off:before { content: "\f011"; } .fa-signal:before { content: "\f012"; } .fa-gear:before, .fa-cog:before { content: "\f013"; } .fa-trash-o:before { content: "\f014"; } .fa-home:before { content: "\f015"; } .fa-file-o:before { content: "\f016"; } .fa-clock-o:before { content: "\f017"; } .fa-road:before { content: "\f018"; } .fa-download:before { content: "\f019"; } .fa-arrow-circle-o-down:before { content: "\f01a"; } .fa-arrow-circle-o-up:before { content: "\f01b"; } .fa-inbox:before { content: "\f01c"; } .fa-play-circle-o:before { content: "\f01d"; } .fa-rotate-right:before, .fa-repeat:before { content: "\f01e"; } .fa-refresh:before { content: "\f021"; } .fa-list-alt:before { content: "\f022"; } .fa-lock:before { content: "\f023"; } .fa-flag:before { content: "\f024"; } .fa-headphones:before { content: "\f025"; } .fa-volume-off:before { content: "\f026"; } .fa-volume-down:before { content: "\f027"; } .fa-volume-up:before { content: "\f028"; } .fa-qrcode:before { content: "\f029"; } .fa-barcode:before { content: "\f02a"; } .fa-tag:before { content: "\f02b"; } .fa-tags:before { content: "\f02c"; } .fa-book:before { content: "\f02d"; } .fa-bookmark:before { content: "\f02e"; } .fa-print:before { content: "\f02f"; } .fa-camera:before { content: "\f030"; } .fa-font:before { content: "\f031"; } .fa-bold:before { content: "\f032"; } .fa-italic:before { content: "\f033"; } .fa-text-height:before { content: "\f034"; } .fa-text-width:before { content: "\f035"; } .fa-align-left:before { content: "\f036"; } .fa-align-center:before { content: "\f037"; } .fa-align-right:before { content: "\f038"; } .fa-align-justify:before { content: "\f039"; } .fa-list:before { content: "\f03a"; } .fa-dedent:before, .fa-outdent:before { content: "\f03b"; } .fa-indent:before { content: "\f03c"; } .fa-video-camera:before { content: "\f03d"; } .fa-photo:before, .fa-image:before, .fa-picture-o:before { content: "\f03e"; } .fa-pencil:before { content: "\f040"; } .fa-map-marker:before { content: "\f041"; } .fa-adjust:before { content: "\f042"; } .fa-tint:before { content: "\f043"; } .fa-edit:before, .fa-pencil-square-o:before { content: "\f044"; } .fa-share-square-o:before { content: "\f045"; } .fa-check-square-o:before { content: "\f046"; } .fa-arrows:before { content: "\f047"; } .fa-step-backward:before { content: "\f048"; } .fa-fast-backward:before { content: "\f049"; } .fa-backward:before { content: "\f04a"; } .fa-play:before { content: "\f04b"; } .fa-pause:before { content: "\f04c"; } .fa-stop:before { content: "\f04d"; } .fa-forward:before { content: "\f04e"; } .fa-fast-forward:before { content: "\f050"; } .fa-step-forward:before { content: "\f051"; } .fa-eject:before { content: "\f052"; } .fa-chevron-left:before { content: "\f053"; } .fa-chevron-right:before { content: "\f054"; } .fa-plus-circle:before { content: "\f055"; } .fa-minus-circle:before { content: "\f056"; } .fa-times-circle:before { content: "\f057"; } .fa-check-circle:before { content: "\f058"; } .fa-question-circle:before { content: "\f059"; } .fa-info-circle:before { content: "\f05a"; } .fa-crosshairs:before { content: "\f05b"; } .fa-times-circle-o:before { content: "\f05c"; } .fa-check-circle-o:before { content: "\f05d"; } .fa-ban:before { content: "\f05e"; } .fa-arrow-left:before { content: "\f060"; } .fa-arrow-right:before { content: "\f061"; } .fa-arrow-up:before { content: "\f062"; } .fa-arrow-down:before { content: "\f063"; } .fa-mail-forward:before, .fa-share:before { content: "\f064"; } .fa-expand:before { content: "\f065"; } .fa-compress:before { content: "\f066"; } .fa-plus:before { content: "\f067"; } .fa-minus:before { content: "\f068"; } .fa-asterisk:before { content: "\f069"; } .fa-exclamation-circle:before { content: "\f06a"; } .fa-gift:before { content: "\f06b"; } .fa-leaf:before { content: "\f06c"; } .fa-fire:before { content: "\f06d"; } .fa-eye:before { content: "\f06e"; } .fa-eye-slash:before { content: "\f070"; } .fa-warning:before, .fa-exclamation-triangle:before { content: "\f071"; } .fa-plane:before { content: "\f072"; } .fa-calendar:before { content: "\f073"; } .fa-random:before { content: "\f074"; } .fa-comment:before { content: "\f075"; } .fa-magnet:before { content: "\f076"; } .fa-chevron-up:before { content: "\f077"; } .fa-chevron-down:before { content: "\f078"; } .fa-retweet:before { content: "\f079"; } .fa-shopping-cart:before { content: "\f07a"; } .fa-folder:before { content: "\f07b"; } .fa-folder-open:before { content: "\f07c"; } .fa-arrows-v:before { content: "\f07d"; } .fa-arrows-h:before { content: "\f07e"; } .fa-bar-chart-o:before, .fa-bar-chart:before { content: "\f080"; } .fa-twitter-square:before { content: "\f081"; } .fa-facebook-square:before { content: "\f082"; } .fa-camera-retro:before { content: "\f083"; } .fa-key:before { content: "\f084"; } .fa-gears:before, .fa-cogs:before { content: "\f085"; } .fa-comments:before { content: "\f086"; } .fa-thumbs-o-up:before { content: "\f087"; } .fa-thumbs-o-down:before { content: "\f088"; } .fa-star-half:before { content: "\f089"; } .fa-heart-o:before { content: "\f08a"; } .fa-sign-out:before { content: "\f08b"; } .fa-linkedin-square:before { content: "\f08c"; } .fa-thumb-tack:before { content: "\f08d"; } .fa-external-link:before { content: "\f08e"; } .fa-sign-in:before { content: "\f090"; } .fa-trophy:before { content: "\f091"; } .fa-github-square:before { content: "\f092"; } .fa-upload:before { content: "\f093"; } .fa-lemon-o:before { content: "\f094"; } .fa-phone:before { content: "\f095"; } .fa-square-o:before { content: "\f096"; } .fa-bookmark-o:before { content: "\f097"; } .fa-phone-square:before { content: "\f098"; } .fa-twitter:before { content: "\f099"; } .fa-facebook:before { content: "\f09a"; } .fa-github:before { content: "\f09b"; } .fa-unlock:before { content: "\f09c"; } .fa-credit-card:before { content: "\f09d"; } .fa-rss:before { content: "\f09e"; } .fa-hdd-o:before { content: "\f0a0"; } .fa-bullhorn:before { content: "\f0a1"; } .fa-bell:before { content: "\f0f3"; } .fa-certificate:before { content: "\f0a3"; } .fa-hand-o-right:before { content: "\f0a4"; } .fa-hand-o-left:before { content: "\f0a5"; } .fa-hand-o-up:before { content: "\f0a6"; } .fa-hand-o-down:before { content: "\f0a7"; } .fa-arrow-circle-left:before { content: "\f0a8"; } .fa-arrow-circle-right:before { content: "\f0a9"; } .fa-arrow-circle-up:before { content: "\f0aa"; } .fa-arrow-circle-down:before { content: "\f0ab"; } .fa-globe:before { content: "\f0ac"; } .fa-wrench:before { content: "\f0ad"; } .fa-tasks:before { content: "\f0ae"; } .fa-filter:before { content: "\f0b0"; } .fa-briefcase:before { content: "\f0b1"; } .fa-arrows-alt:before { content: "\f0b2"; } .fa-group:before, .fa-users:before { content: "\f0c0"; } .fa-chain:before, .fa-link:before { content: "\f0c1"; } .fa-cloud:before { content: "\f0c2"; } .fa-flask:before { content: "\f0c3"; } .fa-cut:before, .fa-scissors:before { content: "\f0c4"; } .fa-copy:before, .fa-files-o:before { content: "\f0c5"; } .fa-paperclip:before { content: "\f0c6"; } .fa-save:before, .fa-floppy-o:before { content: "\f0c7"; } .fa-square:before { content: "\f0c8"; } .fa-navicon:before, .fa-reorder:before, .fa-bars:before { content: "\f0c9"; } .fa-list-ul:before { content: "\f0ca"; } .fa-list-ol:before { content: "\f0cb"; } .fa-strikethrough:before { content: "\f0cc"; } .fa-underline:before { content: "\f0cd"; } .fa-table:before { content: "\f0ce"; } .fa-magic:before { content: "\f0d0"; } .fa-truck:before { content: "\f0d1"; } .fa-pinterest:before { content: "\f0d2"; } .fa-pinterest-square:before { content: "\f0d3"; } .fa-google-plus-square:before { content: "\f0d4"; } .fa-google-plus:before { content: "\f0d5"; } .fa-money:before { content: "\f0d6"; } .fa-caret-down:before { content: "\f0d7"; } .fa-caret-up:before { content: "\f0d8"; } .fa-caret-left:before { content: "\f0d9"; } .fa-caret-right:before { content: "\f0da"; } .fa-columns:before { content: "\f0db"; } .fa-unsorted:before, .fa-sort:before { content: "\f0dc"; } .fa-sort-down:before, .fa-sort-desc:before { content: "\f0dd"; } .fa-sort-up:before, .fa-sort-asc:before { content: "\f0de"; } .fa-envelope:before { content: "\f0e0"; } .fa-linkedin:before { content: "\f0e1"; } .fa-rotate-left:before, .fa-undo:before { content: "\f0e2"; } .fa-legal:before, .fa-gavel:before { content: "\f0e3"; } .fa-dashboard:before, .fa-tachometer:before { content: "\f0e4"; } .fa-comment-o:before { content: "\f0e5"; } .fa-comments-o:before { content: "\f0e6"; } .fa-flash:before, .fa-bolt:before { content: "\f0e7"; } .fa-sitemap:before { content: "\f0e8"; } .fa-umbrella:before { content: "\f0e9"; } .fa-paste:before, .fa-clipboard:before { content: "\f0ea"; } .fa-lightbulb-o:before { content: "\f0eb"; } .fa-exchange:before { content: "\f0ec"; } .fa-cloud-download:before { content: "\f0ed"; } .fa-cloud-upload:before { content: "\f0ee"; } .fa-user-md:before { content: "\f0f0"; } .fa-stethoscope:before { content: "\f0f1"; } .fa-suitcase:before { content: "\f0f2"; } .fa-bell-o:before { content: "\f0a2"; } .fa-coffee:before { content: "\f0f4"; } .fa-cutlery:before { content: "\f0f5"; } .fa-file-text-o:before { content: "\f0f6"; } .fa-building-o:before { content: "\f0f7"; } .fa-hospital-o:before { content: "\f0f8"; } .fa-ambulance:before { content: "\f0f9"; } .fa-medkit:before { content: "\f0fa"; } .fa-fighter-jet:before { content: "\f0fb"; } .fa-beer:before { content: "\f0fc"; } .fa-h-square:before { content: "\f0fd"; } .fa-plus-square:before { content: "\f0fe"; } .fa-angle-double-left:before { content: "\f100"; } .fa-angle-double-right:before { content: "\f101"; } .fa-angle-double-up:before { content: "\f102"; } .fa-angle-double-down:before { content: "\f103"; } .fa-angle-left:before { content: "\f104"; } .fa-angle-right:before { content: "\f105"; } .fa-angle-up:before { content: "\f106"; } .fa-angle-down:before { content: "\f107"; } .fa-desktop:before { content: "\f108"; } .fa-laptop:before { content: "\f109"; } .fa-tablet:before { content: "\f10a"; } .fa-mobile-phone:before, .fa-mobile:before { content: "\f10b"; } .fa-circle-o:before { content: "\f10c"; } .fa-quote-left:before { content: "\f10d"; } .fa-quote-right:before { content: "\f10e"; } .fa-spinner:before { content: "\f110"; } .fa-circle:before { content: "\f111"; } .fa-mail-reply:before, .fa-reply:before { content: "\f112"; } .fa-github-alt:before { content: "\f113"; } .fa-folder-o:before { content: "\f114"; } .fa-folder-open-o:before { content: "\f115"; } .fa-smile-o:before { content: "\f118"; } .fa-frown-o:before { content: "\f119"; } .fa-meh-o:before { content: "\f11a"; } .fa-gamepad:before { content: "\f11b"; } .fa-keyboard-o:before { content: "\f11c"; } .fa-flag-o:before { content: "\f11d"; } .fa-flag-checkered:before { content: "\f11e"; } .fa-terminal:before { content: "\f120"; } .fa-code:before { content: "\f121"; } .fa-mail-reply-all:before, .fa-reply-all:before { content: "\f122"; } .fa-star-half-empty:before, .fa-star-half-full:before, .fa-star-half-o:before { content: "\f123"; } .fa-location-arrow:before { content: "\f124"; } .fa-crop:before { content: "\f125"; } .fa-code-fork:before { content: "\f126"; } .fa-unlink:before, .fa-chain-broken:before { content: "\f127"; } .fa-question:before { content: "\f128"; } .fa-info:before { content: "\f129"; } .fa-exclamation:before { content: "\f12a"; } .fa-superscript:before { content: "\f12b"; } .fa-subscript:before { content: "\f12c"; } .fa-eraser:before { content: "\f12d"; } .fa-puzzle-piece:before { content: "\f12e"; } .fa-microphone:before { content: "\f130"; } .fa-microphone-slash:before { content: "\f131"; } .fa-shield:before { content: "\f132"; } .fa-calendar-o:before { content: "\f133"; } .fa-fire-extinguisher:before { content: "\f134"; } .fa-rocket:before { content: "\f135"; } .fa-maxcdn:before { content: "\f136"; } .fa-chevron-circle-left:before { content: "\f137"; } .fa-chevron-circle-right:before { content: "\f138"; } .fa-chevron-circle-up:before { content: "\f139"; } .fa-chevron-circle-down:before { content: "\f13a"; } .fa-html5:before { content: "\f13b"; } .fa-css3:before { content: "\f13c"; } .fa-anchor:before { content: "\f13d"; } .fa-unlock-alt:before { content: "\f13e"; } .fa-bullseye:before { content: "\f140"; } .fa-ellipsis-h:before { content: "\f141"; } .fa-ellipsis-v:before { content: "\f142"; } .fa-rss-square:before { content: "\f143"; } .fa-play-circle:before { content: "\f144"; } .fa-ticket:before { content: "\f145"; } .fa-minus-square:before { content: "\f146"; } .fa-minus-square-o:before { content: "\f147"; } .fa-level-up:before { content: "\f148"; } .fa-level-down:before { content: "\f149"; } .fa-check-square:before { content: "\f14a"; } .fa-pencil-square:before { content: "\f14b"; } .fa-external-link-square:before { content: "\f14c"; } .fa-share-square:before { content: "\f14d"; } .fa-compass:before { content: "\f14e"; } .fa-toggle-down:before, .fa-caret-square-o-down:before { content: "\f150"; } .fa-toggle-up:before, .fa-caret-square-o-up:before { content: "\f151"; } .fa-toggle-right:before, .fa-caret-square-o-right:before { content: "\f152"; } .fa-euro:before, .fa-eur:before { content: "\f153"; } .fa-gbp:before { content: "\f154"; } .fa-dollar:before, .fa-usd:before { content: "\f155"; } .fa-rupee:before, .fa-inr:before { content: "\f156"; } .fa-cny:before, .fa-rmb:before, .fa-yen:before, .fa-jpy:before { content: "\f157"; } .fa-ruble:before, .fa-rouble:before, .fa-rub:before { content: "\f158"; } .fa-won:before, .fa-krw:before { content: "\f159"; } .fa-bitcoin:before, .fa-btc:before { content: "\f15a"; } .fa-file:before { content: "\f15b"; } .fa-file-text:before { content: "\f15c"; } .fa-sort-alpha-asc:before { content: "\f15d"; } .fa-sort-alpha-desc:before { content: "\f15e"; } .fa-sort-amount-asc:before { content: "\f160"; } .fa-sort-amount-desc:before { content: "\f161"; } .fa-sort-numeric-asc:before { content: "\f162"; } .fa-sort-numeric-desc:before { content: "\f163"; } .fa-thumbs-up:before { content: "\f164"; } .fa-thumbs-down:before { content: "\f165"; } .fa-youtube-square:before { content: "\f166"; } .fa-youtube:before { content: "\f167"; } .fa-xing:before { content: "\f168"; } .fa-xing-square:before { content: "\f169"; } .fa-youtube-play:before { content: "\f16a"; } .fa-dropbox:before { content: "\f16b"; } .fa-stack-overflow:before { content: "\f16c"; } .fa-instagram:before { content: "\f16d"; } .fa-flickr:before { content: "\f16e"; } .fa-adn:before { content: "\f170"; } .fa-bitbucket:before { content: "\f171"; } .fa-bitbucket-square:before { content: "\f172"; } .fa-tumblr:before { content: "\f173"; } .fa-tumblr-square:before { content: "\f174"; } .fa-long-arrow-down:before { content: "\f175"; } .fa-long-arrow-up:before { content: "\f176"; } .fa-long-arrow-left:before { content: "\f177"; } .fa-long-arrow-right:before { content: "\f178"; } .fa-apple:before { content: "\f179"; } .fa-windows:before { content: "\f17a"; } .fa-android:before { content: "\f17b"; } .fa-linux:before { content: "\f17c"; } .fa-dribbble:before { content: "\f17d"; } .fa-skype:before { content: "\f17e"; } .fa-foursquare:before { content: "\f180"; } .fa-trello:before { content: "\f181"; } .fa-female:before { content: "\f182"; } .fa-male:before { content: "\f183"; } .fa-gittip:before { content: "\f184"; } .fa-sun-o:before { content: "\f185"; } .fa-moon-o:before { content: "\f186"; } .fa-archive:before { content: "\f187"; } .fa-bug:before { content: "\f188"; } .fa-vk:before { content: "\f189"; } .fa-weibo:before { content: "\f18a"; } .fa-renren:before { content: "\f18b"; } .fa-pagelines:before { content: "\f18c"; } .fa-stack-exchange:before { content: "\f18d"; } .fa-arrow-circle-o-right:before { content: "\f18e"; } .fa-arrow-circle-o-left:before { content: "\f190"; } .fa-toggle-left:before, .fa-caret-square-o-left:before { content: "\f191"; } .fa-dot-circle-o:before { content: "\f192"; } .fa-wheelchair:before { content: "\f193"; } .fa-vimeo-square:before { content: "\f194"; } .fa-turkish-lira:before, .fa-try:before { content: "\f195"; } .fa-plus-square-o:before { content: "\f196"; } .fa-space-shuttle:before { content: "\f197"; } .fa-slack:before { content: "\f198"; } .fa-envelope-square:before { content: "\f199"; } .fa-wordpress:before { content: "\f19a"; } .fa-openid:before { content: "\f19b"; } .fa-institution:before, .fa-bank:before, .fa-university:before { content: "\f19c"; } .fa-mortar-board:before, .fa-graduation-cap:before { content: "\f19d"; } .fa-yahoo:before { content: "\f19e"; } .fa-google:before { content: "\f1a0"; } .fa-reddit:before { content: "\f1a1"; } .fa-reddit-square:before { content: "\f1a2"; } .fa-stumbleupon-circle:before { content: "\f1a3"; } .fa-stumbleupon:before { content: "\f1a4"; } .fa-delicious:before { content: "\f1a5"; } .fa-digg:before { content: "\f1a6"; } .fa-pied-piper:before { content: "\f1a7"; } .fa-pied-piper-alt:before { content: "\f1a8"; } .fa-drupal:before { content: "\f1a9"; } .fa-joomla:before { content: "\f1aa"; } .fa-language:before { content: "\f1ab"; } .fa-fax:before { content: "\f1ac"; } .fa-building:before { content: "\f1ad"; } .fa-child:before { content: "\f1ae"; } .fa-paw:before { content: "\f1b0"; } .fa-spoon:before { content: "\f1b1"; } .fa-cube:before { content: "\f1b2"; } .fa-cubes:before { content: "\f1b3"; } .fa-behance:before { content: "\f1b4"; } .fa-behance-square:before { content: "\f1b5"; } .fa-steam:before { content: "\f1b6"; } .fa-steam-square:before { content: "\f1b7"; } .fa-recycle:before { content: "\f1b8"; } .fa-automobile:before, .fa-car:before { content: "\f1b9"; } .fa-cab:before, .fa-taxi:before { content: "\f1ba"; } .fa-tree:before { content: "\f1bb"; } .fa-spotify:before { content: "\f1bc"; } .fa-deviantart:before { content: "\f1bd"; } .fa-soundcloud:before { content: "\f1be"; } .fa-database:before { content: "\f1c0"; } .fa-file-pdf-o:before { content: "\f1c1"; } .fa-file-word-o:before { content: "\f1c2"; } .fa-file-excel-o:before { content: "\f1c3"; } .fa-file-powerpoint-o:before { content: "\f1c4"; } .fa-file-photo-o:before, .fa-file-picture-o:before, .fa-file-image-o:before { content: "\f1c5"; } .fa-file-zip-o:before, .fa-file-archive-o:before { content: "\f1c6"; } .fa-file-sound-o:before, .fa-file-audio-o:before { content: "\f1c7"; } .fa-file-movie-o:before, .fa-file-video-o:before { content: "\f1c8"; } .fa-file-code-o:before { content: "\f1c9"; } .fa-vine:before { content: "\f1ca"; } .fa-codepen:before { content: "\f1cb"; } .fa-jsfiddle:before { content: "\f1cc"; } .fa-life-bouy:before, .fa-life-buoy:before, .fa-life-saver:before, .fa-support:before, .fa-life-ring:before { content: "\f1cd"; } .fa-circle-o-notch:before { content: "\f1ce"; } .fa-ra:before, .fa-rebel:before { content: "\f1d0"; } .fa-ge:before, .fa-empire:before { content: "\f1d1"; } .fa-git-square:before { content: "\f1d2"; } .fa-git:before { content: "\f1d3"; } .fa-hacker-news:before { content: "\f1d4"; } .fa-tencent-weibo:before { content: "\f1d5"; } .fa-qq:before { content: "\f1d6"; } .fa-wechat:before, .fa-weixin:before { content: "\f1d7"; } .fa-send:before, .fa-paper-plane:before { content: "\f1d8"; } .fa-send-o:before, .fa-paper-plane-o:before { content: "\f1d9"; } .fa-history:before { content: "\f1da"; } .fa-circle-thin:before { content: "\f1db"; } .fa-header:before { content: "\f1dc"; } .fa-paragraph:before { content: "\f1dd"; } .fa-sliders:before { content: "\f1de"; } .fa-share-alt:before { content: "\f1e0"; } .fa-share-alt-square:before { content: "\f1e1"; } .fa-bomb:before { content: "\f1e2"; } .fa-soccer-ball-o:before, .fa-futbol-o:before { content: "\f1e3"; } .fa-tty:before { content: "\f1e4"; } .fa-binoculars:before { content: "\f1e5"; } .fa-plug:before { content: "\f1e6"; } .fa-slideshare:before { content: "\f1e7"; } .fa-twitch:before { content: "\f1e8"; } .fa-yelp:before { content: "\f1e9"; } .fa-newspaper-o:before { content: "\f1ea"; } .fa-wifi:before { content: "\f1eb"; } .fa-calculator:before { content: "\f1ec"; } .fa-paypal:before { content: "\f1ed"; } .fa-google-wallet:before { content: "\f1ee"; } .fa-cc-visa:before { content: "\f1f0"; } .fa-cc-mastercard:before { content: "\f1f1"; } .fa-cc-discover:before { content: "\f1f2"; } .fa-cc-amex:before { content: "\f1f3"; } .fa-cc-paypal:before { content: "\f1f4"; } .fa-cc-stripe:before { content: "\f1f5"; } .fa-bell-slash:before { content: "\f1f6"; } .fa-bell-slash-o:before { content: "\f1f7"; } .fa-trash:before { content: "\f1f8"; } .fa-copyright:before { content: "\f1f9"; } .fa-at:before { content: "\f1fa"; } .fa-eyedropper:before { content: "\f1fb"; } .fa-paint-brush:before { content: "\f1fc"; } .fa-birthday-cake:before { content: "\f1fd"; } .fa-area-chart:before { content: "\f1fe"; } .fa-pie-chart:before { content: "\f200"; } .fa-line-chart:before { content: "\f201"; } .fa-lastfm:before { content: "\f202"; } .fa-lastfm-square:before { content: "\f203"; } .fa-toggle-off:before { content: "\f204"; } .fa-toggle-on:before { content: "\f205"; } .fa-bicycle:before { content: "\f206"; } .fa-bus:before { content: "\f207"; } .fa-ioxhost:before { content: "\f208"; } .fa-angellist:before { content: "\f209"; } .fa-cc:before { content: "\f20a"; } .fa-shekel:before, .fa-sheqel:before, .fa-ils:before { content: "\f20b"; } .fa-meanpath:before { content: "\f20c"; } html.boxed-layout #layout-main-container, html.boxed-layout #layout-tripel-container, html.boxed-layout #layout-footer { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { html.boxed-layout #layout-main-container, html.boxed-layout #layout-tripel-container, html.boxed-layout #layout-footer { width: 750px; } } @media (min-width: 992px) { html.boxed-layout #layout-main-container, html.boxed-layout #layout-tripel-container, html.boxed-layout #layout-footer { width: 970px; } } @media (min-width: 1200px) { html.boxed-layout #layout-main-container, html.boxed-layout #layout-tripel-container, html.boxed-layout #layout-footer { width: 1170px; } } html.boxed-layout #layout-main-container > .navbar-header, html.boxed-layout #layout-tripel-container > .navbar-header, html.boxed-layout #layout-footer > .navbar-header, html.boxed-layout #layout-main-container > .navbar-collapse, html.boxed-layout #layout-tripel-container > .navbar-collapse, html.boxed-layout #layout-footer > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { html.boxed-layout #layout-main-container > .navbar-header, html.boxed-layout #layout-tripel-container > .navbar-header, html.boxed-layout #layout-footer > .navbar-header, html.boxed-layout #layout-main-container > .navbar-collapse, html.boxed-layout #layout-tripel-container > .navbar-collapse, html.boxed-layout #layout-footer > .navbar-collapse { margin-right: 0; margin-left: 0; } } html.fluid-layout #layout-main-container, html.fluid-layout #layout-tripel-container, html.fluid-layout #layout-footer { padding: 0 15px; } html.fixed-nav.boxed-layout #layout-navigation { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { html.fixed-nav.boxed-layout #layout-navigation { width: 750px; } } @media (min-width: 992px) { html.fixed-nav.boxed-layout #layout-navigation { width: 970px; } } @media (min-width: 1200px) { html.fixed-nav.boxed-layout #layout-navigation { width: 1170px; } } html.fixed-nav.boxed-layout #layout-navigation > .navbar-header, html.fixed-nav.boxed-layout #layout-navigation > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { html.fixed-nav.boxed-layout #layout-navigation > .navbar-header, html.fixed-nav.boxed-layout #layout-navigation > .navbar-collapse { margin-right: 0; margin-left: 0; } } html.fixed-nav.fluid-layout #layout-navigation { padding: 0 15px; } html.floating-nav #layout-navigation { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { html.floating-nav #layout-navigation { float: left; width: 100%; } } html.floating-nav.boxed-layout .navbar-wrapper { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { html.floating-nav.boxed-layout .navbar-wrapper { width: 750px; } } @media (min-width: 992px) { html.floating-nav.boxed-layout .navbar-wrapper { width: 970px; } } @media (min-width: 1200px) { html.floating-nav.boxed-layout .navbar-wrapper { width: 1170px; } } html.floating-nav.boxed-layout .navbar-wrapper > .navbar-header, html.floating-nav.boxed-layout .navbar-wrapper > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { html.floating-nav.boxed-layout .navbar-wrapper > .navbar-header, html.floating-nav.boxed-layout .navbar-wrapper > .navbar-collapse { margin-right: 0; margin-left: 0; } } html.floating-nav.fluid-layout .navbar-wrapper { padding: 0 15px; } #layout-main, #layout-tripel, #footer-quad { margin-left: -15px; margin-right: -15px; } #layout-content { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { #layout-content { float: left; width: 100%; } } .aside-1 #layout-content, .aside-2 #layout-content { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .aside-1 #layout-content, .aside-2 #layout-content { float: left; width: 75%; } } .aside-12 #layout-content { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .aside-12 #layout-content { float: left; width: 50%; } } #aside-first, #aside-second { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { #aside-first, #aside-second { float: left; width: 25%; } } .tripel-1 #tripel-first, .tripel-2 #tripel-first, .tripel-3 #tripel-first, .tripel-1 #tripel-second, .tripel-2 #tripel-second, .tripel-3 #tripel-second, .tripel-1 #tripel-third, .tripel-2 #tripel-third, .tripel-3 #tripel-third { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .tripel-1 #tripel-first, .tripel-2 #tripel-first, .tripel-3 #tripel-first, .tripel-1 #tripel-second, .tripel-2 #tripel-second, .tripel-3 #tripel-second, .tripel-1 #tripel-third, .tripel-2 #tripel-third, .tripel-3 #tripel-third { float: left; width: 100%; } } .tripel-12 #tripel-first, .tripel-13 #tripel-first, .tripel-23 #tripel-first, .tripel-12 #tripel-second, .tripel-13 #tripel-second, .tripel-23 #tripel-second, .tripel-12 #tripel-third, .tripel-13 #tripel-third, .tripel-23 #tripel-third { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .tripel-12 #tripel-first, .tripel-13 #tripel-first, .tripel-23 #tripel-first, .tripel-12 #tripel-second, .tripel-13 #tripel-second, .tripel-23 #tripel-second, .tripel-12 #tripel-third, .tripel-13 #tripel-third, .tripel-23 #tripel-third { float: left; width: 50%; } } .tripel-123 #tripel-first, .tripel-123 #tripel-second, .tripel-123 #tripel-third { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .tripel-123 #tripel-first, .tripel-123 #tripel-second, .tripel-123 #tripel-third { float: left; width: 33.33333333%; } } .split-1 + #layout-footer #footer-quad-first, .split-2 + #layout-footer #footer-quad-first, .split-3 + #layout-footer #footer-quad-first, .split-4 + #layout-footer #footer-quad-first, .split-1 + #layout-footer #footer-quad-second, .split-2 + #layout-footer #footer-quad-second, .split-3 + #layout-footer #footer-quad-second, .split-4 + #layout-footer #footer-quad-second, .split-1 + #layout-footer #footer-quad-third, .split-2 + #layout-footer #footer-quad-third, .split-3 + #layout-footer #footer-quad-third, .split-4 + #layout-footer #footer-quad-third, .split-1 + #layout-footer #footer-quad-fourth, .split-2 + #layout-footer #footer-quad-fourth, .split-3 + #layout-footer #footer-quad-fourth, .split-4 + #layout-footer #footer-quad-fourth { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .split-1 + #layout-footer #footer-quad-first, .split-2 + #layout-footer #footer-quad-first, .split-3 + #layout-footer #footer-quad-first, .split-4 + #layout-footer #footer-quad-first, .split-1 + #layout-footer #footer-quad-second, .split-2 + #layout-footer #footer-quad-second, .split-3 + #layout-footer #footer-quad-second, .split-4 + #layout-footer #footer-quad-second, .split-1 + #layout-footer #footer-quad-third, .split-2 + #layout-footer #footer-quad-third, .split-3 + #layout-footer #footer-quad-third, .split-4 + #layout-footer #footer-quad-third, .split-1 + #layout-footer #footer-quad-fourth, .split-2 + #layout-footer #footer-quad-fourth, .split-3 + #layout-footer #footer-quad-fourth, .split-4 + #layout-footer #footer-quad-fourth { float: left; width: 100%; } } .split-12 + #layout-footer #footer-quad-first, .split-13 + #layout-footer #footer-quad-first, .split-14 + #layout-footer #footer-quad-first, .split-23 + #layout-footer #footer-quad-first, .split-24 + #layout-footer #footer-quad-first, .split-34 + #layout-footer #footer-quad-first, .split-12 + #layout-footer #footer-quad-second, .split-13 + #layout-footer #footer-quad-second, .split-14 + #layout-footer #footer-quad-second, .split-23 + #layout-footer #footer-quad-second, .split-24 + #layout-footer #footer-quad-second, .split-34 + #layout-footer #footer-quad-second, .split-12 + #layout-footer #footer-quad-third, .split-13 + #layout-footer #footer-quad-third, .split-14 + #layout-footer #footer-quad-third, .split-23 + #layout-footer #footer-quad-third, .split-24 + #layout-footer #footer-quad-third, .split-34 + #layout-footer #footer-quad-third, .split-12 + #layout-footer #footer-quad-fourth, .split-13 + #layout-footer #footer-quad-fourth, .split-14 + #layout-footer #footer-quad-fourth, .split-23 + #layout-footer #footer-quad-fourth, .split-24 + #layout-footer #footer-quad-fourth, .split-34 + #layout-footer #footer-quad-fourth { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .split-12 + #layout-footer #footer-quad-first, .split-13 + #layout-footer #footer-quad-first, .split-14 + #layout-footer #footer-quad-first, .split-23 + #layout-footer #footer-quad-first, .split-24 + #layout-footer #footer-quad-first, .split-34 + #layout-footer #footer-quad-first, .split-12 + #layout-footer #footer-quad-second, .split-13 + #layout-footer #footer-quad-second, .split-14 + #layout-footer #footer-quad-second, .split-23 + #layout-footer #footer-quad-second, .split-24 + #layout-footer #footer-quad-second, .split-34 + #layout-footer #footer-quad-second, .split-12 + #layout-footer #footer-quad-third, .split-13 + #layout-footer #footer-quad-third, .split-14 + #layout-footer #footer-quad-third, .split-23 + #layout-footer #footer-quad-third, .split-24 + #layout-footer #footer-quad-third, .split-34 + #layout-footer #footer-quad-third, .split-12 + #layout-footer #footer-quad-fourth, .split-13 + #layout-footer #footer-quad-fourth, .split-14 + #layout-footer #footer-quad-fourth, .split-23 + #layout-footer #footer-quad-fourth, .split-24 + #layout-footer #footer-quad-fourth, .split-34 + #layout-footer #footer-quad-fourth { float: left; width: 50%; } } .split-123 + #layout-footer #footer-quad-first, .split-124 + #layout-footer #footer-quad-first, .split-134 + #layout-footer #footer-quad-first, .split-234 + #layout-footer #footer-quad-first, .split-123 + #layout-footer #footer-quad-second, .split-124 + #layout-footer #footer-quad-second, .split-134 + #layout-footer #footer-quad-second, .split-234 + #layout-footer #footer-quad-second, .split-123 + #layout-footer #footer-quad-third, .split-124 + #layout-footer #footer-quad-third, .split-134 + #layout-footer #footer-quad-third, .split-234 + #layout-footer #footer-quad-third, .split-123 + #layout-footer #footer-quad-fourth, .split-124 + #layout-footer #footer-quad-fourth, .split-134 + #layout-footer #footer-quad-fourth, .split-234 + #layout-footer #footer-quad-fourth { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .split-123 + #layout-footer #footer-quad-first, .split-124 + #layout-footer #footer-quad-first, .split-134 + #layout-footer #footer-quad-first, .split-234 + #layout-footer #footer-quad-first, .split-123 + #layout-footer #footer-quad-second, .split-124 + #layout-footer #footer-quad-second, .split-134 + #layout-footer #footer-quad-second, .split-234 + #layout-footer #footer-quad-second, .split-123 + #layout-footer #footer-quad-third, .split-124 + #layout-footer #footer-quad-third, .split-134 + #layout-footer #footer-quad-third, .split-234 + #layout-footer #footer-quad-third, .split-123 + #layout-footer #footer-quad-fourth, .split-124 + #layout-footer #footer-quad-fourth, .split-134 + #layout-footer #footer-quad-fourth, .split-234 + #layout-footer #footer-quad-fourth { float: left; width: 33.33333333%; } } .split-1234 + #layout-footer #footer-quad-first, .split-1234 + #layout-footer #footer-quad-second, .split-1234 + #layout-footer #footer-quad-third, .split-1234 + #layout-footer #footer-quad-fourth { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { .split-1234 + #layout-footer #footer-quad-first, .split-1234 + #layout-footer #footer-quad-second, .split-1234 + #layout-footer #footer-quad-third, .split-1234 + #layout-footer #footer-quad-fourth { float: left; width: 25%; } } html.sticky-footer { min-height: 100%; position: relative; } html.sticky-footer #layout-footer { position: absolute; bottom: 0; width: 100%; } html.sticky-footer.boxed-layout #footer { margin-right: auto; margin-left: auto; padding-left: 15px; padding-right: 15px; } @media (min-width: 768px) { html.sticky-footer.boxed-layout #footer { width: 750px; } } @media (min-width: 992px) { html.sticky-footer.boxed-layout #footer { width: 970px; } } @media (min-width: 1200px) { html.sticky-footer.boxed-layout #footer { width: 1170px; } } html.sticky-footer.boxed-layout #footer > .navbar-header, html.sticky-footer.boxed-layout #footer > .navbar-collapse { margin-right: -15px; margin-left: -15px; } @media (min-width: 768px) { html.sticky-footer.boxed-layout #footer > .navbar-header, html.sticky-footer.boxed-layout #footer > .navbar-collapse { margin-right: 0; margin-left: 0; } } html.sticky-footer.fluid-layout #footer { padding: 0 15px; } .carousel-control .fa-chevron-left { width: 30px; height: 30px; margin-top: -15px; margin-left: -15px; font-size: 30px; left: 50%; position: absolute; top: 50%; z-index: 5; display: inline-block; } .carousel-control .fa-chevron-right { width: 30px; height: 30px; margin-top: -15px; margin-left: -15px; font-size: 30px; right: 50%; position: absolute; top: 50%; z-index: 5; display: inline-block; } .media .comment-avatar { margin-right: 10px; } ul.comments li { margin-top: 40px; } #toTop { position: fixed; right: 5px; bottom: 10px; cursor: pointer; display: none; text-align: center; z-index: 500; } #toTop:hover { opacity: .7; } /* add user icon before menu */ .menuUserName > a:before { content: "\f007"; font-family: "FontAwesome"; margin-right: 5px; } .widget-search-form { float: none !important; } .dropdown-menu ul { left: 100%; top: 0; } .dropdown .dropdown:hover > .dropdown-menu, .dropdown .dropdown .dropdown:hover > .dropdown-menu, .dropdown .dropdown .dropdown .dropdown:hover > .dropdown-menu, .dropdown .dropdown .dropdown .dropdown .dropdown:hover > .dropdown-menu { display: block; } .dropdown-menu i { line-height: 1.42857143; } .navbar-brand { padding-left: 0; } fieldset > div { margin-bottom: 15px; } input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="file"], input[type="month"], input[type="number"], input[type="password"], input[type="range"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"], select, textarea { display: block; width: 100%; height: 34px; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; color: #555555; background-color: #ffffff; background-image: none; border: 1px solid #cccccc; 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 .15s, box-shadow ease-in-out .15s; -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; } input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="email"]:focus, input[type="file"]:focus, input[type="month"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="range"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="time"]:focus, input[type="url"]:focus, input[type="week"]:focus, select:focus, textarea:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6); } input[type="color"]::-moz-placeholder, input[type="date"]::-moz-placeholder, input[type="datetime"]::-moz-placeholder, input[type="datetime-local"]::-moz-placeholder, input[type="email"]::-moz-placeholder, input[type="file"]::-moz-placeholder, input[type="month"]::-moz-placeholder, input[type="number"]::-moz-placeholder, input[type="password"]::-moz-placeholder, input[type="range"]::-moz-placeholder, input[type="search"]::-moz-placeholder, input[type="tel"]::-moz-placeholder, input[type="text"]::-moz-placeholder, input[type="time"]::-moz-placeholder, input[type="url"]::-moz-placeholder, input[type="week"]::-moz-placeholder, select::-moz-placeholder, textarea::-moz-placeholder { color: #777777; opacity: 1; } input[type="color"]:-ms-input-placeholder, input[type="date"]:-ms-input-placeholder, input[type="datetime"]:-ms-input-placeholder, input[type="datetime-local"]:-ms-input-placeholder, input[type="email"]:-ms-input-placeholder, input[type="file"]:-ms-input-placeholder, input[type="month"]:-ms-input-placeholder, input[type="number"]:-ms-input-placeholder, input[type="password"]:-ms-input-placeholder, input[type="range"]:-ms-input-placeholder, input[type="search"]:-ms-input-placeholder, input[type="tel"]:-ms-input-placeholder, input[type="text"]:-ms-input-placeholder, input[type="time"]:-ms-input-placeholder, input[type="url"]:-ms-input-placeholder, input[type="week"]:-ms-input-placeholder, select:-ms-input-placeholder, textarea:-ms-input-placeholder { color: #777777; } input[type="color"]::-webkit-input-placeholder, input[type="date"]::-webkit-input-placeholder, input[type="datetime"]::-webkit-input-placeholder, input[type="datetime-local"]::-webkit-input-placeholder, input[type="email"]::-webkit-input-placeholder, input[type="file"]::-webkit-input-placeholder, input[type="month"]::-webkit-input-placeholder, input[type="number"]::-webkit-input-placeholder, input[type="password"]::-webkit-input-placeholder, input[type="range"]::-webkit-input-placeholder, input[type="search"]::-webkit-input-placeholder, input[type="tel"]::-webkit-input-placeholder, input[type="text"]::-webkit-input-placeholder, input[type="time"]::-webkit-input-placeholder, input[type="url"]::-webkit-input-placeholder, input[type="week"]::-webkit-input-placeholder, select::-webkit-input-placeholder, textarea::-webkit-input-placeholder { color: #777777; } input[type="color"][disabled], input[type="date"][disabled], input[type="datetime"][disabled], input[type="datetime-local"][disabled], input[type="email"][disabled], input[type="file"][disabled], input[type="month"][disabled], input[type="number"][disabled], input[type="password"][disabled], input[type="range"][disabled], input[type="search"][disabled], input[type="tel"][disabled], input[type="text"][disabled], input[type="time"][disabled], input[type="url"][disabled], input[type="week"][disabled], select[disabled], textarea[disabled], input[type="color"][readonly], input[type="date"][readonly], input[type="datetime"][readonly], input[type="datetime-local"][readonly], input[type="email"][readonly], input[type="file"][readonly], input[type="month"][readonly], input[type="number"][readonly], input[type="password"][readonly], input[type="range"][readonly], input[type="search"][readonly], input[type="tel"][readonly], input[type="text"][readonly], input[type="time"][readonly], input[type="url"][readonly], input[type="week"][readonly], select[readonly], textarea[readonly], fieldset[disabled] input[type="color"], fieldset[disabled] input[type="date"], fieldset[disabled] input[type="datetime"], fieldset[disabled] input[type="datetime-local"], fieldset[disabled] input[type="email"], fieldset[disabled] input[type="file"], fieldset[disabled] input[type="month"], fieldset[disabled] input[type="number"], fieldset[disabled] input[type="password"], fieldset[disabled] input[type="range"], fieldset[disabled] input[type="search"], fieldset[disabled] input[type="tel"], fieldset[disabled] input[type="text"], fieldset[disabled] input[type="time"], fieldset[disabled] input[type="url"], fieldset[disabled] input[type="week"], fieldset[disabled] select, fieldset[disabled] textarea { cursor: not-allowed; background-color: #eeeeee; opacity: 1; } textareainput[type="color"], textareainput[type="date"], textareainput[type="datetime"], textareainput[type="datetime-local"], textareainput[type="email"], textareainput[type="file"], textareainput[type="month"], textareainput[type="number"], textareainput[type="password"], textareainput[type="range"], textareainput[type="search"], textareainput[type="tel"], textareainput[type="text"], textareainput[type="time"], textareainput[type="url"], textareainput[type="week"], textareaselect, textareatextarea { height: auto; } textarea { height: auto; } button { display: inline-block; margin-bottom: 0; font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; background-image: none; border: 1px solid transparent; white-space: nowrap; padding: 6px 12px; font-size: 14px; line-height: 1.42857143; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; color: #333333; background-color: #ffffff; border-color: #cccccc; } button:focus, button:active:focus, button.active:focus { outline: thin dotted; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } button:hover, button:focus { color: #333333; text-decoration: none; } button:active, button.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); } button.disabled, button[disabled], fieldset[disabled] button { cursor: not-allowed; pointer-events: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; box-shadow: none; } button:hover, button:focus, button:active, button.active, .open > .dropdown-togglebutton { color: #333333; background-color: #e6e6e6; border-color: #adadad; } button:active, button.active, .open > .dropdown-togglebutton { background-image: none; } button.disabled, button[disabled], fieldset[disabled] button, button.disabled:hover, button[disabled]:hover, fieldset[disabled] button:hover, button.disabled:focus, button[disabled]:focus, fieldset[disabled] button:focus, button.disabled:active, button[disabled]:active, fieldset[disabled] button:active, button.disabled.active, button[disabled].active, fieldset[disabled] button.active { background-color: #ffffff; border-color: #cccccc; } button .badge { color: #ffffff; background-color: #333333; } button.primaryAction { color: #ffffff; background-color: #428bca; border-color: #357ebd; } button.primaryAction:hover, button.primaryAction:focus, button.primaryAction:active, button.primaryAction.active, .open > .dropdown-togglebutton.primaryAction { color: #ffffff; background-color: #3071a9; border-color: #285e8e; } button.primaryAction:active, button.primaryAction.active, .open > .dropdown-togglebutton.primaryAction { background-image: none; } button.primaryAction.disabled, button.primaryAction[disabled], fieldset[disabled] button.primaryAction, button.primaryAction.disabled:hover, button.primaryAction[disabled]:hover, fieldset[disabled] button.primaryAction:hover, button.primaryAction.disabled:focus, button.primaryAction[disabled]:focus, fieldset[disabled] button.primaryAction:focus, button.primaryAction.disabled:active, button.primaryAction[disabled]:active, fieldset[disabled] button.primaryAction:active, button.primaryAction.disabled.active, button.primaryAction[disabled].active, fieldset[disabled] button.primaryAction.active { background-color: #428bca; border-color: #357ebd; } button.primaryAction .badge { color: #428bca; background-color: #ffffff; } ol, ul { padding-left: 0; list-style: none; } .pager { display: inline-block; padding-left: 0; margin: 20px 0; border-radius: 4px; } .pager > li { display: inline; } .pager > li > a, .pager > li > span { position: relative; float: left; padding: 6px 12px; line-height: 1.42857143; text-decoration: none; color: #428bca; background-color: #ffffff; border: 1px solid #dddddd; margin-left: -1px; } .pager > li:first-child > a, .pager > li:first-child > span { margin-left: 0; border-bottom-left-radius: 4px; border-top-left-radius: 4px; } .pager > li:last-child > a, .pager > li:last-child > span { border-bottom-right-radius: 4px; border-top-right-radius: 4px; } .pager > li > a:hover, .pager > li > span:hover, .pager > li > a:focus, .pager > li > span:focus { color: #2a6496; background-color: #eeeeee; border-color: #dddddd; } .pager > .active > a, .pager > .active > span, .pager > .active > a:hover, .pager > .active > span:hover, .pager > .active > a:focus, .pager > .active > span:focus { z-index: 2; color: #ffffff; background-color: #428bca; border-color: #428bca; cursor: default; } .pager > .disabled > span, .pager > .disabled > span:hover, .pager > .disabled > span:focus, .pager > .disabled > a, .pager > .disabled > a:hover, .pager > .disabled > a:focus { color: #777777; background-color: #ffffff; border-color: #dddddd; cursor: not-allowed; } html.orchard-users form { margin-left: -15px; margin-right: -15px; } html.orchard-users form fieldset { position: relative; min-height: 1px; padding-left: 15px; padding-right: 15px; } @media (min-width: 992px) { html.orchard-users form fieldset { float: left; width: 50%; } } .input-validation-error { -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); border-color: #a94442 !important; } .field-validation-error { display: block; margin-top: 5px; margin-bottom: 10px; color: #737373; color: #a94442; } .widget h1 { font-family: inherit; font-weight: 500; line-height: 1.1; color: inherit; margin-top: 20px; margin-bottom: 10px; font-size: 24px; } .widget h1 small, .widget h1 .small { font-weight: normal; line-height: 1; color: #777777; } .widget h1 small, .widget h1 .small { font-size: 65%; } .tags, .comment-count { margin-right: 20px; } /* Z-INDEX */ .formError { z-index: 990; } .formError .formErrorContent { z-index: 991; } .formError .formErrorArrow { z-index: 996; } .ui-dialog .formError { z-index: 5000; } .ui-dialog .formError .formErrorContent { z-index: 5001; } .ui-dialog .formError .formErrorArrow { z-index: 5006; } .inputContainer { position: relative; float: left; } .formError { position: absolute; top: 300px; left: 300px; display: block; cursor: pointer; text-align: left; } .formError.inline { position: relative; top: 0; left: 0; display: inline-block; } .ajaxSubmit { padding: 20px; background: #55ea55; border: 0px solid #ffffff; display: none; } .formError .formErrorContent { width: 100%; background: #ee0101; position: relative; color: #ffffff; min-width: 120px; font-size: 11px; border: 0px solid #ffffff; box-shadow: 0 0 2px #333333; -moz-box-shadow: 0 0 2px #333333; -webkit-box-shadow: 0 0 2px #333333; -o-box-shadow: 0 0 2px #333333; padding: 4px 10px 4px 10px; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; -o-border-radius: 6px; } .formError.inline .formErrorContent { box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; border: none; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; } .greenPopup .formErrorContent { background: #33be40; } .blackPopup .formErrorContent { background: #393939; color: #FFF; } .formError .formErrorArrow { width: 15px; margin: -2px 0 0 13px; position: relative; } body[dir='rtl'] .formError .formErrorArrow, body.rtl .formError .formErrorArrow { margin: -2px 13px 0 0; } .formError .formErrorArrowBottom { box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; margin: 0px 0 0 12px; top: 2px; } .formError .formErrorArrow div { border-left: 0px solid #ffffff; border-right: 0px solid #ffffff; box-shadow: 0 1px 1px #4d4d4d; -moz-box-shadow: 0 1px 1px #4d4d4d; -webkit-box-shadow: 0 1px 1px #4d4d4d; -o-box-shadow: 0 1px 1px #4d4d4d; font-size: 0px; height: 1px; background: #ee0101; margin: 0 auto; line-height: 0; font-size: 0; display: block; } .formError .formErrorArrowBottom div { box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; } .greenPopup .formErrorArrow div { background: #33be40; } .blackPopup .formErrorArrow div { background: #393939; color: #FFF; } .formError .formErrorArrow .line10 { width: 13px; border: none; } .formError .formErrorArrow .line9 { width: 11px; border: none; } .formError .formErrorArrow .line8 { width: 11px; } .formError .formErrorArrow .line7 { width: 9px; } .formError .formErrorArrow .line6 { width: 7px; } .formError .formErrorArrow .line5 { width: 5px; } .formError .formErrorArrow .line4 { width: 3px; } .formError .formErrorArrow .line3 { width: 0px; border-left: 0px solid #ffffff; border-right: 0px solid #ffffff; border-bottom: 0 solid #ffffff; } .formError .formErrorArrow .line2 { width: 3px; border: none; background: #ffffff; } .formError .formErrorArrow .line1 { width: 1px; border: none; background: #ffffff; } .portfolio-filter { padding: 25px 15px; text-transform: uppercase; font-size: 11px; } .portfolio-item { overflow: hidden; -webkit-transition: all 0.2s ease; transition: all 0.2s ease; border-radius: 3px; } .portfolio-item .portfolio-thumb { position: relative; overflow: hidden; } .portfolio-item .portfolio-thumb img { -webkit-transition: all 0.2s ease; transition: all 0.2s ease; } .portfolio-item .portfolio-details { text-align: center; padding: 20px; border-top: 0; overflow: hidden; } .portfolio-item .portfolio-details h5 { margin-top: 0; position: relative; } .portfolio-item .portfolio-details p { margin-top: 20px; margin-bottom: 0; } .isotope { -webkit-transition-property: height, width; -moz-transition-property: height, width; -ms-transition-property: height, width; -o-transition-property: height, width; transition-property: height, width; } .isotope, .isotope .isotope-item { -webkit-transition-duration: 0.8s; -moz-transition-duration: 0.8s; -ms-transition-duration: 0.8s; -o-transition-duration: 0.8s; transition-duration: 0.8s; } .latest-twitter-list h5 { display: inline-block; margin: 0; } .latest-twitter-list li { margin-bottom: 10px; } .navbar-nav > li > .dropdown-menu .dropdown-menu { margin-top: -6px; } /*# sourceMappingURL=site-default.css.map */
Java
/********************************************************************** * * Copyright (c) 2004-2005 Endace Technology Ltd, Hamilton, New Zealand. * All rights reserved. * * This source code is proprietary to Endace Technology Limited and no part * of it may be redistributed, published or disclosed except as outlined in * the written contract supplied with this product. * * $Id: df_types.h,v 1.3 2006/03/28 03:55:07 ben Exp $ * **********************************************************************/ /********************************************************************** * FILE: df_types.h * DESCRIPTION: Defines the internal types used by the dagfilter API * library. * * * HISTORY: 15-12-05 Initial revision * **********************************************************************/ #ifndef DF_TYPES_H #define DF_TYPES_H /* ADT headers */ #include "adt_list.h" #include "adt_array_list.h" /*-------------------------------------------------------------------- PROTOCOLS These protocol types allow for extended filter functionality, for example if filtering on a TCP protocol filter, port filters can be added to the ip filter. ---------------------------------------------------------------------*/ #define DF_PROTO_ICMP 1 #define DF_PROTO_TCP 6 #define DF_PROTO_UDP 17 #define DF_PROTO_SCTP 132 /*-------------------------------------------------------------------- SIGNATURES ---------------------------------------------------------------------*/ #define SIG_RULESET 0xD68FC735 #define SIG_IPV4_RULE 0x3758E847 #define SIG_IPV6_RULE 0xA79B7AEF #define ISIPRULE_SIGNATURE(x) (((x) == SIG_IPV4_RULE) ? 1 : \ ((x) == SIG_IPV6_RULE) ? 1 : 0) #define ISRULE_SIGNATURE(x) (((x) == SIG_IPV4_RULE) ? 1 : \ ((x) == SIG_IPV6_RULE) ? 1 : 0) /*-------------------------------------------------------------------- RULESET ---------------------------------------------------------------------*/ typedef struct df_ruleset_s { uint32_t signature; /* signature 0xD68FC735 */ ListPtr rule_list; /* list of filters in the ruleset */ } df_ruleset_t; /*-------------------------------------------------------------------- FILTER RULE META DATA All filter data structures should have a filter_meta_t as their first data field, this allows the meta-data functions to cast the filter to a filter_meta_t type for processing. ---------------------------------------------------------------------*/ typedef struct df_rule_meta_s { uint32_t signature; /* signature for the filter type, should be unique for each filter */ /* see above for possible filter signatures. */ /* ruleset handle */ RulesetH ruleset; /* handle to the parent ruleset */ /* meta data */ uint16_t action : 1; /* 1 for accept, 0 for reject */ uint16_t steering : 1; /* 1 for steer to line, 0 for steer to host */ uint16_t reserved : 14; /* reserved for future use */ uint16_t snap_len; /* the snap length of the accepted packets */ uint16_t rule_tag; /* the filter tag set in ERf header, only lower 14-bits are used */ uint16_t priority; } df_rule_meta_t; /*-------------------------------------------------------------------- STANDARD RULE TYPES ---------------------------------------------------------------------*/ typedef struct icmp_type_ruler_s { uint8_t type; uint8_t mask; } icmp_type_rule_t; typedef struct port_rule_s { uint16_t port; uint16_t mask; } port_rule_t; typedef struct ipv4_addr_rule_s { uint8_t addr[4]; uint8_t mask[4]; } ipv4_addr_rule_t; typedef struct ipv6_addr_rule_s { uint8_t addr[16]; uint8_t mask[16]; } ipv6_addr_rule_t; typedef struct ipv6_flow_rule_s { uint32_t flow; uint32_t mask; } ipv6_flow_rule_t; typedef struct tcp_flags_rule_s { uint8_t flags; uint8_t mask; } tcp_flags_rule_t; /*-------------------------------------------------------------------- IPV4 RULE ---------------------------------------------------------------------*/ typedef struct df_ipv4_rule_s { /* meta data */ df_rule_meta_t meta; /* ip header */ ipv4_addr_rule_t source; /* source filter */ ipv4_addr_rule_t dest; /* destination filter */ /* level 5/6 */ uint8_t protocol; /* protocol to filter on, 0xFF for no protocol filter */ tcp_flags_rule_t tcp_flags; /* tcp flags to filter on (only valid if protocol is 6) */ ArrayListPtr port_rules; /* list of port filters (only valid if protocol is 6,17 or 132)*/ ArrayListPtr icmp_type_rules; /* list of icmp type filters (only valid if protocol is 1) */ } df_ipv4_rule_t; /*-------------------------------------------------------------------- IPV6 RULE ---------------------------------------------------------------------*/ typedef struct df_ipv6_rule_s { /* meta data */ df_rule_meta_t meta; /* ip header */ ipv6_addr_rule_t source; /* source filter */ ipv6_addr_rule_t dest; /* destination filter */ ipv6_flow_rule_t flow; /* flow label filter */ /* level 5/6 */ uint8_t protocol; /* protocol to filter on, 0xFF for no protocol filter */ tcp_flags_rule_t tcp_flags; /* tcp flags to filter on (only valid if protocol is 6) */ ArrayListPtr port_rules; /* list of port filters (only valid if protocol is 6,17 or 132)*/ ArrayListPtr icmp_type_rules; /* list of icmp type filters (only valid if protocol is 1) */ } df_ipv6_rule_t; /*-------------------------------------------------------------------- PORT RULE ---------------------------------------------------------------------*/ #define DFFLAG_BITMASK 0x01 #define DFFLAG_RANGE 0x02 #define DFFLAG_SOURCE 0x80 #define DFFLAG_DEST 0x00 typedef struct df_port_rule_s { uint8_t flags; union { struct { uint16_t value; uint16_t mask; } bitmask; struct { uint16_t min; uint16_t max; } range; } rule; } df_port_rule_t; /*-------------------------------------------------------------------- ICMP TYPE RULE ---------------------------------------------------------------------*/ typedef struct df_icmp_type_rule_s { uint8_t flags; union { struct { uint8_t value; uint8_t mask; } bitmask; struct { uint8_t min; uint8_t max; } range; } rule; } df_icmp_type_rule_t; #endif // DF_TYPES_H
Java
////functionen hämtar alla artiklar med hjälp av getJSON //och får tillbaka en array med alla artiklar //efter den är klar kallar den på functionen ShoArtTab. //som skriver ut alla artiklar i en tabell. function getAllAdminProducts() { $.getJSON("index2.php/getAllProducts").done(showArtTab); } //functionen showArtTab får en array av getAllArticle funktionen //som den loopar igenom och anväder för att skapa upp en tabell med alla de olika //artiklarna function showArtTab(cart){ var mainTabell = document.createElement('div'); mainTabell.setAttribute('id', 'mainTabell'); var tbl = document.createElement('table'); tbl.setAttribute('border', '1'); var tr = document.createElement('tr'); var th2 = document.createElement('th'); var txt2 = document.createTextNode('Produktid'); var th3 = document.createElement('th'); var txt3 = document.createTextNode('Produktnamn'); var th4 = document.createElement('th'); var txt4 = document.createTextNode('Kategori'); var th5 = document.createElement('th'); var txt5 = document.createTextNode('Pris'); var th6 = document.createElement('th'); var txt6 = document.createTextNode('Bild'); var th7 = document.createElement('th'); var txt7 = document.createTextNode('Delete'); var th8 = document.createElement('th'); var txt8 = document.createTextNode('Update'); th2.appendChild(txt2); tr.appendChild(th2); th3.appendChild(txt3); tr.appendChild(th3); th4.appendChild(txt4); tr.appendChild(th4); th5.appendChild(txt5); tr.appendChild(th5); th6.appendChild(txt6); tr.appendChild(th6); th7.appendChild(txt7); tr.appendChild(th7); th8.appendChild(txt8); tr.appendChild(th8); tbl.appendChild(tr); var i = 0; do{ var row = tbl.insertRow(-1); row.insertCell(-1).innerHTML = cart[i].produktid; var cell2 = row.insertCell(-1); cell2.innerHTML = cart[i].namn; var cell3 = row.insertCell(-1); cell3.innerHTML = cart[i].kategori; var cell4 = row.insertCell(-1); cell4.innerHTML = cart[i].pris; var cell6 = row.insertCell(-1); cell6.innerHTML = '<img src="' + cart[i].img + '" height="70" width="70"/>'; var cell7 = row.insertCell(-1); cell7.innerHTML = "<a href='#' onclick='removeArt(\"" +cart[i].produktid+ "\",\""+ "\");'>Remove</a>"; var cell8 = row.insertCell(-1); cell8.innerHTML = "<a href='#' onclick='getUpdate(\"" +cart[i].produktid+ "\",\""+ "\");'>Update</a>"; tbl.appendChild(row); i++; }while(i< cart.length); $('#main').html(tbl); } //öppnar en dialogruta när man trycker på "Add Article" knappen //med det som finns i diven med id:addArt function showAddArt(){ $('#addArt').dialog({ show:'fade', position:'center' }); } //när man trycker på "Add Article" knappen i dialogrutan så ska den lägga till datan //från formuläret som görs med .serialize som hämtar datan från textfälten. function addArticle(){ $.post('index2.php/AdminController/addProduct',$('#addArtForm').serialize()).done(getAllAdminProducts); $("#addArt").dialog('close'); } //tar bort en artikel med att hämta in dess namn och skicka förfrågningen till modellen function deleteArt(prodid) { $.getJSON("index2.php/AdminController/deleteProduct/"+prodid); } function removeArt(prodid){ var r=confirm("Vill du ta bort den här produkten?"); if (r==true) { x="JA"; } else { x="NEJ"; } if(x === "JA"){ deleteArt(prodid); getAllAdminProducts(); } } //en function som tar in namnet //och använder det när man kallar på getArt function getUpdate(prodid){ getArt(prodid); } //får in artikelid och använder det för att hämta alla artiklar som har samma //id med hjälp av modellen. function getArt(prodid){ $.getJSON("index2.php/Controller/getProdById/"+prodid).done(showArt); } //en function som visar en dialog ruta med färdig i fylld data i textfällten //från den uppgift man vill uppdatera. function showArt(data){ $('#updateId').attr('value',data[0].produktid); $('#updateNamn').attr('value',data[0].namn); $('#updateKategori').attr('value',data[0].kategori); $('#updatePris').attr('value',data[0].pris); $('#updateImg').attr('value',data[0].img); $('#update').dialog({ show:'fade', position:'center', }); } //när man trycker på uppdatera så hämtar den datan från forumlätert med hjälp av // .serialize och skickar datan till modellen. //stänger sen dialogrutan. function updateArt(){ $.post("index2.php/AdminController/updateProduct/", $('#updateForm').serialize()).done(getAllAdminProducts); $("#update").dialog('close'); }
Java
<?php namespace common\models; use Yii; use yii\db\ActiveRecord; /** * This is the model class for table "template_js". * * @property integer $id * @property integer $template_id * @property integer $js_id * * @property Js $js * @property Template $template */ class TemplateJs extends ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'template_js'; } /** * @inheritdoc */ public function rules() { return [ [['template_id', 'js_id'], 'required'], [['template_id', 'js_id'], 'integer'] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => Yii::t('app', 'ID'), 'template_id' => Yii::t('app', 'Template ID'), 'js_id' => Yii::t('app', 'Js ID'), ]; } /** * @return \yii\db\ActiveQuery */ public function getJs() { return $this->hasOne(Js::className(), ['id' => 'js_id']); } /** * @return \yii\db\ActiveQuery */ public function getTemplate() { return $this->hasOne(Template::className(), ['id' => 'template_id']); } }
Java
create table Account_ ( accountId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentAccountId int8, name varchar(75), legalName varchar(75), legalId varchar(75), legalType varchar(75), sicCode varchar(75), tickerSymbol varchar(75), industry varchar(75), type_ varchar(75), size_ varchar(75) ) extent size 16 next size 16 lock mode row; create table Address ( addressId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, street1 varchar(75), street2 varchar(75), street3 varchar(75), city varchar(75), zip varchar(75), regionId int8, countryId int8, typeId int, mailing boolean, primary_ boolean ) extent size 16 next size 16 lock mode row; create table AnnouncementsDelivery ( deliveryId int8 not null primary key, companyId int8, userId int8, type_ varchar(75), email boolean, sms boolean, website boolean ) extent size 16 next size 16 lock mode row; create table AnnouncementsEntry ( uuid_ varchar(75), entryId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, title varchar(75), content lvarchar, url lvarchar, type_ varchar(75), displayDate datetime YEAR TO FRACTION, expirationDate datetime YEAR TO FRACTION, priority int, alert boolean ) extent size 16 next size 16 lock mode row; create table AnnouncementsFlag ( flagId int8 not null primary key, userId int8, createDate datetime YEAR TO FRACTION, entryId int8, value int ) extent size 16 next size 16 lock mode row; create table BlogsEntry ( uuid_ varchar(75), entryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, title varchar(150), urlTitle varchar(150), content text, displayDate datetime YEAR TO FRACTION, draft boolean, allowTrackbacks boolean, trackbacks text ) extent size 16 next size 16 lock mode row; create table BlogsStatsUser ( statsUserId int8 not null primary key, groupId int8, companyId int8, userId int8, entryCount int, lastPostDate datetime YEAR TO FRACTION, ratingsTotalEntries int, ratingsTotalScore float, ratingsAverageScore float ) extent size 16 next size 16 lock mode row; create table BookmarksEntry ( uuid_ varchar(75), entryId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, folderId int8, name varchar(255), url lvarchar, comments lvarchar, visits int, priority int ) extent size 16 next size 16 lock mode row; create table BookmarksFolder ( uuid_ varchar(75), folderId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentFolderId int8, name varchar(75), description lvarchar ) extent size 16 next size 16 lock mode row; create table BrowserTracker ( browserTrackerId int8 not null primary key, userId int8, browserKey int8 ) extent size 16 next size 16 lock mode row; create table CalEvent ( uuid_ varchar(75), eventId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, title varchar(75), description lvarchar, startDate datetime YEAR TO FRACTION, endDate datetime YEAR TO FRACTION, durationHour int, durationMinute int, allDay boolean, timeZoneSensitive boolean, type_ varchar(75), repeating boolean, recurrence text, remindBy int, firstReminder int, secondReminder int ) extent size 16 next size 16 lock mode row; create table ClassName_ ( classNameId int8 not null primary key, value varchar(200) ) extent size 16 next size 16 lock mode row; create table Company ( companyId int8 not null primary key, accountId int8, webId varchar(75), key_ text, virtualHost varchar(75), mx varchar(75), homeURL lvarchar, logoId int8, system boolean ) extent size 16 next size 16 lock mode row; create table Contact_ ( contactId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, accountId int8, parentContactId int8, firstName varchar(75), middleName varchar(75), lastName varchar(75), prefixId int, suffixId int, male boolean, birthday datetime YEAR TO FRACTION, smsSn varchar(75), aimSn varchar(75), facebookSn varchar(75), icqSn varchar(75), jabberSn varchar(75), msnSn varchar(75), mySpaceSn varchar(75), skypeSn varchar(75), twitterSn varchar(75), ymSn varchar(75), employeeStatusId varchar(75), employeeNumber varchar(75), jobTitle varchar(100), jobClass varchar(75), hoursOfOperation varchar(75) ) extent size 16 next size 16 lock mode row; create table Counter ( name varchar(75) not null primary key, currentId int8 ) extent size 16 next size 16 lock mode row; create table Country ( countryId int8 not null primary key, name varchar(75), a2 varchar(75), a3 varchar(75), number_ varchar(75), idd_ varchar(75), active_ boolean ) extent size 16 next size 16 lock mode row; create table CyrusUser ( userId varchar(75) not null primary key, password_ varchar(75) not null ) extent size 16 next size 16 lock mode row; create table CyrusVirtual ( emailAddress varchar(75) not null primary key, userId varchar(75) not null ) extent size 16 next size 16 lock mode row; create table DLFileEntry ( uuid_ varchar(75), fileEntryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), versionUserId int8, versionUserName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, folderId int8, name varchar(255), title varchar(255), description lvarchar, version float, size_ int, readCount int, extraSettings text ) extent size 16 next size 16 lock mode row; create table DLFileRank ( fileRankId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, folderId int8, name varchar(255) ) extent size 16 next size 16 lock mode row; create table DLFileShortcut ( uuid_ varchar(75), fileShortcutId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, folderId int8, toFolderId int8, toName varchar(255) ) extent size 16 next size 16 lock mode row; create table DLFileVersion ( fileVersionId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, folderId int8, name varchar(255), version float, size_ int ) extent size 16 next size 16 lock mode row; create table DLFolder ( uuid_ varchar(75), folderId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentFolderId int8, name varchar(100), description lvarchar, lastPostDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table EmailAddress ( emailAddressId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, address varchar(75), typeId int, primary_ boolean ) extent size 16 next size 16 lock mode row; create table ExpandoColumn ( columnId int8 not null primary key, companyId int8, tableId int8, name varchar(75), type_ int, defaultData lvarchar, typeSettings lvarchar(4096) ) extent size 16 next size 16 lock mode row; create table ExpandoRow ( rowId_ int8 not null primary key, companyId int8, tableId int8, classPK int8 ) extent size 16 next size 16 lock mode row; create table ExpandoTable ( tableId int8 not null primary key, companyId int8, classNameId int8, name varchar(75) ) extent size 16 next size 16 lock mode row; create table ExpandoValue ( valueId int8 not null primary key, companyId int8, tableId int8, columnId int8, rowId_ int8, classNameId int8, classPK int8, data_ lvarchar ) extent size 16 next size 16 lock mode row; create table Group_ ( groupId int8 not null primary key, companyId int8, creatorUserId int8, classNameId int8, classPK int8, parentGroupId int8, liveGroupId int8, name varchar(75), description lvarchar, type_ int, typeSettings lvarchar, friendlyURL varchar(100), active_ boolean ) extent size 16 next size 16 lock mode row; create table Groups_Orgs ( groupId int8 not null, organizationId int8 not null, primary key (groupId, organizationId) ) extent size 16 next size 16 lock mode row; create table Groups_Permissions ( groupId int8 not null, permissionId int8 not null, primary key (groupId, permissionId) ) extent size 16 next size 16 lock mode row; create table Groups_Roles ( groupId int8 not null, roleId int8 not null, primary key (groupId, roleId) ) extent size 16 next size 16 lock mode row; create table Groups_UserGroups ( groupId int8 not null, userGroupId int8 not null, primary key (groupId, userGroupId) ) extent size 16 next size 16 lock mode row; create table IGFolder ( uuid_ varchar(75), folderId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentFolderId int8, name varchar(75), description lvarchar ) extent size 16 next size 16 lock mode row; create table IGImage ( uuid_ varchar(75), imageId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, folderId int8, name varchar(75), description lvarchar, smallImageId int8, largeImageId int8, custom1ImageId int8, custom2ImageId int8 ) extent size 16 next size 16 lock mode row; create table Image ( imageId int8 not null primary key, modifiedDate datetime YEAR TO FRACTION, text_ text, type_ varchar(75), height int, width int, size_ int ) extent size 16 next size 16 lock mode row; create table JournalArticle ( uuid_ varchar(75), id_ int8 not null primary key, resourcePrimKey int8, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, articleId varchar(75), version float, title varchar(100), urlTitle varchar(150), description lvarchar, content text, type_ varchar(75), structureId varchar(75), templateId varchar(75), displayDate datetime YEAR TO FRACTION, approved boolean, approvedByUserId int8, approvedByUserName varchar(75), approvedDate datetime YEAR TO FRACTION, expired boolean, expirationDate datetime YEAR TO FRACTION, reviewDate datetime YEAR TO FRACTION, indexable boolean, smallImage boolean, smallImageId int8, smallImageURL varchar(75) ) extent size 16 next size 16 lock mode row; create table JournalArticleImage ( articleImageId int8 not null primary key, groupId int8, articleId varchar(75), version float, elInstanceId varchar(75), elName varchar(75), languageId varchar(75), tempImage boolean ) extent size 16 next size 16 lock mode row; create table JournalArticleResource ( resourcePrimKey int8 not null primary key, groupId int8, articleId varchar(75) ) extent size 16 next size 16 lock mode row; create table JournalContentSearch ( contentSearchId int8 not null primary key, groupId int8, companyId int8, privateLayout boolean, layoutId int8, portletId varchar(200), articleId varchar(75) ) extent size 16 next size 16 lock mode row; create table JournalFeed ( uuid_ varchar(75), id_ int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, feedId varchar(75), name varchar(75), description lvarchar, type_ varchar(75), structureId varchar(75), templateId varchar(75), rendererTemplateId varchar(75), delta int, orderByCol varchar(75), orderByType varchar(75), targetLayoutFriendlyUrl varchar(75), targetPortletId varchar(75), contentField varchar(75), feedType varchar(75), feedVersion float ) extent size 16 next size 16 lock mode row; create table JournalStructure ( uuid_ varchar(75), id_ int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, structureId varchar(75), parentStructureId varchar(75), name varchar(75), description lvarchar, xsd text ) extent size 16 next size 16 lock mode row; create table JournalTemplate ( uuid_ varchar(75), id_ int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, templateId varchar(75), structureId varchar(75), name varchar(75), description lvarchar, xsl text, langType varchar(75), cacheable boolean, smallImage boolean, smallImageId int8, smallImageURL varchar(75) ) extent size 16 next size 16 lock mode row; create table Layout ( plid int8 not null primary key, groupId int8, companyId int8, privateLayout boolean, layoutId int8, parentLayoutId int8, name lvarchar, title lvarchar, description lvarchar, type_ varchar(75), typeSettings lvarchar(4096), hidden_ boolean, friendlyURL varchar(100), iconImage boolean, iconImageId int8, themeId varchar(75), colorSchemeId varchar(75), wapThemeId varchar(75), wapColorSchemeId varchar(75), css lvarchar, priority int, dlFolderId int8 ) extent size 16 next size 16 lock mode row; create table LayoutSet ( layoutSetId int8 not null primary key, groupId int8, companyId int8, privateLayout boolean, logo boolean, logoId int8, themeId varchar(75), colorSchemeId varchar(75), wapThemeId varchar(75), wapColorSchemeId varchar(75), css lvarchar, pageCount int, virtualHost varchar(75) ) extent size 16 next size 16 lock mode row; create table ListType ( listTypeId int not null primary key, name varchar(75), type_ varchar(75) ) extent size 16 next size 16 lock mode row; create table MBBan ( banId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, banUserId int8 ) extent size 16 next size 16 lock mode row; create table MBCategory ( uuid_ varchar(75), categoryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentCategoryId int8, name varchar(75), description lvarchar, threadCount int, messageCount int, lastPostDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table MBDiscussion ( discussionId int8 not null primary key, classNameId int8, classPK int8, threadId int8 ) extent size 16 next size 16 lock mode row; create table MBMailingList ( uuid_ varchar(75), mailingListId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, categoryId int8, emailAddress varchar(75), inProtocol varchar(75), inServerName varchar(75), inServerPort int, inUseSSL boolean, inUserName varchar(75), inPassword varchar(75), inReadInterval int, outEmailAddress varchar(75), outCustom boolean, outServerName varchar(75), outServerPort int, outUseSSL boolean, outUserName varchar(75), outPassword varchar(75), active_ boolean ) extent size 16 next size 16 lock mode row; create table MBMessage ( uuid_ varchar(75), messageId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, categoryId int8, threadId int8, parentMessageId int8, subject varchar(75), body text, attachments boolean, anonymous boolean, priority float ) extent size 16 next size 16 lock mode row; create table MBMessageFlag ( messageFlagId int8 not null primary key, userId int8, modifiedDate datetime YEAR TO FRACTION, threadId int8, messageId int8, flag int ) extent size 16 next size 16 lock mode row; create table MBStatsUser ( statsUserId int8 not null primary key, groupId int8, userId int8, messageCount int, lastPostDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table MBThread ( threadId int8 not null primary key, groupId int8, categoryId int8, rootMessageId int8, messageCount int, viewCount int, lastPostByUserId int8, lastPostDate datetime YEAR TO FRACTION, priority float ) extent size 16 next size 16 lock mode row; create table MembershipRequest ( membershipRequestId int8 not null primary key, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, groupId int8, comments lvarchar, replyComments lvarchar, replyDate datetime YEAR TO FRACTION, replierUserId int8, statusId int ) extent size 16 next size 16 lock mode row; create table Organization_ ( organizationId int8 not null primary key, companyId int8, parentOrganizationId int8, leftOrganizationId int8, rightOrganizationId int8, name varchar(100), type_ varchar(75), recursable boolean, regionId int8, countryId int8, statusId int, comments lvarchar ) extent size 16 next size 16 lock mode row; create table OrgGroupPermission ( organizationId int8 not null, groupId int8 not null, permissionId int8 not null, primary key (organizationId, groupId, permissionId) ) extent size 16 next size 16 lock mode row; create table OrgGroupRole ( organizationId int8 not null, groupId int8 not null, roleId int8 not null, primary key (organizationId, groupId, roleId) ) extent size 16 next size 16 lock mode row; create table OrgLabor ( orgLaborId int8 not null primary key, organizationId int8, typeId int, sunOpen int, sunClose int, monOpen int, monClose int, tueOpen int, tueClose int, wedOpen int, wedClose int, thuOpen int, thuClose int, friOpen int, friClose int, satOpen int, satClose int ) extent size 16 next size 16 lock mode row; create table PasswordPolicy ( passwordPolicyId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, defaultPolicy boolean, name varchar(75), description lvarchar, changeable boolean, changeRequired boolean, minAge int8, checkSyntax boolean, allowDictionaryWords boolean, minLength int, history boolean, historyCount int, expireable boolean, maxAge int8, warningTime int8, graceLimit int, lockout boolean, maxFailure int, lockoutDuration int8, requireUnlock boolean, resetFailureCount int8 ) extent size 16 next size 16 lock mode row; create table PasswordPolicyRel ( passwordPolicyRelId int8 not null primary key, passwordPolicyId int8, classNameId int8, classPK int8 ) extent size 16 next size 16 lock mode row; create table PasswordTracker ( passwordTrackerId int8 not null primary key, userId int8, createDate datetime YEAR TO FRACTION, password_ varchar(75) ) extent size 16 next size 16 lock mode row; create table Permission_ ( permissionId int8 not null primary key, companyId int8, actionId varchar(75), resourceId int8 ) extent size 16 next size 16 lock mode row; create table Phone ( phoneId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, number_ varchar(75), extension varchar(75), typeId int, primary_ boolean ) extent size 16 next size 16 lock mode row; create table PluginSetting ( pluginSettingId int8 not null primary key, companyId int8, pluginId varchar(75), pluginType varchar(75), roles lvarchar, active_ boolean ) extent size 16 next size 16 lock mode row; create table PollsChoice ( uuid_ varchar(75), choiceId int8 not null primary key, questionId int8, name varchar(75), description lvarchar(1000) ) extent size 16 next size 16 lock mode row; create table PollsQuestion ( uuid_ varchar(75), questionId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, title lvarchar(500), description lvarchar, expirationDate datetime YEAR TO FRACTION, lastVoteDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table PollsVote ( voteId int8 not null primary key, userId int8, questionId int8, choiceId int8, voteDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table Portlet ( id_ int8 not null primary key, companyId int8, portletId varchar(200), roles lvarchar, active_ boolean ) extent size 16 next size 16 lock mode row; create table PortletItem ( portletItemId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), portletId varchar(75), classNameId int8 ) extent size 16 next size 16 lock mode row; create table PortletPreferences ( portletPreferencesId int8 not null primary key, ownerId int8, ownerType int, plid int8, portletId varchar(200), preferences text ) extent size 16 next size 16 lock mode row; create table RatingsEntry ( entryId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, score float ) extent size 16 next size 16 lock mode row; create table RatingsStats ( statsId int8 not null primary key, classNameId int8, classPK int8, totalEntries int, totalScore float, averageScore float ) extent size 16 next size 16 lock mode row; create table Region ( regionId int8 not null primary key, countryId int8, regionCode varchar(75), name varchar(75), active_ boolean ) extent size 16 next size 16 lock mode row; create table Release_ ( releaseId int8 not null primary key, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, buildNumber int, buildDate datetime YEAR TO FRACTION, verified boolean, testString lvarchar(1024) ) extent size 16 next size 16 lock mode row; create table Resource_ ( resourceId int8 not null primary key, codeId int8, primKey varchar(255) ) extent size 16 next size 16 lock mode row; create table ResourceAction ( resourceActionId int8 not null primary key, name varchar(75), actionId varchar(75), bitwiseValue int8 ) extent size 16 next size 16 lock mode row; create table ResourceCode ( codeId int8 not null primary key, companyId int8, name varchar(255), scope int ) extent size 16 next size 16 lock mode row; create table ResourcePermission ( resourcePermissionId int8 not null primary key, companyId int8, name varchar(255), scope int, primKey varchar(255), roleId int8, actionIds int8 ) extent size 16 next size 16 lock mode row; create table Role_ ( roleId int8 not null primary key, companyId int8, classNameId int8, classPK int8, name varchar(75), title lvarchar, description lvarchar, type_ int, subtype varchar(75) ) extent size 16 next size 16 lock mode row; create table Roles_Permissions ( roleId int8 not null, permissionId int8 not null, primary key (roleId, permissionId) ) extent size 16 next size 16 lock mode row; create table SCFrameworkVersi_SCProductVers ( frameworkVersionId int8 not null, productVersionId int8 not null, primary key (frameworkVersionId, productVersionId) ) extent size 16 next size 16 lock mode row; create table SCFrameworkVersion ( frameworkVersionId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), url lvarchar, active_ boolean, priority int ) extent size 16 next size 16 lock mode row; create table SCLicense ( licenseId int8 not null primary key, name varchar(75), url lvarchar, openSource boolean, active_ boolean, recommended boolean ) extent size 16 next size 16 lock mode row; create table SCLicenses_SCProductEntries ( licenseId int8 not null, productEntryId int8 not null, primary key (licenseId, productEntryId) ) extent size 16 next size 16 lock mode row; create table SCProductEntry ( productEntryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), type_ varchar(75), tags varchar(255), shortDescription lvarchar, longDescription lvarchar, pageURL lvarchar, author varchar(75), repoGroupId varchar(75), repoArtifactId varchar(75) ) extent size 16 next size 16 lock mode row; create table SCProductScreenshot ( productScreenshotId int8 not null primary key, companyId int8, groupId int8, productEntryId int8, thumbnailId int8, fullImageId int8, priority int ) extent size 16 next size 16 lock mode row; create table SCProductVersion ( productVersionId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, productEntryId int8, version varchar(75), changeLog lvarchar, downloadPageURL lvarchar, directDownloadURL varchar(2000), repoStoreArtifact boolean ) extent size 16 next size 16 lock mode row; create table ServiceComponent ( serviceComponentId int8 not null primary key, buildNamespace varchar(75), buildNumber int8, buildDate int8, data_ text ) extent size 16 next size 16 lock mode row; create table Shard ( shardId int8 not null primary key, classNameId int8, classPK int8, name varchar(75) ) extent size 16 next size 16 lock mode row; create table ShoppingCart ( cartId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, itemIds lvarchar, couponCodes varchar(75), altShipping int, insure boolean ) extent size 16 next size 16 lock mode row; create table ShoppingCategory ( categoryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentCategoryId int8, name varchar(75), description lvarchar ) extent size 16 next size 16 lock mode row; create table ShoppingCoupon ( couponId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, code_ varchar(75), name varchar(75), description lvarchar, startDate datetime YEAR TO FRACTION, endDate datetime YEAR TO FRACTION, active_ boolean, limitCategories lvarchar, limitSkus lvarchar, minOrder float, discount float, discountType varchar(75) ) extent size 16 next size 16 lock mode row; create table ShoppingItem ( itemId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, categoryId int8, sku varchar(75), name varchar(200), description lvarchar, properties lvarchar, fields_ boolean, fieldsQuantities lvarchar, minQuantity int, maxQuantity int, price float, discount float, taxable boolean, shipping float, useShippingFormula boolean, requiresShipping boolean, stockQuantity int, featured_ boolean, sale_ boolean, smallImage boolean, smallImageId int8, smallImageURL varchar(75), mediumImage boolean, mediumImageId int8, mediumImageURL varchar(75), largeImage boolean, largeImageId int8, largeImageURL varchar(75) ) extent size 16 next size 16 lock mode row; create table ShoppingItemField ( itemFieldId int8 not null primary key, itemId int8, name varchar(75), values_ lvarchar, description lvarchar ) extent size 16 next size 16 lock mode row; create table ShoppingItemPrice ( itemPriceId int8 not null primary key, itemId int8, minQuantity int, maxQuantity int, price float, discount float, taxable boolean, shipping float, useShippingFormula boolean, status int ) extent size 16 next size 16 lock mode row; create table ShoppingOrder ( orderId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, number_ varchar(75), tax float, shipping float, altShipping varchar(75), requiresShipping boolean, insure boolean, insurance float, couponCodes varchar(75), couponDiscount float, billingFirstName varchar(75), billingLastName varchar(75), billingEmailAddress varchar(75), billingCompany varchar(75), billingStreet varchar(75), billingCity varchar(75), billingState varchar(75), billingZip varchar(75), billingCountry varchar(75), billingPhone varchar(75), shipToBilling boolean, shippingFirstName varchar(75), shippingLastName varchar(75), shippingEmailAddress varchar(75), shippingCompany varchar(75), shippingStreet varchar(75), shippingCity varchar(75), shippingState varchar(75), shippingZip varchar(75), shippingCountry varchar(75), shippingPhone varchar(75), ccName varchar(75), ccType varchar(75), ccNumber varchar(75), ccExpMonth int, ccExpYear int, ccVerNumber varchar(75), comments lvarchar, ppTxnId varchar(75), ppPaymentStatus varchar(75), ppPaymentGross float, ppReceiverEmail varchar(75), ppPayerEmail varchar(75), sendOrderEmail boolean, sendShippingEmail boolean ) extent size 16 next size 16 lock mode row; create table ShoppingOrderItem ( orderItemId int8 not null primary key, orderId int8, itemId varchar(75), sku varchar(75), name varchar(200), description lvarchar, properties lvarchar, price float, quantity int, shippedDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table SocialActivity ( activityId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, mirrorActivityId int8, classNameId int8, classPK int8, type_ int, extraData lvarchar, receiverUserId int8 ) extent size 16 next size 16 lock mode row; create table SocialRelation ( uuid_ varchar(75), relationId int8 not null primary key, companyId int8, createDate datetime YEAR TO FRACTION, userId1 int8, userId2 int8, type_ int ) extent size 16 next size 16 lock mode row; create table SocialRequest ( uuid_ varchar(75), requestId int8 not null primary key, groupId int8, companyId int8, userId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, type_ int, extraData lvarchar, receiverUserId int8, status int ) extent size 16 next size 16 lock mode row; create table Subscription ( subscriptionId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, frequency varchar(75) ) extent size 16 next size 16 lock mode row; create table TagsAsset ( assetId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, visible boolean, startDate datetime YEAR TO FRACTION, endDate datetime YEAR TO FRACTION, publishDate datetime YEAR TO FRACTION, expirationDate datetime YEAR TO FRACTION, mimeType varchar(75), title varchar(255), description lvarchar, summary lvarchar, url lvarchar, height int, width int, priority float, viewCount int ) extent size 16 next size 16 lock mode row; create table TagsAssets_TagsEntries ( assetId int8 not null, entryId int8 not null, primary key (assetId, entryId) ) extent size 16 next size 16 lock mode row; create table TagsEntry ( entryId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, parentEntryId int8, name varchar(75), vocabularyId int8 ) extent size 16 next size 16 lock mode row; create table TagsProperty ( propertyId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, entryId int8, key_ varchar(75), value varchar(255) ) extent size 16 next size 16 lock mode row; create table TagsSource ( sourceId int8 not null primary key, parentSourceId int8, name varchar(75), acronym varchar(75) ) extent size 16 next size 16 lock mode row; create table TagsVocabulary ( vocabularyId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), description varchar(75), folksonomy boolean ) extent size 16 next size 16 lock mode row; create table TasksProposal ( proposalId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK varchar(75), name varchar(75), description lvarchar, publishDate datetime YEAR TO FRACTION, dueDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table TasksReview ( reviewId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, proposalId int8, assignedByUserId int8, assignedByUserName varchar(75), stage int, completed boolean, rejected boolean ) extent size 16 next size 16 lock mode row; create table User_ ( uuid_ varchar(75), userId int8 not null primary key, companyId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, defaultUser boolean, contactId int8, password_ varchar(75), passwordEncrypted boolean, passwordReset boolean, passwordModifiedDate datetime YEAR TO FRACTION, reminderQueryQuestion varchar(75), reminderQueryAnswer varchar(75), graceLoginCount int, screenName varchar(75), emailAddress varchar(75), openId lvarchar(1024), portraitId int8, languageId varchar(75), timeZoneId varchar(75), greeting varchar(255), comments lvarchar, firstName varchar(75), middleName varchar(75), lastName varchar(75), jobTitle varchar(75), loginDate datetime YEAR TO FRACTION, loginIP varchar(75), lastLoginDate datetime YEAR TO FRACTION, lastLoginIP varchar(75), lastFailedLoginDate datetime YEAR TO FRACTION, failedLoginAttempts int, lockout boolean, lockoutDate datetime YEAR TO FRACTION, agreedToTermsOfUse boolean, active_ boolean ) extent size 16 next size 16 lock mode row; create table UserGroup ( userGroupId int8 not null primary key, companyId int8, parentUserGroupId int8, name varchar(75), description lvarchar ) extent size 16 next size 16 lock mode row; create table UserGroupRole ( userId int8 not null, groupId int8 not null, roleId int8 not null, primary key (userId, groupId, roleId) ) extent size 16 next size 16 lock mode row; create table UserIdMapper ( userIdMapperId int8 not null primary key, userId int8, type_ varchar(75), description varchar(75), externalUserId varchar(75) ) extent size 16 next size 16 lock mode row; create table Users_Groups ( userId int8 not null, groupId int8 not null, primary key (userId, groupId) ) extent size 16 next size 16 lock mode row; create table Users_Orgs ( userId int8 not null, organizationId int8 not null, primary key (userId, organizationId) ) extent size 16 next size 16 lock mode row; create table Users_Permissions ( userId int8 not null, permissionId int8 not null, primary key (userId, permissionId) ) extent size 16 next size 16 lock mode row; create table Users_Roles ( userId int8 not null, roleId int8 not null, primary key (userId, roleId) ) extent size 16 next size 16 lock mode row; create table Users_UserGroups ( userGroupId int8 not null, userId int8 not null, primary key (userGroupId, userId) ) extent size 16 next size 16 lock mode row; create table UserTracker ( userTrackerId int8 not null primary key, companyId int8, userId int8, modifiedDate datetime YEAR TO FRACTION, sessionId varchar(200), remoteAddr varchar(75), remoteHost varchar(75), userAgent varchar(200) ) extent size 16 next size 16 lock mode row; create table UserTrackerPath ( userTrackerPathId int8 not null primary key, userTrackerId int8, path_ lvarchar, pathDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table Vocabulary ( vocabularyId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), description varchar(75), folksonomy boolean ) extent size 16 next size 16 lock mode row; create table WebDAVProps ( webDavPropsId int8 not null primary key, companyId int8, createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, props text ) extent size 16 next size 16 lock mode row; create table Website ( websiteId int8 not null primary key, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, classNameId int8, classPK int8, url lvarchar, typeId int, primary_ boolean ) extent size 16 next size 16 lock mode row; create table WikiNode ( uuid_ varchar(75), nodeId int8 not null primary key, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, name varchar(75), description lvarchar, lastPostDate datetime YEAR TO FRACTION ) extent size 16 next size 16 lock mode row; create table WikiPage ( uuid_ varchar(75), pageId int8 not null primary key, resourcePrimKey int8, groupId int8, companyId int8, userId int8, userName varchar(75), createDate datetime YEAR TO FRACTION, modifiedDate datetime YEAR TO FRACTION, nodeId int8, title varchar(255), version float, minorEdit boolean, content text, summary lvarchar, format varchar(75), head boolean, parentTitle varchar(75), redirectTitle varchar(75) ) extent size 16 next size 16 lock mode row; create table WikiPageResource ( resourcePrimKey int8 not null primary key, nodeId int8, title varchar(75) ) extent size 16 next size 16 lock mode row; insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (1, 'Canada', 'CA', 'CAN', '124', '001', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (2, 'China', 'CN', 'CHN', '156', '086', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (3, 'France', 'FR', 'FRA', '250', '033', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (4, 'Germany', 'DE', 'DEU', '276', '049', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (5, 'Hong Kong', 'HK', 'HKG', '344', '852', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (6, 'Hungary', 'HU', 'HUN', '348', '036', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (7, 'Israel', 'IL', 'ISR', '376', '972', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (8, 'Italy', 'IT', 'ITA', '380', '039', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (9, 'Japan', 'JP', 'JPN', '392', '081', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (10, 'South Korea', 'KR', 'KOR', '410', '082', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (11, 'Netherlands', 'NL', 'NLD', '528', '031', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (12, 'Portugal', 'PT', 'PRT', '620', '351', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (13, 'Russia', 'RU', 'RUS', '643', '007', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (14, 'Singapore', 'SG', 'SGP', '702', '065', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (15, 'Spain', 'ES', 'ESP', '724', '034', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (16, 'Turkey', 'TR', 'TUR', '792', '090', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (17, 'Vietnam', 'VM', 'VNM', '704', '084', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (18, 'United Kingdom', 'GB', 'GBR', '826', '044', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (19, 'United States', 'US', 'USA', '840', '001', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (20, 'Afghanistan', 'AF', 'AFG', '4', '093', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (21, 'Albania', 'AL', 'ALB', '8', '355', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (22, 'Algeria', 'DZ', 'DZA', '12', '213', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (23, 'American Samoa', 'AS', 'ASM', '16', '684', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (24, 'Andorra', 'AD', 'AND', '20', '376', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (25, 'Angola', 'AO', 'AGO', '24', '244', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (26, 'Anguilla', 'AI', 'AIA', '660', '264', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (27, 'Antarctica', 'AQ', 'ATA', '10', '672', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (28, 'Antigua', 'AG', 'ATG', '28', '268', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (29, 'Argentina', 'AR', 'ARG', '32', '054', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (30, 'Armenia', 'AM', 'ARM', '51', '374', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (31, 'Aruba', 'AW', 'ABW', '533', '297', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (32, 'Australia', 'AU', 'AUS', '36', '061', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (33, 'Austria', 'AT', 'AUT', '40', '043', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (34, 'Azerbaijan', 'AZ', 'AZE', '31', '994', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (35, 'Bahamas', 'BS', 'BHS', '44', '242', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (36, 'Bahrain', 'BH', 'BHR', '48', '973', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (37, 'Bangladesh', 'BD', 'BGD', '50', '880', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (38, 'Barbados', 'BB', 'BRB', '52', '246', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (39, 'Belarus', 'BY', 'BLR', '112', '375', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (40, 'Belgium', 'BE', 'BEL', '56', '032', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (41, 'Belize', 'BZ', 'BLZ', '84', '501', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (42, 'Benin', 'BJ', 'BEN', '204', '229', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (43, 'Bermuda', 'BM', 'BMU', '60', '441', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (44, 'Bhutan', 'BT', 'BTN', '64', '975', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (45, 'Bolivia', 'BO', 'BOL', '68', '591', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (46, 'Bosnia-Herzegovina', 'BA', 'BIH', '70', '387', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (47, 'Botswana', 'BW', 'BWA', '72', '267', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (48, 'Brazil', 'BR', 'BRA', '76', '055', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (49, 'British Virgin Islands', 'VG', 'VGB', '92', '284', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (50, 'Brunei', 'BN', 'BRN', '96', '673', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (51, 'Bulgaria', 'BG', 'BGR', '100', '359', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (52, 'Burkina Faso', 'BF', 'BFA', '854', '226', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (53, 'Burma (Myanmar)', 'MM', 'MMR', '104', '095', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (54, 'Burundi', 'BI', 'BDI', '108', '257', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (55, 'Cambodia', 'KH', 'KHM', '116', '855', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (56, 'Cameroon', 'CM', 'CMR', '120', '237', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (57, 'Cape Verde Island', 'CV', 'CPV', '132', '238', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (58, 'Cayman Islands', 'KY', 'CYM', '136', '345', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (59, 'Central African Republic', 'CF', 'CAF', '140', '236', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (60, 'Chad', 'TD', 'TCD', '148', '235', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (61, 'Chile', 'CL', 'CHL', '152', '056', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (62, 'Christmas Island', 'CX', 'CXR', '162', '061', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (63, 'Cocos Islands', 'CC', 'CCK', '166', '061', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (64, 'Colombia', 'CO', 'COL', '170', '057', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (65, 'Comoros', 'KM', 'COM', '174', '269', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (66, 'Republic of Congo', 'CD', 'COD', '180', '242', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (67, 'Democratic Republic of Congo', 'CG', 'COG', '178', '243', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (68, 'Cook Islands', 'CK', 'COK', '184', '682', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (69, 'Costa Rica', 'CR', 'CRI', '188', '506', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (70, 'Croatia', 'HR', 'HRV', '191', '385', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (71, 'Cuba', 'CU', 'CUB', '192', '053', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (72, 'Cyprus', 'CY', 'CYP', '196', '357', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (73, 'Czech Republic', 'CZ', 'CZE', '203', '420', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (74, 'Denmark', 'DK', 'DNK', '208', '045', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (75, 'Djibouti', 'DJ', 'DJI', '262', '253', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (76, 'Dominica', 'DM', 'DMA', '212', '767', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (77, 'Dominican Republic', 'DO', 'DOM', '214', '809', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (78, 'Ecuador', 'EC', 'ECU', '218', '593', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (79, 'Egypt', 'EG', 'EGY', '818', '020', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (80, 'El Salvador', 'SV', 'SLV', '222', '503', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (81, 'Equatorial Guinea', 'GQ', 'GNQ', '226', '240', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (82, 'Eritrea', 'ER', 'ERI', '232', '291', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (83, 'Estonia', 'EE', 'EST', '233', '372', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (84, 'Ethiopia', 'ET', 'ETH', '231', '251', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (85, 'Faeroe Islands', 'FO', 'FRO', '234', '298', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (86, 'Falkland Islands', 'FK', 'FLK', '238', '500', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (87, 'Fiji Islands', 'FJ', 'FJI', '242', '679', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (88, 'Finland', 'FI', 'FIN', '246', '358', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (89, 'French Guiana', 'GF', 'GUF', '254', '594', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (90, 'French Polynesia', 'PF', 'PYF', '258', '689', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (91, 'Gabon', 'GA', 'GAB', '266', '241', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (92, 'Gambia', 'GM', 'GMB', '270', '220', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (93, 'Georgia', 'GE', 'GEO', '268', '995', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (94, 'Ghana', 'GH', 'GHA', '288', '233', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (95, 'Gibraltar', 'GI', 'GIB', '292', '350', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (96, 'Greece', 'GR', 'GRC', '300', '030', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (97, 'Greenland', 'GL', 'GRL', '304', '299', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (98, 'Grenada', 'GD', 'GRD', '308', '473', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (99, 'Guadeloupe', 'GP', 'GLP', '312', '590', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (100, 'Guam', 'GU', 'GUM', '316', '671', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (101, 'Guatemala', 'GT', 'GTM', '320', '502', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (102, 'Guinea', 'GN', 'GIN', '324', '224', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (103, 'Guinea-Bissau', 'GW', 'GNB', '624', '245', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (104, 'Guyana', 'GY', 'GUY', '328', '592', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (105, 'Haiti', 'HT', 'HTI', '332', '509', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (106, 'Honduras', 'HN', 'HND', '340', '504', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (107, 'Iceland', 'IS', 'ISL', '352', '354', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (108, 'India', 'IN', 'IND', '356', '091', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (109, 'Indonesia', 'ID', 'IDN', '360', '062', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (110, 'Iran', 'IR', 'IRN', '364', '098', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (111, 'Iraq', 'IQ', 'IRQ', '368', '964', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (112, 'Ireland', 'IE', 'IRL', '372', '353', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (113, 'Ivory Coast', 'CI', 'CIV', '384', '225', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (114, 'Jamaica', 'JM', 'JAM', '388', '876', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (115, 'Jordan', 'JO', 'JOR', '400', '962', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (116, 'Kazakhstan', 'KZ', 'KAZ', '398', '007', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (117, 'Kenya', 'KE', 'KEN', '404', '254', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (118, 'Kiribati', 'KI', 'KIR', '408', '686', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (119, 'Kuwait', 'KW', 'KWT', '414', '965', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (120, 'North Korea', 'KP', 'PRK', '408', '850', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (121, 'Kyrgyzstan', 'KG', 'KGZ', '471', '996', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (122, 'Laos', 'LA', 'LAO', '418', '856', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (123, 'Latvia', 'LV', 'LVA', '428', '371', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (124, 'Lebanon', 'LB', 'LBN', '422', '961', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (125, 'Lesotho', 'LS', 'LSO', '426', '266', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (126, 'Liberia', 'LR', 'LBR', '430', '231', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (127, 'Libya', 'LY', 'LBY', '434', '218', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (128, 'Liechtenstein', 'LI', 'LIE', '438', '423', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (129, 'Lithuania', 'LT', 'LTU', '440', '370', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (130, 'Luxembourg', 'LU', 'LUX', '442', '352', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (131, 'Macau', 'MO', 'MAC', '446', '853', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (132, 'Macedonia', 'MK', 'MKD', '807', '389', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (133, 'Madagascar', 'MG', 'MDG', '450', '261', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (134, 'Malawi', 'MW', 'MWI', '454', '265', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (135, 'Malaysia', 'MY', 'MYS', '458', '060', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (136, 'Maldives', 'MV', 'MDV', '462', '960', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (137, 'Mali', 'ML', 'MLI', '466', '223', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (138, 'Malta', 'MT', 'MLT', '470', '356', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (139, 'Marshall Islands', 'MH', 'MHL', '584', '692', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (140, 'Martinique', 'MQ', 'MTQ', '474', '596', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (141, 'Mauritania', 'MR', 'MRT', '478', '222', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (142, 'Mauritius', 'MU', 'MUS', '480', '230', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (143, 'Mayotte Island', 'YT', 'MYT', '175', '269', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (144, 'Mexico', 'MX', 'MEX', '484', '052', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (145, 'Micronesia', 'FM', 'FSM', '583', '691', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (146, 'Moldova', 'MD', 'MDA', '498', '373', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (147, 'Monaco', 'MC', 'MCO', '492', '377', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (148, 'Mongolia', 'MN', 'MNG', '496', '976', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (149, 'Montenegro', 'ME', 'MNE', '499', '382', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (150, 'Montserrat', 'MS', 'MSR', '500', '664', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (151, 'Morocco', 'MA', 'MAR', '504', '212', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (152, 'Mozambique', 'MZ', 'MOZ', '508', '258', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (153, 'Namibia', 'NA', 'NAM', '516', '264', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (154, 'Nauru', 'NR', 'NRU', '520', '674', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (155, 'Nepal', 'NP', 'NPL', '524', '977', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (156, 'Netherlands Antilles', 'AN', 'ANT', '530', '599', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (157, 'New Caledonia', 'NC', 'NCL', '540', '687', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (158, 'New Zealand', 'NZ', 'NZL', '554', '064', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (159, 'Nicaragua', 'NI', 'NIC', '558', '505', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (160, 'Niger', 'NE', 'NER', '562', '227', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (161, 'Nigeria', 'NG', 'NGA', '566', '234', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (162, 'Niue', 'NU', 'NIU', '570', '683', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (163, 'Norfolk Island', 'NF', 'NFK', '574', '672', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (164, 'Norway', 'NO', 'NOR', '578', '047', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (165, 'Oman', 'OM', 'OMN', '512', '968', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (166, 'Pakistan', 'PK', 'PAK', '586', '092', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (167, 'Palau', 'PW', 'PLW', '585', '680', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (168, 'Palestine', 'PS', 'PSE', '275', '970', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (169, 'Panama', 'PA', 'PAN', '591', '507', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (170, 'Papua New Guinea', 'PG', 'PNG', '598', '675', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (171, 'Paraguay', 'PY', 'PRY', '600', '595', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (172, 'Peru', 'PE', 'PER', '604', '051', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (173, 'Philippines', 'PH', 'PHL', '608', '063', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (174, 'Poland', 'PL', 'POL', '616', '048', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (175, 'Puerto Rico', 'PR', 'PRI', '630', '787', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (176, 'Qatar', 'QA', 'QAT', '634', '974', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (177, 'Reunion Island', 'RE', 'REU', '638', '262', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (178, 'Romania', 'RO', 'ROU', '642', '040', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (179, 'Rwanda', 'RW', 'RWA', '646', '250', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (180, 'St. Helena', 'SH', 'SHN', '654', '290', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (181, 'St. Kitts', 'KN', 'KNA', '659', '869', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (182, 'St. Lucia', 'LC', 'LCA', '662', '758', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (183, 'St. Pierre & Miquelon', 'PM', 'SPM', '666', '508', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (184, 'St. Vincent', 'VC', 'VCT', '670', '784', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (185, 'San Marino', 'SM', 'SMR', '674', '378', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (186, 'Sao Tome & Principe', 'ST', 'STP', '678', '239', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (187, 'Saudi Arabia', 'SA', 'SAU', '682', '966', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (188, 'Senegal', 'SN', 'SEN', '686', '221', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (189, 'Serbia', 'RS', 'SRB', '688', '381', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (190, 'Seychelles', 'SC', 'SYC', '690', '248', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (191, 'Sierra Leone', 'SL', 'SLE', '694', '249', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (192, 'Slovakia', 'SK', 'SVK', '703', '421', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (193, 'Slovenia', 'SI', 'SVN', '705', '386', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (194, 'Solomon Islands', 'SB', 'SLB', '90', '677', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (195, 'Somalia', 'SO', 'SOM', '706', '252', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (196, 'South Africa', 'ZA', 'ZAF', '710', '027', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (197, 'Sri Lanka', 'LK', 'LKA', '144', '094', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (198, 'Sudan', 'SD', 'SDN', '736', '095', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (199, 'Suriname', 'SR', 'SUR', '740', '597', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (200, 'Swaziland', 'SZ', 'SWZ', '748', '268', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (201, 'Sweden', 'SE', 'SWE', '752', '046', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (202, 'Switzerland', 'CH', 'CHE', '756', '041', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (203, 'Syria', 'SY', 'SYR', '760', '963', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (204, 'Taiwan', 'TW', 'TWN', '158', '886', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (205, 'Tajikistan', 'TJ', 'TJK', '762', '992', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (206, 'Tanzania', 'TZ', 'TZA', '834', '255', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (207, 'Thailand', 'TH', 'THA', '764', '066', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (208, 'Togo', 'TG', 'TGO', '768', '228', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (209, 'Tonga', 'TO', 'TON', '776', '676', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (210, 'Trinidad & Tobago', 'TT', 'TTO', '780', '868', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (211, 'Tunisia', 'TN', 'TUN', '788', '216', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (212, 'Turkmenistan', 'TM', 'TKM', '795', '993', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (213, 'Turks & Caicos', 'TC', 'TCA', '796', '649', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (214, 'Tuvalu', 'TV', 'TUV', '798', '688', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (215, 'Uganda', 'UG', 'UGA', '800', '256', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (216, 'Ukraine', 'UA', 'UKR', '804', '380', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (217, 'United Arab Emirates', 'AE', 'ARE', '784', '971', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (218, 'Uruguay', 'UY', 'URY', '858', '598', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (219, 'Uzbekistan', 'UZ', 'UZB', '860', '998', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (220, 'Vanuatu', 'VU', 'VUT', '548', '678', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (221, 'Vatican City', 'VA', 'VAT', '336', '039', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (222, 'Venezuela', 'VE', 'VEN', '862', '058', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (223, 'Wallis & Futuna', 'WF', 'WLF', '876', '681', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (224, 'Western Samoa', 'EH', 'ESH', '732', '685', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (225, 'Yemen', 'YE', 'YEM', '887', '967', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (226, 'Zambia', 'ZM', 'ZMB', '894', '260', 'T'); insert into Country (countryId, name, a2, a3, number_, idd_, active_) values (227, 'Zimbabwe', 'ZW', 'ZWE', '716', '263', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1001, 1, 'AB', 'Alberta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1002, 1, 'BC', 'British Columbia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1003, 1, 'MB', 'Manitoba', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1004, 1, 'NB', 'New Brunswick', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1005, 1, 'NL', 'Newfoundland and Labrador', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1006, 1, 'NT', 'Northwest Territories', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1007, 1, 'NS', 'Nova Scotia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1008, 1, 'NU', 'Nunavut', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1009, 1, 'ON', 'Ontario', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1010, 1, 'PE', 'Prince Edward Island', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1011, 1, 'QC', 'Quebec', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1012, 1, 'SK', 'Saskatchewan', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (1013, 1, 'YT', 'Yukon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3001, 3, 'A', 'Alsace', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3002, 3, 'B', 'Aquitaine', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3003, 3, 'C', 'Auvergne', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3004, 3, 'P', 'Basse-Normandie', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3005, 3, 'D', 'Bourgogne', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3006, 3, 'E', 'Bretagne', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3007, 3, 'F', 'Centre', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3008, 3, 'G', 'Champagne-Ardenne', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3009, 3, 'H', 'Corse', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3010, 3, 'GF', 'Guyane', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3011, 3, 'I', 'Franche Comté', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3012, 3, 'GP', 'Guadeloupe', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3013, 3, 'Q', 'Haute-Normandie', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3014, 3, 'J', 'Île-de-France', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3015, 3, 'K', 'Languedoc-Roussillon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3016, 3, 'L', 'Limousin', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3017, 3, 'M', 'Lorraine', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3018, 3, 'MQ', 'Martinique', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3019, 3, 'N', 'Midi-Pyrénées', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3020, 3, 'O', 'Nord Pas de Calais', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3021, 3, 'R', 'Pays de la Loire', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3022, 3, 'S', 'Picardie', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3023, 3, 'T', 'Poitou-Charentes', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3024, 3, 'U', 'Provence-Alpes-Côte-d\'Azur', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3025, 3, 'RE', 'Réunion', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (3026, 3, 'V', 'Rhône-Alpes', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4001, 4, 'BW', 'Baden-Württemberg', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4002, 4, 'BY', 'Bayern', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4003, 4, 'BE', 'Berlin', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4004, 4, 'BR', 'Brandenburg', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4005, 4, 'HB', 'Bremen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4006, 4, 'HH', 'Hamburg', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4007, 4, 'HE', 'Hessen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4008, 4, 'MV', 'Mecklenburg-Vorpommern', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4009, 4, 'NI', 'Niedersachsen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4010, 4, 'NW', 'Nordrhein-Westfalen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4011, 4, 'RP', 'Rheinland-Pfalz', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4012, 4, 'SL', 'Saarland', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4013, 4, 'SN', 'Sachsen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4014, 4, 'ST', 'Sachsen-Anhalt', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4015, 4, 'SH', 'Schleswig-Holstein', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (4016, 4, 'TH', 'Thüringen', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8001, 8, 'AG', 'Agrigento', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8002, 8, 'AL', 'Alessandria', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8003, 8, 'AN', 'Ancona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8004, 8, 'AO', 'Aosta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8005, 8, 'AR', 'Arezzo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8006, 8, 'AP', 'Ascoli Piceno', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8007, 8, 'AT', 'Asti', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8008, 8, 'AV', 'Avellino', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8009, 8, 'BA', 'Bari', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8010, 8, 'BT', 'Barletta-Andria-Trani', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8011, 8, 'BL', 'Belluno', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8012, 8, 'BN', 'Benevento', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8013, 8, 'BG', 'Bergamo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8014, 8, 'BI', 'Biella', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8015, 8, 'BO', 'Bologna', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8016, 8, 'BZ', 'Bolzano', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8017, 8, 'BS', 'Brescia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8018, 8, 'BR', 'Brindisi', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8019, 8, 'CA', 'Cagliari', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8020, 8, 'CL', 'Caltanissetta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8021, 8, 'CB', 'Campobasso', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8022, 8, 'CI', 'Carbonia-Iglesias', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8023, 8, 'CE', 'Caserta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8024, 8, 'CT', 'Catania', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8025, 8, 'CZ', 'Catanzaro', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8026, 8, 'CH', 'Chieti', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8027, 8, 'CO', 'Como', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8028, 8, 'CS', 'Cosenza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8029, 8, 'CR', 'Cremona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8030, 8, 'KR', 'Crotone', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8031, 8, 'CN', 'Cuneo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8032, 8, 'EN', 'Enna', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8033, 8, 'FM', 'Fermo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8034, 8, 'FE', 'Ferrara', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8035, 8, 'FI', 'Firenze', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8036, 8, 'FG', 'Foggia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8037, 8, 'FC', 'Forli-Cesena', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8038, 8, 'FR', 'Frosinone', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8039, 8, 'GE', 'Genova', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8040, 8, 'GO', 'Gorizia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8041, 8, 'GR', 'Grosseto', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8042, 8, 'IM', 'Imperia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8043, 8, 'IS', 'Isernia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8044, 8, 'AQ', 'L''Aquila', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8045, 8, 'SP', 'La Spezia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8046, 8, 'LT', 'Latina', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8047, 8, 'LE', 'Lecce', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8048, 8, 'LC', 'Lecco', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8049, 8, 'LI', 'Livorno', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8050, 8, 'LO', 'Lodi', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8051, 8, 'LU', 'Lucca', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8052, 8, 'MC', 'Macerata', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8053, 8, 'MN', 'Mantova', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8054, 8, 'MS', 'Massa-Carrara', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8055, 8, 'MT', 'Matera', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8056, 8, 'MA', 'Medio Campidano', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8057, 8, 'ME', 'Messina', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8058, 8, 'MI', 'Milano', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8059, 8, 'MO', 'Modena', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8060, 8, 'MZ', 'Monza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8061, 8, 'NA', 'Napoli', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8062, 8, 'NO', 'Novara', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8063, 8, 'NU', 'Nuoro', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8064, 8, 'OG', 'Ogliastra', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8065, 8, 'OT', 'Olbia-Tempio', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8066, 8, 'OR', 'Oristano', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8067, 8, 'PD', 'Padova', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8068, 8, 'PA', 'Palermo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8069, 8, 'PR', 'Parma', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8070, 8, 'PV', 'Pavia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8071, 8, 'PG', 'Perugia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8072, 8, 'PU', 'Pesaro e Urbino', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8073, 8, 'PE', 'Pescara', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8074, 8, 'PC', 'Piacenza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8075, 8, 'PI', 'Pisa', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8076, 8, 'PT', 'Pistoia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8077, 8, 'PN', 'Pordenone', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8078, 8, 'PZ', 'Potenza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8079, 8, 'PO', 'Prato', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8080, 8, 'RG', 'Ragusa', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8081, 8, 'RA', 'Ravenna', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8082, 8, 'RC', 'Reggio Calabria', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8083, 8, 'RE', 'Reggio Emilia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8084, 8, 'RI', 'Rieti', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8085, 8, 'RN', 'Rimini', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8086, 8, 'RM', 'Roma', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8087, 8, 'RO', 'Rovigo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8088, 8, 'SA', 'Salerno', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8089, 8, 'SS', 'Sassari', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8090, 8, 'SV', 'Savona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8091, 8, 'SI', 'Siena', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8092, 8, 'SR', 'Siracusa', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8093, 8, 'SO', 'Sondrio', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8094, 8, 'TA', 'Taranto', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8095, 8, 'TE', 'Teramo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8096, 8, 'TR', 'Terni', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8097, 8, 'TO', 'Torino', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8098, 8, 'TP', 'Trapani', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8099, 8, 'TN', 'Trento', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8100, 8, 'TV', 'Treviso', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8101, 8, 'TS', 'Trieste', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8102, 8, 'UD', 'Udine', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8103, 8, 'VA', 'Varese', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8104, 8, 'VE', 'Venezia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8105, 8, 'VB', 'Verbano-Cusio-Ossola', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8106, 8, 'VC', 'Vercelli', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8107, 8, 'VR', 'Verona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8108, 8, 'VV', 'Vibo Valentia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8109, 8, 'VI', 'Vicenza', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (8110, 8, 'VT', 'Viterbo', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15001, 15, 'AN', 'Andalusia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15002, 15, 'AR', 'Aragon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15003, 15, 'AS', 'Asturias', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15004, 15, 'IB', 'Balearic Islands', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15005, 15, 'PV', 'Basque Country', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15006, 15, 'CN', 'Canary Islands', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15007, 15, 'CB', 'Cantabria', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15008, 15, 'CL', 'Castile and Leon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15009, 15, 'CM', 'Castile-La Mancha', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15010, 15, 'CT', 'Catalonia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15011, 15, 'CE', 'Ceuta', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15012, 15, 'EX', 'Extremadura', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15013, 15, 'GA', 'Galicia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15014, 15, 'LO', 'La Rioja', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15015, 15, 'M', 'Madrid', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15016, 15, 'ML', 'Melilla', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15017, 15, 'MU', 'Murcia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15018, 15, 'NA', 'Navarra', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (15019, 15, 'VC', 'Valencia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19001, 19, 'AL', 'Alabama', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19002, 19, 'AK', 'Alaska', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19003, 19, 'AZ', 'Arizona', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19004, 19, 'AR', 'Arkansas', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19005, 19, 'CA', 'California', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19006, 19, 'CO', 'Colorado', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19007, 19, 'CT', 'Connecticut', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19008, 19, 'DC', 'District of Columbia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19009, 19, 'DE', 'Delaware', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19010, 19, 'FL', 'Florida', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19011, 19, 'GA', 'Georgia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19012, 19, 'HI', 'Hawaii', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19013, 19, 'ID', 'Idaho', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19014, 19, 'IL', 'Illinois', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19015, 19, 'IN', 'Indiana', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19016, 19, 'IA', 'Iowa', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19017, 19, 'KS', 'Kansas', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19018, 19, 'KY', 'Kentucky ', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19019, 19, 'LA', 'Louisiana ', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19020, 19, 'ME', 'Maine', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19021, 19, 'MD', 'Maryland', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19022, 19, 'MA', 'Massachusetts', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19023, 19, 'MI', 'Michigan', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19024, 19, 'MN', 'Minnesota', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19025, 19, 'MS', 'Mississippi', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19026, 19, 'MO', 'Missouri', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19027, 19, 'MT', 'Montana', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19028, 19, 'NE', 'Nebraska', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19029, 19, 'NV', 'Nevada', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19030, 19, 'NH', 'New Hampshire', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19031, 19, 'NJ', 'New Jersey', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19032, 19, 'NM', 'New Mexico', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19033, 19, 'NY', 'New York', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19034, 19, 'NC', 'North Carolina', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19035, 19, 'ND', 'North Dakota', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19036, 19, 'OH', 'Ohio', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19037, 19, 'OK', 'Oklahoma ', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19038, 19, 'OR', 'Oregon', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19039, 19, 'PA', 'Pennsylvania', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19040, 19, 'PR', 'Puerto Rico', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19041, 19, 'RI', 'Rhode Island', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19042, 19, 'SC', 'South Carolina', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19043, 19, 'SD', 'South Dakota', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19044, 19, 'TN', 'Tennessee', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19045, 19, 'TX', 'Texas', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19046, 19, 'UT', 'Utah', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19047, 19, 'VT', 'Vermont', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19048, 19, 'VA', 'Virginia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19049, 19, 'WA', 'Washington', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19050, 19, 'WV', 'West Virginia', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19051, 19, 'WI', 'Wisconsin', 'T'); insert into Region (regionId, countryId, regionCode, name, active_) values (19052, 19, 'WY', 'Wyoming', 'T'); -- -- List types for accounts -- insert into ListType (listTypeId, name, type_) values (10000, 'Billing', 'com.liferay.portal.model.Account.address'); insert into ListType (listTypeId, name, type_) values (10001, 'Other', 'com.liferay.portal.model.Account.address'); insert into ListType (listTypeId, name, type_) values (10002, 'P.O. Box', 'com.liferay.portal.model.Account.address'); insert into ListType (listTypeId, name, type_) values (10003, 'Shipping', 'com.liferay.portal.model.Account.address'); insert into ListType (listTypeId, name, type_) values (10004, 'E-mail', 'com.liferay.portal.model.Account.emailAddress'); insert into ListType (listTypeId, name, type_) values (10005, 'E-mail 2', 'com.liferay.portal.model.Account.emailAddress'); insert into ListType (listTypeId, name, type_) values (10006, 'E-mail 3', 'com.liferay.portal.model.Account.emailAddress'); insert into ListType (listTypeId, name, type_) values (10007, 'Fax', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10008, 'Local', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10009, 'Other', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10010, 'Toll-Free', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10011, 'TTY', 'com.liferay.portal.model.Account.phone'); insert into ListType (listTypeId, name, type_) values (10012, 'Intranet', 'com.liferay.portal.model.Account.website'); insert into ListType (listTypeId, name, type_) values (10013, 'Public', 'com.liferay.portal.model.Account.website'); -- -- List types for contacts -- insert into ListType (listTypeId, name, type_) values (11000, 'Business', 'com.liferay.portal.model.Contact.address'); insert into ListType (listTypeId, name, type_) values (11001, 'Other', 'com.liferay.portal.model.Contact.address'); insert into ListType (listTypeId, name, type_) values (11002, 'Personal', 'com.liferay.portal.model.Contact.address'); insert into ListType (listTypeId, name, type_) values (11003, 'E-mail', 'com.liferay.portal.model.Contact.emailAddress'); insert into ListType (listTypeId, name, type_) values (11004, 'E-mail 2', 'com.liferay.portal.model.Contact.emailAddress'); insert into ListType (listTypeId, name, type_) values (11005, 'E-mail 3', 'com.liferay.portal.model.Contact.emailAddress'); insert into ListType (listTypeId, name, type_) values (11006, 'Business', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11007, 'Business Fax', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11008, 'Mobile', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11009, 'Other', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11010, 'Pager', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11011, 'Personal', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11012, 'Personal Fax', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11013, 'TTY', 'com.liferay.portal.model.Contact.phone'); insert into ListType (listTypeId, name, type_) values (11014, 'Dr.', 'com.liferay.portal.model.Contact.prefix'); insert into ListType (listTypeId, name, type_) values (11015, 'Mr.', 'com.liferay.portal.model.Contact.prefix'); insert into ListType (listTypeId, name, type_) values (11016, 'Mrs.', 'com.liferay.portal.model.Contact.prefix'); insert into ListType (listTypeId, name, type_) values (11017, 'Ms.', 'com.liferay.portal.model.Contact.prefix'); insert into ListType (listTypeId, name, type_) values (11020, 'II', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11021, 'III', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11022, 'IV', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11023, 'Jr.', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11024, 'PhD.', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11025, 'Sr.', 'com.liferay.portal.model.Contact.suffix'); insert into ListType (listTypeId, name, type_) values (11026, 'Blog', 'com.liferay.portal.model.Contact.website'); insert into ListType (listTypeId, name, type_) values (11027, 'Business', 'com.liferay.portal.model.Contact.website'); insert into ListType (listTypeId, name, type_) values (11028, 'Other', 'com.liferay.portal.model.Contact.website'); insert into ListType (listTypeId, name, type_) values (11029, 'Personal', 'com.liferay.portal.model.Contact.website'); -- -- List types for organizations -- insert into ListType (listTypeId, name, type_) values (12000, 'Billing', 'com.liferay.portal.model.Organization.address'); insert into ListType (listTypeId, name, type_) values (12001, 'Other', 'com.liferay.portal.model.Organization.address'); insert into ListType (listTypeId, name, type_) values (12002, 'P.O. Box', 'com.liferay.portal.model.Organization.address'); insert into ListType (listTypeId, name, type_) values (12003, 'Shipping', 'com.liferay.portal.model.Organization.address'); insert into ListType (listTypeId, name, type_) values (12004, 'E-mail', 'com.liferay.portal.model.Organization.emailAddress'); insert into ListType (listTypeId, name, type_) values (12005, 'E-mail 2', 'com.liferay.portal.model.Organization.emailAddress'); insert into ListType (listTypeId, name, type_) values (12006, 'E-mail 3', 'com.liferay.portal.model.Organization.emailAddress'); insert into ListType (listTypeId, name, type_) values (12007, 'Fax', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12008, 'Local', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12009, 'Other', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12010, 'Toll-Free', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12011, 'TTY', 'com.liferay.portal.model.Organization.phone'); insert into ListType (listTypeId, name, type_) values (12012, 'Administrative', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12013, 'Contracts', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12014, 'Donation', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12015, 'Retail', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12016, 'Training', 'com.liferay.portal.model.Organization.service'); insert into ListType (listTypeId, name, type_) values (12017, 'Full Member', 'com.liferay.portal.model.Organization.status'); insert into ListType (listTypeId, name, type_) values (12018, 'Provisional Member', 'com.liferay.portal.model.Organization.status'); insert into ListType (listTypeId, name, type_) values (12019, 'Intranet', 'com.liferay.portal.model.Organization.website'); insert into ListType (listTypeId, name, type_) values (12020, 'Public', 'com.liferay.portal.model.Organization.website'); insert into Counter values ('com.liferay.counter.model.Counter', 10000); insert into Release_ (releaseId, createDate, modifiedDate, buildNumber, verified) values (1, CURRENT YEAR TO FRACTION, CURRENT YEAR TO FRACTION, 5203, 'F'); create table QUARTZ_JOB_DETAILS ( JOB_NAME varchar(80) not null, JOB_GROUP varchar(80) not null, DESCRIPTION varchar(120), JOB_CLASS_NAME varchar(128) not null, IS_DURABLE boolean not null, IS_VOLATILE boolean not null, IS_STATEFUL boolean not null, REQUESTS_RECOVERY boolean not null, JOB_DATA byte in table, primary key (JOB_NAME, JOB_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_JOB_LISTENERS ( JOB_NAME varchar(80) not null, JOB_GROUP varchar(80) not null, JOB_LISTENER varchar(80) not null, primary key (JOB_NAME, JOB_GROUP, JOB_LISTENER) ) extent size 16 next size 16 lock mode row; create table QUARTZ_TRIGGERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, JOB_NAME varchar(80) not null, JOB_GROUP varchar(80) not null, IS_VOLATILE boolean not null, DESCRIPTION varchar(120), NEXT_FIRE_TIME int8, PREV_FIRE_TIME int8, PRIORITY int, TRIGGER_STATE varchar(16) not null, TRIGGER_TYPE varchar(8) not null, START_TIME int8 not null, END_TIME int8, CALENDAR_NAME varchar(80), MISFIRE_INSTR int, JOB_DATA byte in table, primary key (TRIGGER_NAME, TRIGGER_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_SIMPLE_TRIGGERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, REPEAT_COUNT int8 not null, REPEAT_INTERVAL int8 not null, TIMES_TRIGGERED int8 not null, primary key (TRIGGER_NAME, TRIGGER_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_CRON_TRIGGERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, CRON_EXPRESSION varchar(80) not null, TIME_ZONE_ID varchar(80), primary key (TRIGGER_NAME, TRIGGER_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_BLOB_TRIGGERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, BLOB_DATA byte in table, primary key (TRIGGER_NAME, TRIGGER_GROUP) ) extent size 16 next size 16 lock mode row; create table QUARTZ_TRIGGER_LISTENERS ( TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, TRIGGER_LISTENER varchar(80) not null, primary key (TRIGGER_NAME, TRIGGER_GROUP, TRIGGER_LISTENER) ) extent size 16 next size 16 lock mode row; create table QUARTZ_CALENDARS ( CALENDAR_NAME varchar(80) not null primary key, CALENDAR byte in table not null ) extent size 16 next size 16 lock mode row; create table QUARTZ_PAUSED_TRIGGER_GRPS ( TRIGGER_GROUP varchar(80) not null primary key ) extent size 16 next size 16 lock mode row; create table QUARTZ_FIRED_TRIGGERS ( ENTRY_ID varchar(95) not null primary key, TRIGGER_NAME varchar(80) not null, TRIGGER_GROUP varchar(80) not null, IS_VOLATILE boolean not null, INSTANCE_NAME varchar(80) not null, FIRED_TIME int8 not null, PRIORITY int not null, STATE varchar(16) not null, JOB_NAME varchar(80), JOB_GROUP varchar(80), IS_STATEFUL boolean, REQUESTS_RECOVERY boolean ) extent size 16 next size 16 lock mode row; create table QUARTZ_SCHEDULER_STATE ( INSTANCE_NAME varchar(80) not null primary key, LAST_CHECKIN_TIME int8 not null, CHECKIN_INTERVAL int8 not null ) extent size 16 next size 16 lock mode row; create table QUARTZ_LOCKS ( LOCK_NAME varchar(40) not null primary key ) extent size 16 next size 16 lock mode row; insert into QUARTZ_LOCKS values('TRIGGER_ACCESS'); insert into QUARTZ_LOCKS values('JOB_ACCESS'); insert into QUARTZ_LOCKS values('CALENDAR_ACCESS'); insert into QUARTZ_LOCKS values('STATE_ACCESS'); insert into QUARTZ_LOCKS values('MISFIRE_ACCESS'); create index IX_F7655CC3 on QUARTZ_TRIGGERS (NEXT_FIRE_TIME); create index IX_9955EFB5 on QUARTZ_TRIGGERS (TRIGGER_STATE); create index IX_8040C593 on QUARTZ_TRIGGERS (TRIGGER_STATE, NEXT_FIRE_TIME); create index IX_804154AF on QUARTZ_FIRED_TRIGGERS (INSTANCE_NAME); create index IX_BAB9A1F7 on QUARTZ_FIRED_TRIGGERS (JOB_GROUP); create index IX_ADEE6A17 on QUARTZ_FIRED_TRIGGERS (JOB_NAME); create index IX_64B194F2 on QUARTZ_FIRED_TRIGGERS (TRIGGER_GROUP); create index IX_5FEABBC on QUARTZ_FIRED_TRIGGERS (TRIGGER_NAME); create index IX_20D8706C on QUARTZ_FIRED_TRIGGERS (TRIGGER_NAME, TRIGGER_GROUP);
Java
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="lang:clipboard.copy" content="Copy to clipboard"> <meta name="lang:clipboard.copied" content="Copied to clipboard"> <meta name="lang:search.language" content="en"> <meta name="lang:search.pipeline.stopwords" content="True"> <meta name="lang:search.pipeline.trimmer" content="True"> <meta name="lang:search.result.none" content="No matching documents"> <meta name="lang:search.result.one" content="1 matching document"> <meta name="lang:search.result.other" content="# matching documents"> <meta name="lang:search.tokenizer" content="[\s\-]+"> <link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin> <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet"> <style> body, input { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif } code, kbd, pre { font-family: "Roboto Mono", "Courier New", Courier, monospace } </style> <link rel="stylesheet" href="../_static/stylesheets/application.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/> <link rel="stylesheet" href="../_static/fonts/material-icons.css"/> <meta name="theme-color" content="#3f51b5"> <script src="../_static/javascripts/modernizr.js"></script> <title>statsmodels.miscmodels.count.PoissonGMLE.loglike &#8212; statsmodels</title> <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png"> <link rel="manifest" href="../_static/icons/site.webmanifest"> <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191"> <meta name="msapplication-TileColor" content="#2b5797"> <meta name="msapplication-config" content="../_static/icons/browserconfig.xml"> <link rel="stylesheet" href="../_static/stylesheets/examples.css"> <link rel="stylesheet" href="../_static/stylesheets/deprecation.css"> <link rel="stylesheet" href="../_static/material.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script src="../_static/language_data.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.miscmodels.count.PoissonGMLE.loglikeobs" href="statsmodels.miscmodels.count.PoissonGMLE.loglikeobs.html" /> <link rel="prev" title="statsmodels.miscmodels.count.PoissonGMLE.initialize" href="statsmodels.miscmodels.count.PoissonGMLE.initialize.html" /> </head> <body dir=ltr data-md-color-primary=indigo data-md-color-accent=blue> <svg class="md-svg"> <defs data-children-count="0"> <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg> </defs> </svg> <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search"> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <a href="#generated/statsmodels.miscmodels.count.PoissonGMLE.loglike" tabindex="1" class="md-skip"> Skip to content </a> <header class="md-header" data-md-component="header"> <nav class="md-header-nav md-grid"> <div class="md-flex navheader"> <div class="md-flex__cell md-flex__cell--shrink"> <a href="../index.html" title="statsmodels" class="md-header-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" height="26" alt="statsmodels logo"> </a> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label> </div> <div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> <span class="md-header-nav__topic">statsmodels v0.12.1</span> <span class="md-header-nav__topic"> statsmodels.miscmodels.count.PoissonGMLE.loglike </span> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> <div class="md-search" data-md-component="search" role="dialog"> <label class="md-search__overlay" for="__search"></label> <div class="md-search__inner" role="search"> <form class="md-search__form" action="../search.html" method="GET" name="search"> <input type="text" class="md-search__input" name="q" placeholder="Search" autocapitalize="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <label class="md-icon md-search__icon" for="__search"></label> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> &#xE5CD; </button> </form> <div class="md-search__output"> <div class="md-search__scrollwrap" data-md-scrollfix> <div class="md-search-result" data-md-component="result"> <div class="md-search-result__meta"> Type to start searching </div> <ol class="md-search-result__list"></ol> </div> </div> </div> </div> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <div class="md-header-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> </div> <script src="../_static/javascripts/version_dropdown.js"></script> <script> var json_loc = "../_static/versions.json", target_loc = "../../", text = "Versions"; $( document ).ready( add_version_dropdown(json_loc, target_loc, text)); </script> </div> </nav> </header> <div class="md-container"> <nav class="md-tabs" data-md-component="tabs"> <div class="md-tabs__inner md-grid"> <ul class="md-tabs__list"> <li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li> <li class="md-tabs__item"><a href="../miscmodels.html" class="md-tabs__link">Other Models <code class="xref py py-mod docutils literal notranslate"><span class="pre">miscmodels</span></code></a></li> <li class="md-tabs__item"><a href="statsmodels.miscmodels.count.PoissonGMLE.html" class="md-tabs__link">statsmodels.miscmodels.count.PoissonGMLE</a></li> </ul> </div> </nav> <main class="md-main"> <div class="md-main__inner md-grid" data-md-component="container"> <div class="md-sidebar md-sidebar--primary" data-md-component="navigation"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--primary" data-md-level="0"> <label class="md-nav__title md-nav__title--site" for="__drawer"> <a href="../index.html" title="statsmodels" class="md-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48"> </a> <a href="../index.html" title="statsmodels">statsmodels v0.12.1</a> </label> <div class="md-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../install.html" class="md-nav__link">Installing statsmodels</a> </li> <li class="md-nav__item"> <a href="../gettingstarted.html" class="md-nav__link">Getting started</a> </li> <li class="md-nav__item"> <a href="../user-guide.html" class="md-nav__link">User Guide</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../user-guide.html#background" class="md-nav__link">Background</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../duration.html" class="md-nav__link">Methods for Survival and Duration Analysis</a> </li> <li class="md-nav__item"> <a href="../nonparametric.html" class="md-nav__link">Nonparametric Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">nonparametric</span></code></a> </li> <li class="md-nav__item"> <a href="../gmm.html" class="md-nav__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a> </li> <li class="md-nav__item"> <a href="../miscmodels.html" class="md-nav__link">Other Models <code class="xref py py-mod docutils literal notranslate"><span class="pre">miscmodels</span></code></a> </li> <li class="md-nav__item"> <a href="../multivariate.html" class="md-nav__link">Multivariate Statistics <code class="xref py py-mod docutils literal notranslate"><span class="pre">multivariate</span></code></a> </li></ul> </li> <li class="md-nav__item"> <a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a> </li></ul> </li> <li class="md-nav__item"> <a href="../examples/index.html" class="md-nav__link">Examples</a> </li> <li class="md-nav__item"> <a href="../api.html" class="md-nav__link">API Reference</a> </li> <li class="md-nav__item"> <a href="../about.html" class="md-nav__link">About statsmodels</a> </li> <li class="md-nav__item"> <a href="../dev/index.html" class="md-nav__link">Developer Page</a> </li> <li class="md-nav__item"> <a href="../release/index.html" class="md-nav__link">Release Notes</a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--secondary"> <ul class="md-nav__list" data-md-scrollfix=""> <li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.miscmodels.count.PoissonGMLE.loglike.rst.txt">Show Source</a> </li> <li id="searchbox" class="md-nav__item"></li> </ul> </nav> </div> </div> </div> <div class="md-content"> <article class="md-content__inner md-typeset" role="main"> <h1 id="generated-statsmodels-miscmodels-count-poissongmle-loglike--page-root">statsmodels.miscmodels.count.PoissonGMLE.loglike<a class="headerlink" href="#generated-statsmodels-miscmodels-count-poissongmle-loglike--page-root" title="Permalink to this headline">¶</a></h1> <dl class="py method"> <dt id="statsmodels.miscmodels.count.PoissonGMLE.loglike"> <code class="sig-prename descclassname">PoissonGMLE.</code><code class="sig-name descname">loglike</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">params</span></em><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.miscmodels.count.PoissonGMLE.loglike" title="Permalink to this definition">¶</a></dt> <dd><p>Log-likelihood of model at params</p> </dd></dl> </article> </div> </div> </main> </div> <footer class="md-footer"> <div class="md-footer-nav"> <nav class="md-footer-nav__inner md-grid"> <a href="statsmodels.miscmodels.count.PoissonGMLE.initialize.html" title="statsmodels.miscmodels.count.PoissonGMLE.initialize" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <div class="md-flex__cell md-flex__cell--shrink"> <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> </div> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> <span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Previous </span> statsmodels.miscmodels.count.PoissonGMLE.initialize </span> </div> </a> <a href="statsmodels.miscmodels.count.PoissonGMLE.loglikeobs.html" title="statsmodels.miscmodels.count.PoissonGMLE.loglikeobs" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Next </span> statsmodels.miscmodels.count.PoissonGMLE.loglikeobs </span> </div> <div class="md-flex__cell md-flex__cell--shrink"><i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> </div> </a> </nav> </div> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-footer-copyright"> <div class="md-footer-copyright__highlight"> &#169; Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. </div> Last updated on Oct 29, 2020. <br/> Created using <a href="http://www.sphinx-doc.org/">Sphinx</a> 3.2.1. and <a href="https://github.com/bashtage/sphinx-material/">Material for Sphinx</a> </div> </div> </div> </footer> <script src="../_static/javascripts/application.js"></script> <script>app.initialize({version: "1.0.4", url: {base: ".."}})</script> </body> </html>
Java
/** * Copyright (c) 2015, Legendum Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of ntil nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * ntil - create a handler to call a function until the result is good. * * This package provides a single method "ntil()" which is called thus: * * ntil(performer, success, failure, opts) * * checker - a function to check a result and return true or false * performer - a function to call to perform a task which may succeed or fail * success - an optional function to process the result of a successful call * failure - an optional function to process the result of a failed call * opts - an optional hash of options (see below) * * ntil() will return a handler that may be called with any number of arguments. * The performer function will receive these arguments, with a final "next" arg * appended to the argument list, such that it should be called on completion, * passing the result (as a single argument *or* multiple arguments) thus: * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * var ntil = require('ntil'); * var handler = ntil( * function(result) { return result === 3 }, // the checker * function myFunc(a, b, next) { next(a + b) }, // the performer * function(result) { console.log('success! ' + result) }, // on success * function(result) { console.log('failure! ' + result) }, // on failure * {logger: console} // options * ); * * handler(1, 1); // this will fail after 7 attempts (taking about a minute) * handler(1, 2); // this will succeed immediately * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * ...and here's the equivalent code in a syntax more similar to promises: * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * var ntil = require('./ntil'); * var handler = ntil( * function(result) { return result === 3 } * ).exec( * function myFunc(a, b, next) { next(a + b) } * ).done( * function(result) { console.log('success! ' + result) } * ).fail( * function(result) { console.log('failure! ' + result) } * }.opts( * {logger: console} * ).func(); * * handler(1, 1); // this will fail after 7 attempts (taking about a minute) * handler(1, 2); // this will succeed immediately * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * Note that the logger includes "myFunc" in log messages, because the function * is named. An alternative is to use the "name" option (see below). * * The "checker" function checks that the result is 3, causing the first handler * to fail (it has a result of 2, not 3) and the second handler to succeed. * * The output from both these examples is: * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * perform: 1 failure - trying again in 1 seconds * perform: success * success! 3 * perform: 2 failures - trying again in 2 seconds * perform: 3 failures - trying again in 4 seconds * perform: 4 failures - trying again in 8 seconds * perform: 5 failures - trying again in 16 seconds * perform: 6 failures - trying again in 32 seconds * perform: too many failures (7) * failure! 2 * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * * The options may optionally include: * name: The name of the "performer" function we're calling, e.g. "getData" * logger: A logger object that responds to "info" and "warn" method calls * waitSecs: The initial duration in seconds to wait before retrying * waitMult: The factor by which to multiply the wait duration upon each retry * maxCalls: The maximum number of calls to make before failing * * Note that "waitSecs" defaults to 1, "waitMult" defaults to 2, and "maxCalls" * defaults to 7. * * Ideas for improvement? Email kevin.hutchinson@legendum.com */ (function() { "use strict"; var sig = "Check params: function ntil(checker, performer, success, failure, opts)"; function chain(checker, opts) { this.opts = function(options) { opts = options; return this } this.exec = function(perform) { this.perform = perform; return this }; this.done = function(success) { this.success = success; return this }; this.fail = function(failure) { this.failure = failure; return this }; this.func = function() { return ntil(checker, this.perform, this.success, this.failure, opts); }; } function ntil(checker, performer, success, failure, opts) { opts = opts || {}; if (typeof checker !== 'function') throw sig; if (typeof performer !== 'function') return new chain(checker, performer); var name = opts.name || performer.name || 'anonymous function', logger = opts.logger, waitSecs = opts.waitSecs || 1, waitMult = opts.waitMult || 2, maxCalls = opts.maxCalls || 7; // it takes about a minute for 7 attempts return function() { var args = Array.prototype.slice.call(arguments, 0), wait = waitSecs, calls = 0; function next() { var result = Array.prototype.slice.call(arguments, 0); if (checker.apply(checker, result) === true) { if (logger) logger.info(name + ': success'); if (typeof success === 'function') success.apply(success, result); } else { calls++; if (calls < maxCalls) { if (logger) logger.warn(name + ': ' + calls + ' failure' + (calls === 1 ? '' : 's') + ' - trying again in ' + wait + ' seconds'); setTimeout(function() { invoke(); }, wait * 1000); wait *= waitMult; } else { if (logger) logger.warn(name + ': too many failures (' + calls + ')'); if (typeof failure === 'function') failure.apply(failure, result); } } } function invoke() { try { performer.apply(performer, args); } catch (e) { if (logger) logger.warn(name + ': exception "' + e + '"'); next(); } } args.push(next); invoke(); } } if (typeof module !== 'undefined' && module.exports) { module.exports = ntil; } else { // browser? this.ntil = ntil; } }).call(this);
Java
<?php use yii\bootstrap\ActiveForm; use yii\helpers\Html; use yii\grid\GridView; use yii\helpers\Url; use app\models\Ticket; $this->params['breadcrumbs'][] = ['label' => Yii::t('app','ticket list'), 'url' => ['#']]; $this->params['addUrl'] = 'ticket/new'; ?> <div class="row"> <div class="col-lg-12"> <!-- START YOUR CONTENT HERE --> <div class="portlet"><!-- /Portlet --> <div class="portlet-heading dark"> <div class="portlet-title"> <h4><i class="fa fa-newspaper-o"></i> <?=Yii::t("app","my ticket") ?></h4> </div> <div class="portlet-widgets"> <a data-toggle="collapse" data-parent="#accordion" href="#basic"><i class="fa fa-chevron-down"></i></a> <span class="divider"></span> <a href="#" class="box-close"><i class="fa fa-times"></i></a> </div> <div class="clearfix"></div> </div> <div id="basic" class="panel-collapse collapse in"> <div class="portlet-body"> <div class="row"> <div class="log-lg-12"> <?=Yii::$app->session->getFlash("message")?> </div> <div class="col-lg-12"> <?=GridView::widget( [ 'dataProvider' => $dataProvider, //'filterModel' => $model, 'tableOptions' => ['class'=>'table table-bordered table-hover tc-table table-responsive'], 'layout' => '<div class="hidden-sm hidden-xs hidden-md">{summary}</div>{errors}{items}<div class="pagination pull-right">{pager}</div> <div class="clearfix"></div>', 'columns'=>[ ['class' => 'yii\grid\SerialColumn'], 'ticket_id' => [ 'attribute' => 'ticket_id', 'footer' => Yii::t('app','id'), 'headerOptions' => ['class'=>'hidden-xs hidden-sm'], 'contentOptions'=> ['class'=>'hidden-xs hidden-sm'], 'footerOptions' => ['class'=>'hidden-xs hidden-sm'], ], 'ticket_date' => [ 'attribute' => 'ticket_date', 'footer' => Yii::t('app','date'), ], 'ticket_subject' => [ 'attribute' => 'ticket_subject', 'footer' => Yii::t('app','subject'), ], 'ticket_status_string' => [ 'attribute' => 'ticket_status_string', 'footer' => Yii::t('app','status'), 'headerOptions' => ['class'=>'hidden-xs hidden-sm'], 'contentOptions'=> ['class'=>'hidden-xs hidden-sm'], 'footerOptions' => ['class'=>'hidden-xs hidden-sm'], ], 'helpdesk_name' => [ 'attribute' => 'helpdesk_name', 'footer' => Yii::t('app','support'), ], ], 'showFooter' => true , ] );?> </div> </div> </div> </div> </div><!--/Portlet --> </div> <!-- Enf of col lg--> </div> <!-- ENd of row --> <script> //for tables checkbox dem jQuery(function($) { $('.input-group.date').datepicker({ autoclose : true, format: "dd/mm/yyyy" }); $('table th input:checkbox').on('click' , function(){ var that = this; $(this).closest('table').find('tr > td:first-child input:checkbox') .each(function(){ this.checked = that.checked; $(this).closest('tr').toggleClass('selected'); }); }); $('.btn-pwd').click(function (e) { if (!confirm('<?=Yii::t('app/message','msg btn password')?>')) return false; return true; }); $('.btn-delete').click(function (e) { if (!confirm('<?=Yii::t('app/message','msg btn delete')?>')) return false; return true; }); }); </script>
Java
/* * This file is part of the Soletta Project * * Copyright (C) 2015 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <errno.h> #include <netinet/in.h> #include <stdint.h> #include <stdbool.h> #include <stdio.h> #define SOL_LOG_DOMAIN &_sol_oic_server_log_domain #include "cbor.h" #include "sol-coap.h" #include "sol-json.h" #include "sol-log-internal.h" #include "sol-platform.h" #include "sol-str-slice.h" #include "sol-util.h" #include "sol-vector.h" #include "sol-oic-cbor.h" #include "sol-oic-common.h" #include "sol-oic-server.h" SOL_LOG_INTERNAL_DECLARE(_sol_oic_server_log_domain, "oic-server"); struct sol_oic_server { struct sol_coap_server *server; struct sol_coap_server *dtls_server; struct sol_vector resources; struct sol_oic_server_information *information; int refcnt; }; struct sol_oic_server_resource { struct sol_coap_resource *coap; char *href; char *rt; char *iface; enum sol_oic_resource_flag flags; struct { struct { sol_coap_responsecode_t (*handle)(const struct sol_network_link_addr *cliaddr, const void *data, const struct sol_vector *input, struct sol_vector *output); } get, put, post, delete; const void *data; } callback; }; static struct sol_oic_server oic_server; #define OIC_SERVER_CHECK(ret) \ do { \ if (oic_server.refcnt == 0) { \ SOL_WRN("OIC API used before initialization"); \ return ret; \ } \ } while (0) #define OIC_COAP_SERVER_UDP_PORT 5683 #define OIC_COAP_SERVER_DTLS_PORT 5684 static int _sol_oic_server_d(struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr, void *data) { const uint8_t format_cbor = SOL_COAP_CONTENTTYPE_APPLICATION_CBOR; CborEncoder encoder, root, map, rep_map; CborError err; struct sol_coap_packet *response; const char *os_version; uint8_t *payload; uint16_t size; OIC_SERVER_CHECK(-ENOTCONN); response = sol_coap_packet_new(req); SOL_NULL_CHECK(response, -ENOMEM); sol_coap_add_option(response, SOL_COAP_OPTION_CONTENT_FORMAT, &format_cbor, sizeof(format_cbor)); if (sol_coap_packet_get_payload(response, &payload, &size) < 0) { SOL_WRN("Couldn't obtain payload from CoAP packet"); goto out; } cbor_encoder_init(&encoder, payload, size, 0); err = cbor_encoder_create_array(&encoder, &root, 2); err |= cbor_encode_uint(&root, SOL_OIC_PAYLOAD_PLATFORM); err |= cbor_encoder_create_map(&root, &map, CborIndefiniteLength); err |= cbor_encode_text_stringz(&map, SOL_OIC_KEY_HREF); err |= cbor_encode_text_stringz(&map, "/oic/d"); err |= cbor_encoder_create_map(&map, &rep_map, CborIndefiniteLength); #define APPEND_KEY_VALUE(k, v) \ do { \ err |= cbor_encode_text_stringz(&rep_map, k); \ err |= cbor_encode_text_string(&rep_map, \ oic_server.information->v.data, oic_server.information->v.len); \ } while (0) APPEND_KEY_VALUE(SOL_OIC_KEY_MANUF_NAME, manufacturer_name); APPEND_KEY_VALUE(SOL_OIC_KEY_MANUF_URL, manufacturer_url); APPEND_KEY_VALUE(SOL_OIC_KEY_MODEL_NUM, model_number); APPEND_KEY_VALUE(SOL_OIC_KEY_MANUF_DATE, manufacture_date); APPEND_KEY_VALUE(SOL_OIC_KEY_PLATFORM_VER, platform_version); APPEND_KEY_VALUE(SOL_OIC_KEY_HW_VER, hardware_version); APPEND_KEY_VALUE(SOL_OIC_KEY_FIRMWARE_VER, firmware_version); APPEND_KEY_VALUE(SOL_OIC_KEY_SUPPORT_URL, support_url); #undef APPEND_KEY_VALUE err |= cbor_encode_text_stringz(&rep_map, SOL_OIC_KEY_PLATFORM_ID); err |= cbor_encode_byte_string(&rep_map, (const uint8_t *)oic_server.information->platform_id.data, oic_server.information->platform_id.len); err |= cbor_encode_text_stringz(&rep_map, SOL_OIC_KEY_SYSTEM_TIME); err |= cbor_encode_text_stringz(&rep_map, ""); err |= cbor_encode_text_stringz(&rep_map, SOL_OIC_KEY_OS_VER); os_version = sol_platform_get_os_version(); err |= cbor_encode_text_stringz(&rep_map, os_version ? os_version : "Unknown"); err |= cbor_encoder_close_container(&rep_map, &map); err |= cbor_encoder_close_container(&map, &root); err |= cbor_encoder_close_container(&encoder, &root); if (err == CborNoError) { sol_coap_header_set_type(response, SOL_COAP_TYPE_ACK); sol_coap_header_set_code(response, SOL_COAP_RSPCODE_OK); sol_coap_packet_set_payload_used(response, encoder.ptr - payload); return sol_coap_send_packet(server, response, cliaddr); } SOL_WRN("Error encoding platform CBOR response: %s", cbor_error_string(err)); out: sol_coap_packet_unref(response); return -ENOMEM; } static const struct sol_coap_resource oic_d_coap_resource = { SOL_SET_API_VERSION(.api_version = SOL_COAP_RESOURCE_API_VERSION, ) .path = { SOL_STR_SLICE_LITERAL("oic"), SOL_STR_SLICE_LITERAL("d"), SOL_STR_SLICE_EMPTY }, .get = _sol_oic_server_d, .flags = SOL_COAP_FLAGS_NONE }; static unsigned int as_nibble(const char c) { if (c >= '0' && c <= '9') return c - '0'; if (c >= 'a' && c <= 'f') return c - 'a' + 10; if (c >= 'A' && c <= 'F') return c - 'A' + 10; SOL_WRN("Invalid hex character: %d", c); return 0; } static const uint8_t * get_machine_id(void) { static uint8_t machine_id[16] = { 0 }; static bool machine_id_set = false; const char *machine_id_buf; if (unlikely(!machine_id_set)) { machine_id_buf = sol_platform_get_machine_id(); if (!machine_id_buf) { SOL_WRN("Could not get machine ID"); memset(machine_id, 0xFF, sizeof(machine_id)); } else { const char *p; size_t i; for (p = machine_id_buf, i = 0; i < 16; i++, p += 2) machine_id[i] = as_nibble(*p) << 4 | as_nibble(*(p + 1)); } machine_id_set = true; } return machine_id; } static int _sol_oic_server_res(struct sol_coap_server *server, const struct sol_coap_resource *resource, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr, void *data) { CborEncoder encoder, array; CborError err; struct sol_oic_server_resource *iter; struct sol_coap_packet *resp; uint16_t size; const uint8_t format_cbor = SOL_COAP_CONTENTTYPE_APPLICATION_CBOR; uint8_t *payload; uint16_t idx; const uint8_t *uri_query; uint16_t uri_query_len; uri_query = sol_coap_find_first_option(req, SOL_COAP_OPTION_URI_QUERY, &uri_query_len); if (uri_query && uri_query_len > sizeof("rt=") - 1) { uri_query += sizeof("rt=") - 1; uri_query_len -= 3; } else { uri_query = NULL; uri_query_len = 0; } resp = sol_coap_packet_new(req); SOL_NULL_CHECK(resp, -ENOMEM); sol_coap_header_set_type(resp, SOL_COAP_TYPE_ACK); sol_coap_add_option(resp, SOL_COAP_OPTION_CONTENT_FORMAT, &format_cbor, sizeof(format_cbor)); sol_coap_packet_get_payload(resp, &payload, &size); cbor_encoder_init(&encoder, payload, size, 0); if (uri_query) { err = cbor_encoder_create_array(&encoder, &array, CborIndefiniteLength); } else { err = cbor_encoder_create_array(&encoder, &array, 1 + oic_server.resources.len); } err |= cbor_encode_uint(&array, SOL_OIC_PAYLOAD_DISCOVERY); SOL_VECTOR_FOREACH_IDX (&oic_server.resources, iter, idx) { CborEncoder map, prop_map, policy_map; if (uri_query && iter->rt) { size_t rt_len = strlen(iter->rt); if (rt_len != uri_query_len) continue; if (memcmp(uri_query, iter->rt, rt_len) != 0) continue; } if (!(iter->flags & SOL_OIC_FLAG_DISCOVERABLE)) continue; if (!(iter->flags & SOL_OIC_FLAG_ACTIVE)) continue; err |= cbor_encoder_create_map(&array, &map, 3); err |= cbor_encode_text_stringz(&map, SOL_OIC_KEY_HREF); err |= cbor_encode_text_stringz(&map, iter->href); err |= cbor_encode_text_stringz(&map, SOL_OIC_KEY_DEVICE_ID); err |= cbor_encode_byte_string(&map, get_machine_id(), 16); err |= cbor_encode_text_stringz(&map, SOL_OIC_KEY_PROPERTIES); err |= cbor_encoder_create_map(&map, &prop_map, !!iter->iface + !!iter->rt + 1); if (iter->iface) { CborEncoder if_array; err |= cbor_encode_text_stringz(&prop_map, SOL_OIC_KEY_INTERFACES); err |= cbor_encoder_create_array(&prop_map, &if_array, 1); err |= cbor_encode_text_stringz(&if_array, iter->iface); err |= cbor_encoder_close_container(&prop_map, &if_array); } if (iter->rt) { CborEncoder rt_array; err |= cbor_encode_text_stringz(&prop_map, SOL_OIC_KEY_RESOURCE_TYPES); err |= cbor_encoder_create_array(&prop_map, &rt_array, 1); err |= cbor_encode_text_stringz(&rt_array, iter->rt); err |= cbor_encoder_close_container(&prop_map, &rt_array); } err |= cbor_encode_text_stringz(&prop_map, SOL_OIC_KEY_POLICY); err |= cbor_encoder_create_map(&prop_map, &policy_map, CborIndefiniteLength); err |= cbor_encode_text_stringz(&policy_map, SOL_OIC_KEY_BITMAP); err |= cbor_encode_uint(&policy_map, iter->flags); err |= cbor_encoder_close_container(&prop_map, &policy_map); err |= cbor_encoder_close_container(&map, &prop_map); err |= cbor_encoder_close_container(&array, &map); } err |= cbor_encoder_close_container(&encoder, &array); if (err != CborNoError) { char addr[SOL_INET_ADDR_STRLEN]; sol_network_addr_to_str(cliaddr, addr, sizeof(addr)); SOL_WRN("Error building response for /oc/core, server %p client %s: %s", oic_server.server, addr, cbor_error_string(err)); sol_coap_header_set_code(resp, SOL_COAP_RSPCODE_INTERNAL_ERROR); } else { sol_coap_header_set_code(resp, SOL_COAP_RSPCODE_OK); sol_coap_packet_set_payload_used(resp, encoder.ptr - payload); } return sol_coap_send_packet(server, resp, cliaddr); } static const struct sol_coap_resource oic_res_coap_resource = { SOL_SET_API_VERSION(.api_version = SOL_COAP_RESOURCE_API_VERSION, ) .path = { SOL_STR_SLICE_LITERAL("oic"), SOL_STR_SLICE_LITERAL("res"), SOL_STR_SLICE_EMPTY }, .get = _sol_oic_server_res, .flags = SOL_COAP_FLAGS_NONE }; static struct sol_oic_server_information * init_static_info(void) { struct sol_oic_server_information information = { .manufacturer_name = SOL_STR_SLICE_LITERAL(OIC_MANUFACTURER_NAME), .manufacturer_url = SOL_STR_SLICE_LITERAL(OIC_MANUFACTURER_URL), .model_number = SOL_STR_SLICE_LITERAL(OIC_MODEL_NUMBER), .manufacture_date = SOL_STR_SLICE_LITERAL(OIC_MANUFACTURE_DATE), .platform_version = SOL_STR_SLICE_LITERAL(OIC_PLATFORM_VERSION), .hardware_version = SOL_STR_SLICE_LITERAL(OIC_HARDWARE_VERSION), .firmware_version = SOL_STR_SLICE_LITERAL(OIC_FIRMWARE_VERSION), .support_url = SOL_STR_SLICE_LITERAL(OIC_SUPPORT_URL) }; struct sol_oic_server_information *info; information.platform_id = SOL_STR_SLICE_STR((const char *)get_machine_id(), 16); info = sol_util_memdup(&information, sizeof(*info)); SOL_NULL_CHECK(info, NULL); return info; } SOL_API int sol_oic_server_init(void) { struct sol_oic_server_information *info; if (oic_server.refcnt > 0) { oic_server.refcnt++; return 0; } SOL_LOG_INTERNAL_INIT_ONCE; info = init_static_info(); SOL_NULL_CHECK(info, -1); oic_server.server = sol_coap_server_new(OIC_COAP_SERVER_UDP_PORT); if (!oic_server.server) goto error; if (!sol_coap_server_register_resource(oic_server.server, &oic_d_coap_resource, NULL)) goto error; if (!sol_coap_server_register_resource(oic_server.server, &oic_res_coap_resource, NULL)) { sol_coap_server_unregister_resource(oic_server.server, &oic_d_coap_resource); goto error; } oic_server.dtls_server = sol_coap_secure_server_new(OIC_COAP_SERVER_DTLS_PORT); if (!oic_server.dtls_server) { if (errno == ENOSYS) { SOL_INF("DTLS support not built in, OIC server running in insecure mode"); } else { SOL_INF("DTLS server could not be created for OIC server: %s", sol_util_strerrora(errno)); } } else { if (!sol_coap_server_register_resource(oic_server.dtls_server, &oic_d_coap_resource, NULL)) { SOL_WRN("Could not register device info secure resource, OIC server running in insecure mode"); sol_coap_server_unref(oic_server.dtls_server); oic_server.dtls_server = NULL; } } oic_server.information = info; sol_vector_init(&oic_server.resources, sizeof(struct sol_oic_server_resource)); oic_server.refcnt++; return 0; error: free(info); return -1; } SOL_API void sol_oic_server_release(void) { struct sol_oic_server_resource *res; uint16_t idx; OIC_SERVER_CHECK(); if (--oic_server.refcnt > 0) return; SOL_VECTOR_FOREACH_REVERSE_IDX (&oic_server.resources, res, idx) sol_coap_server_unregister_resource(oic_server.server, res->coap); if (oic_server.dtls_server) { SOL_VECTOR_FOREACH_REVERSE_IDX (&oic_server.resources, res, idx) sol_coap_server_unregister_resource(oic_server.dtls_server, res->coap); sol_coap_server_unregister_resource(oic_server.dtls_server, &oic_d_coap_resource); sol_coap_server_unref(oic_server.dtls_server); } sol_vector_clear(&oic_server.resources); sol_coap_server_unregister_resource(oic_server.server, &oic_d_coap_resource); sol_coap_server_unregister_resource(oic_server.server, &oic_res_coap_resource); sol_coap_server_unref(oic_server.server); free(oic_server.information); } static void _clear_repr_vector(struct sol_vector *repr) { struct sol_oic_repr_field *field; uint16_t idx; SOL_VECTOR_FOREACH_IDX (repr, field, idx) { if (field->type == SOL_OIC_REPR_TYPE_TEXT_STRING || field->type == SOL_OIC_REPR_TYPE_BYTE_STRING) { free((char *)field->v_slice.data); } } sol_vector_clear(repr); } static int _sol_oic_resource_type_handle( sol_coap_responsecode_t (*handle_fn)(const struct sol_network_link_addr *cliaddr, const void *data, const struct sol_vector *input, struct sol_vector *output), struct sol_coap_server *server, struct sol_coap_packet *req, const struct sol_network_link_addr *cliaddr, struct sol_oic_server_resource *res, bool expect_payload) { const uint8_t format_cbor = SOL_COAP_CONTENTTYPE_APPLICATION_CBOR; struct sol_coap_packet *response; struct sol_vector input = SOL_VECTOR_INIT(struct sol_oic_repr_field); struct sol_vector output = SOL_VECTOR_INIT(struct sol_oic_repr_field); sol_coap_responsecode_t code = SOL_COAP_RSPCODE_INTERNAL_ERROR; OIC_SERVER_CHECK(-ENOTCONN); response = sol_coap_packet_new(req); if (!response) { SOL_WRN("Could not build response packet."); return -1; } if (!handle_fn) { code = SOL_COAP_RSPCODE_NOT_IMPLEMENTED; goto done; } if (expect_payload) { if (!sol_oic_pkt_has_cbor_content(req)) { code = SOL_COAP_RSPCODE_BAD_REQUEST; goto done; } if (sol_oic_decode_cbor_repr(req, &input) != CborNoError) { code = SOL_COAP_RSPCODE_BAD_REQUEST; goto done; } } code = handle_fn(cliaddr, res->callback.data, &input, &output); if (code == SOL_COAP_RSPCODE_CONTENT) { sol_coap_add_option(response, SOL_COAP_OPTION_CONTENT_FORMAT, &format_cbor, sizeof(format_cbor)); if (sol_oic_encode_cbor_repr(response, res->href, &output) != CborNoError) code = SOL_COAP_RSPCODE_INTERNAL_ERROR; } done: sol_coap_header_set_type(response, SOL_COAP_TYPE_ACK); sol_coap_header_set_code(response, code == SOL_COAP_RSPCODE_CONTENT ? SOL_COAP_RSPCODE_OK : code); _clear_repr_vector(&input); /* Output vector is user-built, so it's not safe to call * _clear_repr_vector() on it. Clean the vector itself, but not its * items.*/ sol_vector_clear(&output); return sol_coap_send_packet(server, response, cliaddr); } #define DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(method, expect_payload) \ static int \ _sol_oic_resource_type_ ## method(struct sol_coap_server *server, \ const struct sol_coap_resource *resource, struct sol_coap_packet *req, \ const struct sol_network_link_addr *cliaddr, void *data) \ { \ struct sol_oic_server_resource *res = data; \ return _sol_oic_resource_type_handle(res->callback.method.handle, \ server, req, cliaddr, res, expect_payload); \ } DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(get, false) DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(put, true) DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(post, true) DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD(delete, true) #undef DEFINE_RESOURCE_TYPE_CALLBACK_FOR_METHOD static struct sol_coap_resource * create_coap_resource(struct sol_oic_server_resource *resource) { const struct sol_str_slice endpoint = sol_str_slice_from_str(resource->href); struct sol_coap_resource *res; unsigned int count = 0; unsigned int current; size_t i; for (i = 0; i < endpoint.len; i++) if (endpoint.data[i] == '/') count++; SOL_INT_CHECK(count, == 0, NULL); if (endpoint.data[0] != '/') { SOL_WRN("Invalid endpoint - Path '%.*s' does not start with '/'", SOL_STR_SLICE_PRINT(endpoint)); return NULL; } if (endpoint.data[endpoint.len - 1] == '/') { SOL_WRN("Invalid endpoint - Path '%.*s' ends with '/'", SOL_STR_SLICE_PRINT(endpoint)); return NULL; } /* alloc space for the path plus empty slice at the end */ res = calloc(1, sizeof(struct sol_coap_resource) + (count + 1) * sizeof(struct sol_str_slice)); SOL_NULL_CHECK(res, NULL); SOL_SET_API_VERSION(res->api_version = SOL_COAP_RESOURCE_API_VERSION; ) res->path[0].data = &endpoint.data[1]; for (i = 1, current = 0; i < endpoint.len; i++) { if (endpoint.data[i] == '/') res->path[++current].data = &endpoint.data[i + 1]; else res->path[current].len++; } res->get = _sol_oic_resource_type_get; res->put = _sol_oic_resource_type_put; res->post = _sol_oic_resource_type_post; res->delete = _sol_oic_resource_type_delete; if (resource->flags & SOL_OIC_FLAG_DISCOVERABLE) res->flags |= SOL_COAP_FLAGS_WELL_KNOWN; if (oic_server.dtls_server) resource->flags |= SOL_OIC_FLAG_SECURE; res->iface = sol_str_slice_from_str(resource->iface); res->resource_type = sol_str_slice_from_str(resource->rt); return res; } static char * create_endpoint(void) { static unsigned int id = 0; char *buffer = NULL; int r; r = asprintf(&buffer, "/sol/%x", id++); return r < 0 ? NULL : buffer; } SOL_API struct sol_oic_server_resource * sol_oic_server_add_resource(const struct sol_oic_resource_type *rt, const void *handler_data, enum sol_oic_resource_flag flags) { struct sol_oic_server_resource *res; OIC_SERVER_CHECK(NULL); SOL_NULL_CHECK(rt, NULL); #ifndef SOL_NO_API_VERSION if (unlikely(rt->api_version != SOL_OIC_RESOURCE_TYPE_API_VERSION)) { SOL_WRN("Couldn't add resource_type with " "version '%u'. Expected version '%u'.", rt->api_version, SOL_OIC_RESOURCE_TYPE_API_VERSION); return NULL; } #endif res = sol_vector_append(&oic_server.resources); SOL_NULL_CHECK(res, NULL); res->callback.data = handler_data; res->callback.get.handle = rt->get.handle; res->callback.put.handle = rt->put.handle; res->callback.post.handle = rt->post.handle; res->callback.delete.handle = rt->delete.handle; res->flags = flags; res->rt = strndup(rt->resource_type.data, rt->resource_type.len); SOL_NULL_CHECK_GOTO(res->rt, remove_res); res->iface = strndup(rt->interface.data, rt->interface.len); SOL_NULL_CHECK_GOTO(res->iface, free_rt); res->href = create_endpoint(); SOL_NULL_CHECK_GOTO(res->href, free_iface); res->coap = create_coap_resource(res); SOL_NULL_CHECK_GOTO(res->coap, free_coap); if (!sol_coap_server_register_resource(oic_server.server, res->coap, res)) goto free_coap; if (oic_server.dtls_server) { if (!sol_coap_server_register_resource(oic_server.dtls_server, res->coap, res)) { SOL_WRN("Could not register resource in DTLS server"); goto unregister_resource; } } return res; unregister_resource: sol_coap_server_unregister_resource(oic_server.server, res->coap); free_coap: free(res->coap); free_iface: free(res->iface); free_rt: free(res->rt); remove_res: sol_vector_del(&oic_server.resources, oic_server.resources.len - 1); return NULL; } SOL_API void sol_oic_server_del_resource(struct sol_oic_server_resource *resource) { struct sol_oic_server_resource *iter; uint16_t idx; OIC_SERVER_CHECK(); SOL_NULL_CHECK(resource); sol_coap_server_unregister_resource(oic_server.server, resource->coap); if (oic_server.dtls_server) sol_coap_server_unregister_resource(oic_server.dtls_server, resource->coap); free(resource->coap); free(resource->href); free(resource->iface); free(resource->rt); SOL_VECTOR_FOREACH_REVERSE_IDX (&oic_server.resources, iter, idx) { if (iter == resource) { sol_vector_del(&oic_server.resources, idx); return; } } SOL_ERR("Could not find resource %p in OIC server resource list", resource); } static bool send_notification_to_server(struct sol_oic_server_resource *resource, const struct sol_vector *fields, struct sol_coap_server *server) { const uint8_t format_cbor = SOL_COAP_CONTENTTYPE_APPLICATION_CBOR; struct sol_coap_packet *pkt; pkt = sol_coap_packet_notification_new(oic_server.server, resource->coap); SOL_NULL_CHECK(pkt, false); sol_coap_add_option(pkt, SOL_COAP_OPTION_CONTENT_FORMAT, &format_cbor, sizeof(format_cbor)); if (sol_oic_encode_cbor_repr(pkt, resource->href, fields) != CborNoError) { sol_coap_header_set_code(pkt, SOL_COAP_RSPCODE_INTERNAL_ERROR); } else { sol_coap_header_set_code(pkt, SOL_COAP_RSPCODE_OK); } sol_coap_header_set_type(pkt, SOL_COAP_TYPE_ACK); return !sol_coap_packet_send_notification(oic_server.server, resource->coap, pkt); } SOL_API bool sol_oic_notify_observers(struct sol_oic_server_resource *resource, const struct sol_vector *fields) { bool sent_server = false; bool sent_dtls_server = false; SOL_NULL_CHECK(resource, false); sent_server = send_notification_to_server(resource, fields, oic_server.server); if (oic_server.dtls_server) sent_dtls_server = send_notification_to_server(resource, fields, oic_server.dtls_server); return sent_server || sent_dtls_server; }
Java
<?php use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model app\models\Category */ $this->title = 'Update Consultant Category: ' . ' ' . $model->category; $this->params['breadcrumbs'][] = ['label' => 'Categories', 'url' => ['index']]; $this->params['breadcrumbs'][] = ['label' => $model->category, 'url' => ['view', 'id' => $model->categoryid]]; $this->params['breadcrumbs'][] = 'Update'; ?> <div class="category-update"> <h1><?= Html::encode($this->title) ?></h1> <?= $this->render('_form', [ 'model' => $model, ]) ?> </div>
Java
/* ========================================================================= */ /* ------------------------------------------------------------------------- */ /*! \file cmdtextfield.h \date Dec 2011 \author TNick \brief Contains the definition for CmdTextField class *//* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Please read COPYING and README files in root folder ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* ------------------------------------------------------------------------- */ /* ========================================================================= */ #ifndef __CMDTEXTFIELD_INC__ #define __CMDTEXTFIELD_INC__ // // // // /* INCLUDES ------------------------------------------------------------ */ #include <QPlainTextEdit> #include <QLabel> #include <QStringList> /* INCLUDES ============================================================ */ // // // // /* CLASS --------------------------------------------------------------- */ namespace Gui { /** * @brief class representing a plain text control that interprets commands */ class CmdTextField :public QPlainTextEdit { Q_OBJECT // // // // /* DEFINITIONS ----------------------------------------------------- */ /* DEFINITIONS ===================================================== */ // // // // /* DATA ------------------------------------------------------------ */ private: /** * @brief associated log panel */ QPlainTextEdit * tx_Log; /** * @brief the label shown in front of text */ QLabel * lbl_; /** * @brief previously inputted text */ QStringList tx_prev_; /** * @brief index of previously inputted text */ int prev_idx_; /* DATA ============================================================ */ // // // // /* FUNCTIONS ------------------------------------------------------- */ public: /** * @brief constructor; */ CmdTextField ( QWidget * parent = 0 ); /** * @brief constructor; */ CmdTextField ( QPlainTextEdit * log_target, QWidget * parent = 0 ); /** * @brief destructor; */ virtual ~CmdTextField ( void ); /** * @brief get */ inline QPlainTextEdit * assocLog ( void ) { return tx_Log; } /** * @brief set */ inline void setAssocLog ( QPlainTextEdit * new_val ) { tx_Log = new_val; } /** * @brief change the text displayied at the left of the input box */ void setLabelText ( const QString & new_val = QString() ); protected: /** * @brief filter the keys */ void keyPressEvent ( QKeyEvent *e ); /** * @brief helps us keep the label in place */ void resizeEvent ( QResizeEvent * ); private: /** * @brief common initialisation to all constructors */ void init ( void ); /** * @brief append a new string to the list */ void appendCommand ( const QString & s_in ); /** * @brief get previously entered string at index i */ QString previousCommand ( int i = 0 ); /* FUNCTIONS ======================================================= */ // // // // }; /* class CmdTextField */ /* CLASS =============================================================== */ // // // // } // namespace Gui #endif // __CMDTEXTFIELD_INC__ /* ------------------------------------------------------------------------- */ /* ========================================================================= */
Java
/* * Copyright (c) 2011, Run With Robots * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the fastjson library nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY RUN WITH ROBOTS ''AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL MICHAEL ANDERSON BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FASTJSON_DOM_H #define FASTJSON_DOM_H #include "fastjson/core.h" #include "fastjson/utils.h" #include "fastjson/error.h" //TODO: Ugly that we need this.. can we remove it later? #include <vector> #include <sstream> #include <string.h> namespace fastjson { namespace dom { //Requires the DATA type to have a next pointer to DATA //We hijack that pointer for use in the free list. template<typename DATA> class Pager { public: Pager() : free_ptr(NULL), data(), available_count_(0) { } ~Pager() { for(unsigned int i=0; i<data.size(); ++i) { delete [] data[i]; } } uint32_t n_available() const { return available_count_; } void create_and_add_page(uint32_t n) { DATA * new_page = new DATA[n]; for(unsigned int i=0; i<n; ++i) { new_page[i].next = free_ptr; free_ptr = new_page + i; } data.push_back(new_page); available_count_+=n; } //We dont really use N - but if we ever track in-use entries too we'll need it void add_used_page( DATA * page, uint32_t /* N */ ) { data.push_back(page); } DATA * create_value() { if(available_count_==0) { //TODO: This should not be hardcoded to 10... create_and_add_page(10); } available_count_--; DATA * value = free_ptr; free_ptr = value->next; value->next = NULL; return value; } void destroy( DATA * a ) { available_count_++; a->next = free_ptr; free_ptr = a; } protected: DATA * free_ptr; std::vector< DATA* > data; uint32_t available_count_; }; //NOTE: These dont clean up the strings... you need to do that your self. // For us the chunk handles that. struct StringBuffer { public: explicit StringBuffer(unsigned int N ) { buf_ = new char[N]; size_ = N; inuse_ = 0; } struct in_use {} ; StringBuffer( char * buffer, unsigned int N, in_use ) { buf_ = buffer; size_ = N; inuse_ = N; } unsigned int available() const { return size_ - inuse_; } char * write( const char * s, unsigned int len ) { char * start = buf_ + inuse_; memcpy( start, s, len ); inuse_ += len; return start; } void destroy() { delete [] buf_; buf_=NULL;} protected: char * buf_; unsigned int size_; unsigned int inuse_; }; // The idea behind a document is that it can maintain free lists of the unused elements. // It can allocate more memory as required, // It can be merged into another document (merging the free lists correctly). class Chunk { public: Chunk() : arrays_(), dicts_(), strings_() {} ~Chunk() { for(unsigned int i=0; i<strings_.size(); ++i) { strings_[i].destroy(); } } //TODO: Shift this into an object containing the StringBuffers? char * create_raw_buffer( const char * b, unsigned int space_required ) { unsigned int i=0; for(i=0; i<strings_.size(); ++i) { if ( strings_[i].available() >= space_required ) { return strings_[i].write( b, space_required ); } } //Should use a minimum for this so that we get less fragmentation? strings_.push_back( StringBuffer( space_required ) ); return strings_.back().write( b, space_required ); } void add_array_page( ArrayEntry * entries, unsigned int N ) { arrays_.add_used_page(entries, N); } void add_dict_page( DictEntry * entries, unsigned int N ) { dicts_.add_used_page(entries, N); } void add_string_page( char * buffer, unsigned int L ) { strings_.push_back( StringBuffer(buffer,L, StringBuffer::in_use() ) ); } Pager<ArrayEntry>& arrays() { return arrays_; } Pager<DictEntry>& dicts() { return dicts_; } std::vector<StringBuffer>& strings() { return strings_; } protected: Pager<ArrayEntry> arrays_; Pager<DictEntry> dicts_; std::vector<StringBuffer> strings_; }; class Value { public: static Value as_value( Token * tok, Chunk * chunk ) { Value retval; assert(tok->type==Token::ValueToken); retval.tok_ = tok; retval.chunk_ = chunk; } static Value create_value( Token * tok, Chunk * chunk ) { //Assumes that whatever was there has been cleaned up Value retval; tok->type = Token::ValueToken; tok->dict.ptr = NULL; retval.tok_ = tok; retval.chunk_ = chunk; return retval; } template<typename T, typename W> bool set_numeric( const W & value ) { tok_->value.type_hint = ValueType::NumberHint; std::stringstream ss; ss<<value; std::string s = ss.str(); //Now allocate enough space for it. tok_->value.ptr = chunk_->create_raw_buffer( s.c_str(), s.size() ); tok_->value.size = s.size(); return true; } template<typename T, typename W> bool set_string( const W & value ) { tok_->value.type_hint = ValueType::StringHint; std::stringstream ss; ss<<value; std::string s = ss.str(); //Now allocate enough space for it. tok_->value.ptr = chunk_->create_raw_buffer( s.c_str(), s.size() ); tok_->value.size = s.size(); return true; } void set_raw_string( const std::string & s ) { tok_->value.type_hint = ValueType::StringHint; tok_->value.ptr = chunk_->create_raw_buffer( s.c_str(), s.size() ); tok_->value.size = s.size(); } void set_raw_cstring( const char * cstr ) { tok_->value.type_hint = ValueType::StringHint; size_t len = strlen(cstr); tok_->value.ptr = chunk_->create_raw_buffer( cstr, len ); tok_->value.size = len; } const Token * token() const { return tok_; } protected: Value() : tok_(NULL), chunk_(NULL) { } Token * tok_; Chunk * chunk_; }; template<typename T> struct json_helper; template<> struct json_helper<std::string> { static bool build( Token * tok, Chunk * chunk, const std::string & value ) { Value v = Value::create_value(tok,chunk); v.set_raw_string( value ); return true; } static bool from_json_value( const Token * tok, std::string * s ) { if(!tok || tok->type!=Token::ValueToken ) return false; if(tok->value.ptr) { *s = std::string( tok->value.ptr, tok->value.size); return true; } *s = ""; return true; } }; template<typename T> struct numeric_value_json_helper { static bool build( Token * tok, Chunk * chunk, T value ) { Value v = Value::create_value(tok,chunk); v.set_numeric<T>(value); return true; } static bool from_json_value( const Token * tok, T * v ) { if(!tok || tok->type!=Token::ValueToken ) return false; if( ! tok->value.ptr ) { *v = 0; } return utils::try_convert<T>( tok->value.ptr, tok->value.size, v ); } }; template<> struct json_helper<int> : public numeric_value_json_helper<int> {}; template<> struct json_helper<uint64_t> : public numeric_value_json_helper<uint64_t> {}; template<> struct json_helper<int64_t> : public numeric_value_json_helper<int64_t> {}; template<> struct json_helper<float> : public numeric_value_json_helper<float> {}; template<> struct json_helper<double> : public numeric_value_json_helper<double> {}; template<> struct json_helper<bool> { static bool build( Token * tok, Chunk * /* chunk */, bool value ) { if(value) { tok->type=Token::LiteralTrueToken; } else { tok->type=Token::LiteralFalseToken; } return true; } static bool from_json_value( const Token * token, bool * v ) { if( ! token ) return false; if( ! v ) return false; if( token->type == Token::LiteralTrueToken ) { *v = true; return true; } if( token->type == Token::LiteralFalseToken ) { *v = false; return true; } //Lets be lenient in what we accept .. a 0 is false and a 1 is true (same for "0" and "1"). if( (token->type == Token::ValueToken) && (token->value.size==1) ) { if( token->value.ptr[0] == '0' ) { *v = false; return true; } if( token->value.ptr[0] == '1' ) { *v = true; return true; } } return false; } }; class Dictionary { public: static Dictionary as_dict( Token * tok, Chunk * chunk ) { Dictionary retval; assert(tok->type==Token::DictToken); DictEntry * d = tok->dict.ptr; DictEntry * end = NULL; //Get the real end... while(d) { end = d; d = d->next; } retval.tok_ = tok; retval.chunk_ = chunk; retval.end_ = end; return retval; } static Dictionary create_dict( Token * tok, Chunk * chunk ) { //Assumes that whatever was there has been cleaned up Dictionary retval; tok->type = Token::DictToken; tok->dict.ptr = NULL; retval.tok_ = tok; retval.chunk_ = chunk; retval.end_ = NULL; return retval; } template<typename T, typename W> bool add( const std::string & key, const W & value ) { Token tok; if( ! json_helper<T>::build( &tok, chunk_, value ) ) { return false; } return add_token(key,tok); } bool add_token( const std::string & key, const Token & tok ) { DictEntry * dv = chunk_->dicts().create_value(); dv->next = NULL; Value key_v = Value::create_value( &dv->key_tok, chunk_ ); key_v.set_raw_string(key); dv->value_tok = tok; if( end_ ) { end_->next = dv; } else { tok_->dict.ptr = dv; } end_ = dv; return true; } DictEntry * add_child_raw() { DictEntry * dv = chunk_->dicts().create_value(); dv->next = NULL; if( end_ ) { end_->next = dv; } else { tok_->dict.ptr = dv; } end_ = dv; return dv; } DictEntry * add_child_raw( const std::string & key ) { DictEntry * dv = chunk_->dicts().create_value(); Value key_v = Value::create_value( &dv->key_tok, chunk_ ); key_v.set_raw_string(key); dv->next = NULL; if( end_ ) { end_->next = dv; } else { tok_->dict.ptr = dv; } end_ = dv; return dv; } template<typename T> bool get( const std::string & k, T * value ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { return json_helper<T>::from_json_value( &child->value_tok, value ); } } child = child->next; } return false; } template<typename T> T get_default( const std::string & k, const T & default_value ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { T rv; if( json_helper<T>::from_json_value( &child->value_tok, &rv ) ) { return rv; } } } child = child->next; } return default_value; } bool has_child( const std::string & k ) const { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { return true; } } child = child->next; } return false; } bool get_raw( const std::string & k, Token * token ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { *token = child->value_tok; return true; } } child = child->next; } return false; } const Token * token() const { return tok_; } protected: Dictionary() : tok_(NULL), chunk_(NULL), end_(NULL) { } Token * tok_; Chunk * chunk_; DictEntry * end_; }; class Dictionary_const { public: static Dictionary_const as_dict( const Token * tok ) { Dictionary_const retval; assert(tok->type==Token::DictToken); retval.tok_ = tok; return retval; } template<typename T> bool get( const std::string & k, T * value ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { return json_helper<T>::from_json_value( &child->value_tok, value ); } } child = child->next; } return false; } // This breaks the classes contract as someone could make changes // to the structures pointed to by the Token, but its the only way to // get a raw token out of these easily. bool get_raw( const std::string & k, Token * token ) { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { *token = child->value_tok; return true; } } child = child->next; } return false; } bool has_child( const std::string & k ) const { DictEntry * child = tok_->dict.ptr; while( child ) { //Is the childs key a string value if( child->key_tok.type == Token::ValueToken && child->key_tok.value.type_hint == ValueType::StringHint ) { if( std::string(child->key_tok.value.ptr, child->key_tok.value.size) == k ) { return true; } } child = child->next; } return false; } const Token * token() const { return tok_; } protected: Dictionary_const() : tok_(NULL) { } const Token * tok_; }; class Array { public: static Array as_array( Token * tok, Chunk * chunk ) { Array retval; assert(tok->type==Token::ArrayToken); ArrayEntry * a = tok->array.ptr; ArrayEntry * end = NULL; //Get the real end... while(a) { end = a; a = a->next; } retval.tok_ = tok; retval.chunk_ = chunk; retval.end_ = end; return retval; } static Array create_array( Token * tok, Chunk * chunk ) { //Assumes that whatever was there has been cleaned up Array retval; tok->type = Token::ArrayToken; tok->array.ptr = NULL; retval.tok_ = tok; retval.chunk_ = chunk; retval.end_ = NULL; return retval; } template<typename T, typename W> bool add( const W & value ) { //Get the spot for the token... ArrayEntry * array_entry = chunk_->arrays().create_value(); array_entry->next = NULL; if( ! json_helper<T>::build( &array_entry->tok, chunk_, value ) ) { chunk_->arrays().destroy( array_entry ); return false; } //Hook it int the array if( end_ ) { end_->next = array_entry; } else { tok_->array.ptr = array_entry; } end_ = array_entry; return true; } ArrayEntry * add_child_raw() { ArrayEntry * array_entry = chunk_->arrays().create_value(); array_entry->next = NULL; //Hook it int the array if( end_ ) { end_->next = array_entry; } else { tok_->array.ptr = array_entry; } end_ = array_entry; return array_entry; } const fastjson::Token * token() const { return tok_; } size_t length() const { fastjson::ArrayEntry * a = tok_->array.ptr; size_t retval = 0; //Get the real end... while(a) { ++retval; a = a->next; } return retval; } private: Array() : tok_(NULL), chunk_(NULL), end_(NULL) { } Token * tok_; Chunk * chunk_; ArrayEntry * end_; }; template< typename T > struct json_helper< std::vector<T> > { static bool build( Token * tok, Chunk * chunk, const std::vector<T> & v ) { Array a = Array::create_array( tok, chunk ); for( unsigned int i=0; i<v.size(); ++i) { a.add<T>( v[i] ); } return true; } static bool from_json_value( const Token * tok, std::vector<T> * data ) { if(!data) return false; if(!tok || tok->type!=Token::ArrayToken ) return false; std::vector<T> retval; ArrayEntry * child = tok->array.ptr; while(child) { retval.push_back(T()); if(! json_helper<T>::from_json_value( &child->tok, &retval.back() ) ) return false; child = child->next; } *data = retval; return true; } }; bool parse_string( const std::string & s, Token * tok, Chunk * chunk, unsigned int parse_mode, UserErrorCallback user_error_callback, void * user_data ); void clone_token( const Token * in_token, Token * out_token, Chunk * chunk ); } } namespace fastjson { namespace util { void set_string( Token * tok, dom::Chunk * chunk, const char * s ); } } #endif
Java
/* * Copyright (c) 2007, Mathieu Champlon * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met : * * . Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * . Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * . Neither the name of the copyright holders nor the names of the * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE THE COPYRIGHT * OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "xeumeuleu_test_pch.h" #include <xeumeuleu/xml.hpp> // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_from_first_stream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_from_first_stream ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xis( xis1, xis2 ); BOOST_CHECK_NO_THROW( xis >> xml::start( "root-1" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_from_second_stream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_from_second_stream ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xis( xis1, xis2 ); BOOST_CHECK_NO_THROW( xis >> xml::start( "root-2" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_a_non_existing_node_throws // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_a_non_existing_node_throws ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xis( xis1, xis2 ); BOOST_CHECK_THROW( xis >> xml::start( "non-existing-node" ), xml::exception ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_attribute_from_first_stream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_attribute_from_first_stream ) { xml::xistringstream xis1( "<root attribute='stream-1'/>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ); BOOST_CHECK_EQUAL( "stream-1", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_attribute_from_second_stream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_attribute_from_second_stream ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ); BOOST_CHECK_EQUAL( "stream-2", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_reads_attribute_with_first_stream_precedence // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_reads_attribute_with_first_stream_precedence ) { xml::xistringstream xis1( "<root attribute='stream-1'/>" ); xml::xistringstream xis2( "<root attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ); BOOST_CHECK_EQUAL( "stream-1", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_a_non_existing_attribute_throws // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_a_non_existing_attribute_throws ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ); BOOST_CHECK_THROW( xis.attribute< std::string >( "attribute" ), xml::exception ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_a_non_existing_attribute_from_existing_branch_throws // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_a_non_existing_attribute_from_existing_branch_throws ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root-1" ); BOOST_CHECK_THROW( xis.attribute< std::string >( "attribute" ), xml::exception ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_from_first_branch_then_second_branch_is_transparent // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_from_first_branch_then_second_branch_is_transparent ) { xml::xistringstream xis1( "<root-1 attribute-1='stream-1'/>" ); xml::xistringstream xis2( "<root-2 attribute-2='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); std::string actual1, actual2; xis >> xml::start( "root-1" ) >> xml::attribute( "attribute-1", actual1 ) >> xml::end >> xml::start( "root-2" ) >> xml::attribute( "attribute-2", actual2 ); BOOST_CHECK_EQUAL( "stream-1", actual1 ); BOOST_CHECK_EQUAL( "stream-2", actual2 ); } // ----------------------------------------------------------------------------- // Name: reading_from_an_ximultistream_from_second_branch_does_not_change_stream_precedence // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( reading_from_an_ximultistream_from_second_branch_does_not_change_stream_precedence ) { xml::xistringstream xis1( "<root attribute='stream-1'/>" ); xml::xistringstream xis2( "<root attribute='stream-2'><element/></root>" ); xml::ximultistream xis( xis1, xis2 ); xis >> xml::start( "root" ) >> xml::start( "element" ) >> xml::end; BOOST_CHECK_EQUAL( "stream-1", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: an_ximultistream_can_be_wrapped_by_an_xisubstream // Created: MAT 2008-01-07 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_ximultistream_can_be_wrapped_by_an_xisubstream ) { xml::xistringstream xis1( "<root-1 attribute='stream-1'/>" ); xml::xistringstream xis2( "<root-2 attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); { xml::xisubstream xiss( xis ); xiss >> xml::start( "root-2" ); } xis >> xml::start( "root-1" ); BOOST_CHECK_EQUAL( "stream-1", xis.attribute< std::string >( "attribute" ) ); } // ----------------------------------------------------------------------------- // Name: an_ximultistream_can_be_wrapped_by_another_ximultistream // Created: MAT 2008-04-25 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_ximultistream_can_be_wrapped_by_another_ximultistream ) { xml::xistringstream xis1( "<root-1 attribute='stream-1'/>" ); xml::xistringstream xis2( "<root-2 attribute='stream-2'/>" ); xml::xistringstream xis3( "<root-3 attribute='stream-3'/>" ); xml::ximultistream xims( xis1, xis2 ); xml::ximultistream xis( xims, xis3 ); std::string actual1, actual2, actual3; xis >> xml::start( "root-1" ) >> xml::attribute( "attribute", actual1 ) >> xml::end >> xml::start( "root-2" ) >> xml::attribute( "attribute", actual2 ) >> xml::end >> xml::start( "root-3" ) >> xml::attribute( "attribute", actual3 ); BOOST_CHECK_EQUAL( "stream-1", actual1 ); BOOST_CHECK_EQUAL( "stream-2", actual2 ); BOOST_CHECK_EQUAL( "stream-3", actual3 ); } // ----------------------------------------------------------------------------- // Name: serializing_an_ximultistream_into_an_xostream_at_root_level_throws // Created: MAT 2008-11-22 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( serializing_an_ximultistream_into_an_xostream_at_root_level_merges_attributes ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xims( xis1, xis2 ); xml::xostringstream xos; BOOST_CHECK_THROW( xos << xims, xml::exception ); } // ----------------------------------------------------------------------------- // Name: serializing_an_ximultistream_into_an_xostream_adds_both_stream_contents // Created: MAT 2008-11-22 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( serializing_an_ximultistream_into_an_xostream_adds_both_stream_contents ) { xml::xistringstream xis1( "<root-1/>" ); xml::xistringstream xis2( "<root-2/>" ); xml::ximultistream xims( xis1, xis2 ); xml::xostringstream xos; xos << xml::start( "root" ) << xims << xml::end; xml::xistringstream xis( xos.str() ); xis >> xml::start( "root" ) >> xml::start( "root-1" ) >> xml::end >> xml::start( "root-2" ); } // ----------------------------------------------------------------------------- // Name: an_ximultistream_can_be_buffered_by_an_xibufferstream // Created: MAT 2008-05-17 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_ximultistream_can_be_buffered_by_an_xibufferstream ) { xml::xistringstream xis1( "<root-1 attribute='stream-1'/>" ); xml::xistringstream xis2( "<root-2 attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); xml::xibufferstream xibs( xis ); std::string actual1, actual2; xibs >> xml::start( "root-1" ) >> xml::attribute( "attribute", actual1 ) >> xml::end >> xml::start( "root-2" ) >> xml::attribute( "attribute", actual2 ); BOOST_CHECK_EQUAL( "stream-1", actual1 ); BOOST_CHECK_EQUAL( "stream-2", actual2 ); } // ----------------------------------------------------------------------------- // Name: an_optional_attribute_not_found_in_first_stream_falls_back_to_the_second_stream // Created: MAT 2008-05-17 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_optional_attribute_not_found_in_first_stream_falls_back_to_the_second_stream ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root attribute='stream-2'/>" ); xml::ximultistream xis( xis1, xis2 ); xml::xibufferstream xibs( xis ); std::string actual = "stream-1"; xibs >> xml::start( "root" ) >> xml::optional >>xml::attribute( "attribute", actual ); BOOST_CHECK_EQUAL( "stream-2", actual ); } // ----------------------------------------------------------------------------- // Name: an_optional_attribute_not_found_in_either_stream_is_valid // Created: MAT 2008-05-17 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_optional_attribute_not_found_in_either_stream_is_valid ) { xml::xistringstream xis1( "<root/>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xis( xis1, xis2 ); xml::xibufferstream xibs( xis ); std::string actual = "no attribute"; xibs >> xml::start( "root" ) >> xml::optional >>xml::attribute( "attribute", actual ); BOOST_CHECK_EQUAL( "no attribute", actual ); } // ----------------------------------------------------------------------------- // Name: an_optional_attribute_not_found_in_an_optional_sub_node_of_either_stream_is_valid // Created: MCO 2009-05-31 // ----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE( an_optional_attribute_not_found_in_an_optional_sub_node_of_either_stream_is_valid ) { xml::xistringstream xis1( "<root>" " <sub-node/>" "</root>" ); xml::xistringstream xis2( "<root/>" ); xml::ximultistream xis( xis1, xis2 ); std::string attribute; xis >> xml::start( "root" ) >> xml::optional >> xml::start( "sub-node" ) >> xml::optional >> xml::attribute( "non-existing-attribute", attribute ); }
Java
package com.xoba.smr; import java.io.PrintWriter; import java.io.StringReader; import java.io.StringWriter; import java.net.URI; import java.util.Collection; import java.util.Formatter; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Properties; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; import org.apache.commons.codec.binary.Base64; import com.amazonaws.Request; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.handlers.AbstractRequestHandler; import com.amazonaws.services.ec2.AmazonEC2; import com.amazonaws.services.ec2.AmazonEC2Client; import com.amazonaws.services.ec2.model.CreateTagsRequest; import com.amazonaws.services.ec2.model.Instance; import com.amazonaws.services.ec2.model.LaunchSpecification; import com.amazonaws.services.ec2.model.RequestSpotInstancesRequest; import com.amazonaws.services.ec2.model.RequestSpotInstancesResult; import com.amazonaws.services.ec2.model.RunInstancesRequest; import com.amazonaws.services.ec2.model.RunInstancesResult; import com.amazonaws.services.ec2.model.Tag; import com.amazonaws.services.s3.AmazonS3; import com.amazonaws.services.s3.AmazonS3Client; import com.amazonaws.services.simpledb.AmazonSimpleDB; import com.amazonaws.services.simpledb.AmazonSimpleDBClient; import com.amazonaws.services.sqs.AmazonSQS; import com.amazonaws.services.sqs.AmazonSQSClient; import com.amazonaws.services.sqs.model.SendMessageRequest; import com.xoba.util.ILogger; import com.xoba.util.LogFactory; import com.xoba.util.MraUtils; public class SimpleMapReduce { private static final ILogger logger = LogFactory.getDefault().create(); public static void launch(Properties config, Collection<String> inputSplitPrefixes, AmazonInstance ai, int machineCount) throws Exception { launch(config, inputSplitPrefixes, ai, machineCount, true); } public static void launch(Properties config, Collection<String> inputSplitPrefixes, AmazonInstance ai, int machineCount, boolean spotInstances) throws Exception { if (!config.containsKey(ConfigKey.JOB_ID.toString())) { config.put(ConfigKey.JOB_ID.toString(), MraUtils.md5Hash(new TreeMap<Object, Object>(config).toString()) .substring(0, 8)); } String id = config.getProperty(ConfigKey.JOB_ID.toString()); AWSCredentials aws = create(config); AmazonSimpleDB db = new AmazonSimpleDBClient(aws); AmazonSQS sqs = new AmazonSQSClient(aws); AmazonS3 s3 = new AmazonS3Client(aws); final String mapQueue = config.getProperty(ConfigKey.MAP_QUEUE.toString()); final String reduceQueue = config.getProperty(ConfigKey.REDUCE_QUEUE.toString()); final String dom = config.getProperty(ConfigKey.SIMPLEDB_DOM.toString()); final String mapInputBucket = config.getProperty(ConfigKey.MAP_INPUTS_BUCKET.toString()); final String shuffleBucket = config.getProperty(ConfigKey.SHUFFLE_BUCKET.toString()); final String reduceOutputBucket = config.getProperty(ConfigKey.REDUCE_OUTPUTS_BUCKET.toString()); final int hashCard = new Integer(config.getProperty(ConfigKey.HASH_CARDINALITY.toString())); s3.createBucket(reduceOutputBucket); final long inputSplitCount = inputSplitPrefixes.size(); for (String key : inputSplitPrefixes) { Properties p = new Properties(); p.setProperty("input", "s3://" + mapInputBucket + "/" + key); sqs.sendMessage(new SendMessageRequest(mapQueue, serialize(p))); } SimpleDbCommitter.commitNewAttribute(db, dom, "parameters", "splits", "" + inputSplitCount); SimpleDbCommitter.commitNewAttribute(db, dom, "parameters", "hashes", "" + hashCard); SimpleDbCommitter.commitNewAttribute(db, dom, "parameters", "done", "1"); for (String hash : getAllHashes(hashCard)) { Properties p = new Properties(); p.setProperty("input", "s3://" + shuffleBucket + "/" + hash); sqs.sendMessage(new SendMessageRequest(reduceQueue, serialize(p))); } if (machineCount == 1) { // run locally SMRDriver.main(new String[] { MraUtils.convertToHex(serialize(config).getBytes()) }); } else if (machineCount > 1) { // run in the cloud String userData = produceUserData(ai, config, new URI(config.getProperty(ConfigKey.RUNNABLE_JARFILE_URI.toString()))); logger.debugf("launching job with id %s:", id); System.out.println(userData); AmazonEC2 ec2 = new AmazonEC2Client(aws); if (spotInstances) { RequestSpotInstancesRequest sir = new RequestSpotInstancesRequest(); sir.setSpotPrice(new Double(ai.getPrice()).toString()); sir.setInstanceCount(machineCount); sir.setType("one-time"); LaunchSpecification spec = new LaunchSpecification(); spec.setImageId(ai.getDefaultAMI()); spec.setUserData(new String(new Base64().encode(userData.getBytes("US-ASCII")))); spec.setInstanceType(ai.getApiName()); sir.setLaunchSpecification(spec); RequestSpotInstancesResult result = ec2.requestSpotInstances(sir); logger.debugf("spot instance request result: %s", result); } else { RunInstancesRequest req = new RunInstancesRequest(ai.getDefaultAMI(), machineCount, machineCount); req.setClientToken(id); req.setInstanceType(ai.getApiName()); req.setInstanceInitiatedShutdownBehavior("terminate"); req.setUserData(new String(new Base64().encode(userData.getBytes("US-ASCII")))); RunInstancesResult resp = ec2.runInstances(req); logger.debugf("on demand reservation id: %s", resp.getReservation().getReservationId()); labelEc2Instance(ec2, resp, "smr-" + id); } } } public static void labelEc2Instance(AmazonEC2 ec2, RunInstancesResult resp, String title) throws Exception { int tries = 0; boolean done = false; while (tries++ < 3 && !done) { try { List<String> resources = new LinkedList<String>(); for (Instance i : resp.getReservation().getInstances()) { resources.add(i.getInstanceId()); } List<Tag> tags = new LinkedList<Tag>(); tags.add(new Tag("Name", title)); CreateTagsRequest ctr = new CreateTagsRequest(resources, tags); ec2.createTags(ctr); done = true; logger.debugf("set tag(s)"); } catch (Exception e) { logger.warnf("exception setting tags: %s", e); Thread.sleep(3000); } } } public static String produceUserData(AmazonInstance ai, Properties c, URI jarFileURI) throws Exception { StringWriter sw = new StringWriter(); LinuxLineConventionPrintWriter pw = new LinuxLineConventionPrintWriter(new PrintWriter(sw)); pw.println("#!/bin/sh"); pw.println("cd /root"); pw.println("chmod 777 /mnt"); pw.println("aptitude update"); Set<String> set = new TreeSet<String>(); set.add("openjdk-6-jdk"); set.add("wget"); if (set.size() > 0) { pw.print("aptitude install -y "); Iterator<String> it = set.iterator(); while (it.hasNext()) { String x = it.next(); pw.print(x); if (it.hasNext()) { pw.print(" "); } } pw.println(); } pw.printf("wget %s", jarFileURI); pw.println(); String[] parts = jarFileURI.getPath().split("/"); String jar = parts[parts.length - 1]; pw.printf("java -Xmx%.0fm -cp %s %s %s", 1000 * 0.8 * ai.getMemoryGB(), jar, SMRDriver.class.getName(), MraUtils.convertToHex(serialize(c).getBytes())); pw.println(); pw.println("poweroff"); pw.close(); return sw.toString(); } public static AmazonS3 getS3(AWSCredentials aws) { AmazonS3Client s3 = new AmazonS3Client(aws); s3.addRequestHandler(new AbstractRequestHandler() { @Override public void beforeRequest(Request<?> request) { request.addHeader("x-amz-request-payer", "requester"); } }); return s3; } public static String prefixedName(String p, String n) { return p + "-" + n; } public static AWSCredentials create(final Properties p) { return new AWSCredentials() { @Override public String getAWSSecretKey() { return p.getProperty(ConfigKey.AWS_SECRETKEY.toString()); } @Override public String getAWSAccessKeyId() { return p.getProperty(ConfigKey.AWS_KEYID.toString()); } }; } public static SortedSet<String> getAllHashes(long mod) { SortedSet<String> out = new TreeSet<String>(); for (long i = 0; i < mod; i++) { out.add(fmt(i, mod)); } return out; } public static String hash(byte[] key, long mod) { byte[] buf = MraUtils.md5HashBytesToBytes(key); long x = Math.abs(MraUtils.extractLongValue(buf)); return fmt(x % mod, mod); } private static String fmt(long x, long mod) { long places = Math.round(Math.ceil(Math.log10(mod))); if (places == 0) { places = 1; } return new Formatter().format("%0" + places + "d", x).toString(); } public static String serialize(Properties p) throws Exception { StringWriter sw = new StringWriter(); try { p.store(sw, "n/a"); } finally { sw.close(); } return sw.toString(); } public static Properties marshall(String s) throws Exception { Properties p = new Properties(); StringReader sr = new StringReader(s); try { p.load(sr); } finally { sr.close(); } return p; } }
Java
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004-2021 musikcube team // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // * Neither the name of the author nor the names of other contributors may // be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////////// #pragma once extern "C" { #pragma warning(push, 0) #include <microhttpd.h> #pragma warning(pop) } #include "Context.h" #include <condition_variable> #include <mutex> #include <vector> #if MHD_VERSION < 0x00097001 #define MHD_Result int #endif class HttpServer { public: HttpServer(Context& context); ~HttpServer(); bool Start(); bool Stop(); void Wait(); private: static MHD_Result HandleRequest( void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls); static size_t HandleUnescape( void * cls, struct MHD_Connection *c, char *s); static int HandleAudioTrackRequest( HttpServer* server, MHD_Response*& response, MHD_Connection* connection, std::vector<std::string>& pathParts); static int HandleThumbnailRequest( HttpServer* server, MHD_Response*& response, MHD_Connection* connection, std::vector<std::string>& pathParts); struct MHD_Daemon *httpServer; Context& context; volatile bool running; std::condition_variable exitCondition; std::mutex exitMutex; };
Java
<?php namespace app\controllers\user; use Yii; use dektrium\user\controllers\ProfileController as PController; use app\models\ProfileSearch; /** * UserInfoController implements the CRUD actions for UserInfo model. */ class ProfileController extends PController { /*public function behaviors() { return [ 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'delete' => ['post'], ], ], ]; }*/ /** * Lists all UserInfo models. * @return mixed */ public function actionIndex() { $searchModel = new ProfileSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); } /** * Displays a single UserInfo model. * @param integer $id * @return mixed */ /*public function actionView($id) { return $this->render('view', [ 'model' => $this->findModel($id), ]); }*/ /** * Creates a new UserInfo model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ /*public function actionCreate() { $model = new UserInfo(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', [ 'model' => $model, ]); } }*/ /** * Updates an existing UserInfo model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ /*public function actionUpdate($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('update', [ 'model' => $model, ]); } }*/ /** * Deletes an existing UserInfo model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ /*public function actionDelete($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); }*/ /** * Finds the UserInfo model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return UserInfo the loaded model * @throws NotFoundHttpException if the model cannot be found */ /*protected function findModel($id) { if (($model = UserInfo::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }*/ }
Java
#!/bin/bash NAME=realtimefec PROJ=fecreader # This doesn't use the feed, it tests the file downloads # This is everything to handle the files before the body rows are entered # After the body rows are entered, the exotic ones must be superceded source /projects/$NAME/virt/bin/activate # /projects/$NAME/src/$NAME/$PROJ/manage.py scrape_rss_filings /projects/$NAME/src/$NAME/$PROJ/manage.py find_new_filings /projects/$NAME/src/$NAME/$PROJ/manage.py download_new_filings /projects/$NAME/src/$NAME/$PROJ/manage.py enter_headers_from_new_filings /projects/$NAME/src/$NAME/$PROJ/manage.py set_new_filing_details /projects/$NAME/src/$NAME/$PROJ/manage.py mark_amended /projects/$NAME/src/$NAME/$PROJ/manage.py send_body_row_jobs /projects/$NAME/src/$NAME/$PROJ/manage.py remove_blacklisted
Java
#ifndef REGRESS_H #define REGRESS_H /* Macro to shorten code where a number is added to the current value of an * element in a matrix. */ #define addval(A, VAL, I, J) setval((A), (VAL) + val((A), (I), (J)), (I), (J)) typedef struct { double **array; int rows; int cols; } matrix; void DestroyMatrix(matrix*); matrix* CalcMinor(matrix*, int, int); double CalcDeterminant(matrix*); int nCols(matrix*); int nRows(matrix*); double val(matrix*, int, int); void setval(matrix*, double, int, int); matrix* CreateMatrix(int, int); matrix* mtxtrn(matrix*); matrix* mtxmul(matrix*, matrix*); matrix* CalcAdj(matrix*); matrix* CalcInv(matrix*); matrix* regress(matrix*, matrix*); matrix* polyfit(matrix*, matrix*, int); matrix* ParseMatrix(char*); matrix* linspace(double, double, int); void Map(matrix*, double (*func)(double)); void mtxprnt(matrix*); void mtxprntfile(matrix*, char*); #endif
Java
div#childtickets { border: 1px outset #996; border-radius: .5em; padding: 1em; } div#childtickets table.listing thead th { border: none; } div#childtickets table.listing tbody tr { border: none; } div#childtickets table.listing tbody td { border: none; padding: 0.1em 0.5em; }
Java
----------------------------------------------------------------------------- -- | -- Module : Distribution.Client.Configure -- Copyright : (c) David Himmelstrup 2005, -- Duncan Coutts 2005 -- License : BSD-like -- -- Maintainer : cabal-devel@haskell.org -- Portability : portable -- -- High level interface to configuring a package. ----------------------------------------------------------------------------- module Distribution.Client.Configure ( configure, ) where import Distribution.Client.Dependency import qualified Distribution.Client.InstallPlan as InstallPlan import Distribution.Client.InstallPlan (InstallPlan) import Distribution.Client.IndexUtils as IndexUtils ( getSourcePackages, getInstalledPackages ) import Distribution.Client.Setup ( ConfigExFlags(..), configureCommand, filterConfigureFlags ) import Distribution.Client.Types as Source import Distribution.Client.SetupWrapper ( setupWrapper, SetupScriptOptions(..), defaultSetupScriptOptions ) import Distribution.Client.Targets ( userToPackageConstraint ) import Distribution.Simple.Compiler ( CompilerId(..), Compiler(compilerId) , PackageDB(..), PackageDBStack ) import Distribution.Simple.Program (ProgramConfiguration ) import Distribution.Simple.Setup ( ConfigFlags(..), fromFlag, toFlag, flagToMaybe, fromFlagOrDefault ) import Distribution.Simple.PackageIndex (PackageIndex) import Distribution.Simple.Utils ( defaultPackageDesc ) import Distribution.Package ( Package(..), packageName, Dependency(..), thisPackageVersion ) import Distribution.PackageDescription.Parse ( readPackageDescription ) import Distribution.PackageDescription.Configuration ( finalizePackageDescription ) import Distribution.Version ( anyVersion, thisVersion ) import Distribution.Simple.Utils as Utils ( notice, info, debug, die ) import Distribution.System ( Platform, buildPlatform ) import Distribution.Verbosity as Verbosity ( Verbosity ) import Data.Monoid (Monoid(..)) -- | Configure the package found in the local directory configure :: Verbosity -> PackageDBStack -> [Repo] -> Compiler -> ProgramConfiguration -> ConfigFlags -> ConfigExFlags -> [String] -> IO () configure verbosity packageDBs repos comp conf configFlags configExFlags extraArgs = do installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf sourcePkgDb <- getSourcePackages verbosity repos progress <- planLocalPackage verbosity comp configFlags configExFlags installedPkgIndex sourcePkgDb notice verbosity "Resolving dependencies..." maybePlan <- foldProgress logMsg (return . Left) (return . Right) progress case maybePlan of Left message -> do info verbosity message setupWrapper verbosity (setupScriptOptions installedPkgIndex) Nothing configureCommand (const configFlags) extraArgs Right installPlan -> case InstallPlan.ready installPlan of [pkg@(ConfiguredPackage (SourcePackage _ _ (LocalUnpackedPackage _)) _ _ _)] -> configurePackage verbosity (InstallPlan.planPlatform installPlan) (InstallPlan.planCompiler installPlan) (setupScriptOptions installedPkgIndex) configFlags pkg extraArgs _ -> die $ "internal error: configure install plan should have exactly " ++ "one local ready package." where setupScriptOptions index = SetupScriptOptions { useCabalVersion = maybe anyVersion thisVersion (flagToMaybe (configCabalVersion configExFlags)), useCompiler = Just comp, -- Hack: we typically want to allow the UserPackageDB for finding the -- Cabal lib when compiling any Setup.hs even if we're doing a global -- install. However we also allow looking in a specific package db. usePackageDB = if UserPackageDB `elem` packageDBs then packageDBs else packageDBs ++ [UserPackageDB], usePackageIndex = if UserPackageDB `elem` packageDBs then Just index else Nothing, useProgramConfig = conf, useDistPref = fromFlagOrDefault (useDistPref defaultSetupScriptOptions) (configDistPref configFlags), useLoggingHandle = Nothing, useWorkingDir = Nothing } logMsg message rest = debug verbosity message >> rest -- | Make an 'InstallPlan' for the unpacked package in the current directory, -- and all its dependencies. -- planLocalPackage :: Verbosity -> Compiler -> ConfigFlags -> ConfigExFlags -> PackageIndex -> SourcePackageDb -> IO (Progress String String InstallPlan) planLocalPackage verbosity comp configFlags configExFlags installedPkgIndex (SourcePackageDb _ packagePrefs) = do pkg <- readPackageDescription verbosity =<< defaultPackageDesc verbosity let -- We create a local package and ask to resolve a dependency on it localPkg = SourcePackage { packageInfoId = packageId pkg, Source.packageDescription = pkg, packageSource = LocalUnpackedPackage "." } solver = fromFlag $ configSolver configExFlags testsEnabled = fromFlagOrDefault False $ configTests configFlags benchmarksEnabled = fromFlagOrDefault False $ configBenchmarks configFlags resolverParams = addPreferences -- preferences from the config file or command line [ PackageVersionPreference name ver | Dependency name ver <- configPreferences configExFlags ] . addConstraints -- version constraints from the config file or command line -- TODO: should warn or error on constraints that are not on direct deps -- or flag constraints not on the package in question. (map userToPackageConstraint (configExConstraints configExFlags)) . addConstraints -- package flags from the config file or command line [ PackageConstraintFlags (packageName pkg) (configConfigurationsFlags configFlags) ] . addConstraints -- '--enable-tests' and '--enable-benchmarks' constraints from -- command line [ PackageConstraintStanzas (packageName pkg) $ concat [ if testsEnabled then [TestStanzas] else [] , if benchmarksEnabled then [BenchStanzas] else [] ] ] $ standardInstallPolicy installedPkgIndex (SourcePackageDb mempty packagePrefs) [SpecificSourcePackage localPkg] return (resolveDependencies buildPlatform (compilerId comp) solver resolverParams) -- | Call an installer for an 'SourcePackage' but override the configure -- flags with the ones given by the 'ConfiguredPackage'. In particular the -- 'ConfiguredPackage' specifies an exact 'FlagAssignment' and exactly -- versioned package dependencies. So we ignore any previous partial flag -- assignment or dependency constraints and use the new ones. -- configurePackage :: Verbosity -> Platform -> CompilerId -> SetupScriptOptions -> ConfigFlags -> ConfiguredPackage -> [String] -> IO () configurePackage verbosity platform comp scriptOptions configFlags (ConfiguredPackage (SourcePackage _ gpkg _) flags stanzas deps) extraArgs = setupWrapper verbosity scriptOptions (Just pkg) configureCommand configureFlags extraArgs where configureFlags = filterConfigureFlags configFlags { configConfigurationsFlags = flags, configConstraints = map thisPackageVersion deps, configVerbosity = toFlag verbosity, configBenchmarks = toFlag (BenchStanzas `elem` stanzas), configTests = toFlag (TestStanzas `elem` stanzas) } pkg = case finalizePackageDescription flags (const True) platform comp [] (enableStanzas stanzas gpkg) of Left _ -> error "finalizePackageDescription ConfiguredPackage failed" Right (desc, _) -> desc
Java
/* * [The BSD 3-Clause License] * Copyright (c) 2015, Samuel Suffos * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be * used to endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT * SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Matlab.Nodes { [Serializable] public abstract class InnerNode : InternalNode { #region CONSTRUCTORS: protected InnerNode() : base() { return; } #endregion } }
Java
#!/usr/bin/python import os # With the addition of Keystone, to use an openstack cloud you should # authenticate against keystone, which returns a **Token** and **Service # Catalog**. The catalog contains the endpoint for all services the # user/tenant has access to - including nova, glance, keystone, swift. # # *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We # will use the 1.1 *compute api* os.environ['OS_AUTH_URL'] = "https://keystone.rc.nectar.org.au:5000/v2.0/" # With the addition of Keystone we have standardized on the term **tenant** # as the entity that owns the resources. os.environ['OS_TENANT_ID'] = "123456789012345678901234567890" os.environ['OS_TENANT_NAME'] = "tenant_name" # In addition to the owning entity (tenant), openstack stores the entity # performing the action as the **user**. os.environ['OS_USERNAME'] = "joe.bloggs@uni.edu.au" # With Keystone you pass the keystone password. os.environ['OS_PASSWORD'] = "????????????????????"
Java
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; /** * @var yii\web\View $this * @var app\models\Image $model * @var yii\widgets\ActiveForm $form */ ?> <div class="image-form"> <?php $form = ActiveForm::begin(); ?> <?= $form->field($model, 'name')->textInput(['maxlength' => 50]) ?> <?= $form->field($model, 'location_shooting')->textInput(['maxlength' => 200]) ?> <?= $form->field($model, 'file')->textarea(['rows' => 6]) ?> <?= $form->field($model, 'upload_date')->textInput() ?> <div class="form-group"> <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> </div> <?php ActiveForm::end(); ?> </div>
Java
miniature-ninja-agile-awesomeness ================================= Simply the best agile programme for time reporting ever built. This is a project made by students at Linköpings University. Contributions ================================= How to contribute This project uses git, and is currently hosted on Github at https://github.com/Magrit/miniature-ninja-agile-awesomeness Although a goal would be to have a perfect git history, multiple of the projects participants are not familiar with the complications of git. Something that can/will result in horrible git commits and amends. How to ================================= If you do not have git setup properly, please follow the following guides https://help.github.com/articles/set-up-git https://help.github.com/articles/generating-ssh-keys To fetch the repository to start developing ``` git clone git@github.com:Magrit/miniature-ninja-agile-awesomeness.git ``` In order to start your own branch for development. ``` git checkout -b <feature to work on> ``` Or fork through Githubs interface. Code Reviews ================================= Either ask to become a contributer, or send of a Pull Request. This is best done through the Github interface via your own branch/fork. Code reviews should be applied as Pull Requests through Github. This means that all features should be it's own branch which then will be merged into Master. Master should at all time be runnable, which means that all code reviews should be run before being merged into master. How to for branches ================================= The general workflow for code reviewing is the following. ``` git pull origin master git checkout <branch to work on> ``` <--All work is done--> ``` git commit -m "<Commit message>" git merge master ``` After all that is done, apply for the Pull Request through Githubs interface, tag relevant people you want to review. When the request has been granted, either you or the reviewer should be able to automatically merge the request through Githubs interface, if not, follow the following workflow. ``` git pull --all git checkout master git merge <branch to to merge> ``` <-- Fix the merge conflict --> ``` git commit -m "fixed merge conflict" git push origin master ``` License ================================= miniature-ninja-agile-awesomeness is licensed under the [BSD License](http://www.github.com/Magrit/miniature-ninja-agile-awesomeness/blob/master/LICENSE) Special considerations ================================= Even if something breakes, take a deep breath and contact one of the maintainers, or try to Google for the error and try to fix it on your own if it's manageable.
Java
<?php /* Copyright (c) 2012, Silvercore Dev. (www.silvercoredev.com) Todos os direitos reservados. Ver o arquivo licenca.txt na raiz do BlackbirdIS para mais detalhes. */ session_start(); if (!isset($_SESSION["bis"]) || $_SESSION["bis"] != 1) { header("Location: index.php"); die(); } ?>
Java
require "rbconfig" require 'test/unit' require 'socket' require 'openssl' require 'puma/minissl' require 'puma/server' require 'net/https' class TestPumaServer < Test::Unit::TestCase def setup @port = 3212 @host = "127.0.0.1" @app = lambda { |env| [200, {}, [env['rack.url_scheme']]] } @events = Puma::Events.new STDOUT, STDERR @server = Puma::Server.new @app, @events if defined?(JRUBY_VERSION) @ssl_key = File.expand_path "../../examples/puma/keystore.jks", __FILE__ @ssl_cert = @ssl_key else @ssl_key = File.expand_path "../../examples/puma/puma_keypair.pem", __FILE__ @ssl_cert = File.expand_path "../../examples/puma/cert_puma.pem", __FILE__ end end def teardown @server.stop(true) end def test_url_scheme_for_https ctx = Puma::MiniSSL::Context.new ctx.key = @ssl_key ctx.cert = @ssl_cert ctx.verify_mode = Puma::MiniSSL::VERIFY_NONE @server.add_ssl_listener @host, @port, ctx @server.run http = Net::HTTP.new @host, @port http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE body = nil http.start do req = Net::HTTP::Get.new "/", {} http.request(req) do |rep| body = rep.body end end assert_equal "https", body end unless defined? JRUBY_VERSION def test_proper_stringio_body data = nil @server.app = proc do |env| data = env['rack.input'].read [200, {}, ["ok"]] end @server.add_tcp_listener @host, @port @server.run fifteen = "1" * 15 sock = TCPSocket.new @host, @port sock << "PUT / HTTP/1.0\r\nContent-Length: 30\r\n\r\n#{fifteen}" sleep 0.1 # important so that the previous data is sent as a packet sock << fifteen sock.read assert_equal "#{fifteen}#{fifteen}", data end def test_puma_socket body = "HTTP/1.1 750 Upgraded to Awesome\r\nDone: Yep!\r\n" @server.app = proc do |env| io = env['puma.socket'] io.write body io.close [-1, {}, []] end @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "PUT / HTTP/1.0\r\n\r\nHello" assert_equal body, sock.read end def test_very_large_return giant = "x" * 2056610 @server.app = proc do |env| [200, {}, [giant]] end @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.0\r\n\r\n" while true line = sock.gets break if line == "\r\n" end out = sock.read assert_equal giant.bytesize, out.bytesize end def test_respect_x_forwarded_proto @server.app = proc do |env| [200, {}, [env['SERVER_PORT']]] end @server.add_tcp_listener @host, @port @server.run req = Net::HTTP::Get.new("/") req['HOST'] = "example.com" req['X_FORWARDED_PROTO'] = "https" res = Net::HTTP.start @host, @port do |http| http.request(req) end assert_equal "443", res.body end def test_default_server_port @server.app = proc do |env| [200, {}, [env['SERVER_PORT']]] end @server.add_tcp_listener @host, @port @server.run req = Net::HTTP::Get.new("/") req['HOST'] = "example.com" res = Net::HTTP.start @host, @port do |http| http.request(req) end assert_equal "80", res.body end def test_HEAD_has_no_body @server.app = proc { |env| [200, {"Foo" => "Bar"}, ["hello"]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 200 OK\r\nFoo: Bar\r\nContent-Length: 5\r\n\r\n", data end def test_GET_with_empty_body_has_sane_chunking @server.app = proc { |env| [200, {}, [""]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 200 OK\r\nContent-Length: 0\r\n\r\n", data end def test_GET_with_no_body_has_sane_chunking @server.app = proc { |env| [200, {}, []] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 200 OK\r\n\r\n", data end def test_doesnt_print_backtrace_in_production @events = Puma::Events.strings @server = Puma::Server.new @app, @events @server.app = proc { |e| raise "don't leak me bro" } @server.leak_stack_on_error = false @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.0\r\n\r\n" data = sock.read assert_not_match(/don't leak me bro/, data) assert_match(/HTTP\/1.0 500 Internal Server Error/, data) end def test_prints_custom_error @events = Puma::Events.strings re = lambda { |err| [302, {'Content-Type' => 'text', 'Location' => 'foo.html'}, ['302 found']] } @server = Puma::Server.new @app, @events, {lowlevel_error_handler: re} @server.app = proc { |e| raise "don't leak me bro" } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.0\r\n\r\n" data = sock.read assert_match(/HTTP\/1.0 302 Found/, data) end def test_custom_http_codes_10 @server.app = proc { |env| [449, {}, [""]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 449 CUSTOM\r\nConnection: close\r\nContent-Length: 0\r\n\r\n", data end def test_custom_http_codes_11 @server.app = proc { |env| [449, {}, [""]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "GET / HTTP/1.1\r\n\r\n" data = sock.read assert_equal "HTTP/1.1 449 CUSTOM\r\nContent-Length: 0\r\n\r\n", data end def test_HEAD_returns_content_headers @server.app = proc { |env| [200, {"Content-Type" => "application/pdf", "Content-Length" => "4242"}, []] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" data = sock.read assert_equal "HTTP/1.0 200 OK\r\nContent-Type: application/pdf\r\nContent-Length: 4242\r\n\r\n", data end def test_status_hook_fires_when_server_changes_states states = [] @events.register(:state) { |s| states << s } @server.app = proc { |env| [200, {}, [""]] } @server.add_tcp_listener @host, @port @server.run sock = TCPSocket.new @host, @port sock << "HEAD / HTTP/1.0\r\n\r\n" sock.read assert_equal [:booting, :running], states @server.stop(true) assert_equal [:booting, :running, :stop, :done], states end def test_timeout_in_data_phase @server.first_data_timeout = 2 @server.add_tcp_listener @host, @port @server.run client = TCPSocket.new @host, @port client << "POST / HTTP/1.1\r\nHost: test.com\r\nContent-Type: text/plain\r\nContent-Length: 5\r\n\r\n" data = client.gets assert_equal "HTTP/1.1 408 Request Timeout\r\n", data end end
Java
// Copyright 2020 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ASH_COMPONENTS_PHONEHUB_FAKE_NOTIFICATION_ACCESS_MANAGER_H_ #define ASH_COMPONENTS_PHONEHUB_FAKE_NOTIFICATION_ACCESS_MANAGER_H_ #include "ash/components/phonehub/notification_access_manager.h" namespace ash { namespace phonehub { class FakeNotificationAccessManager : public NotificationAccessManager { public: explicit FakeNotificationAccessManager( AccessStatus access_status = AccessStatus::kAvailableButNotGranted); ~FakeNotificationAccessManager() override; using NotificationAccessManager::IsSetupOperationInProgress; void SetAccessStatusInternal(AccessStatus access_status) override; void SetNotificationSetupOperationStatus( NotificationAccessSetupOperation::Status new_status); // NotificationAccessManager: AccessStatus GetAccessStatus() const override; bool HasNotificationSetupUiBeenDismissed() const override; void DismissSetupRequiredUi() override; void ResetHasNotificationSetupUiBeenDismissed(); private: AccessStatus access_status_; bool has_notification_setup_ui_been_dismissed_ = false; }; } // namespace phonehub } // namespace ash // TODO(https://crbug.com/1164001): remove after the migration is finished. namespace chromeos { namespace phonehub { using ::ash::phonehub::FakeNotificationAccessManager; } } // namespace chromeos #endif // ASH_COMPONENTS_PHONEHUB_FAKE_NOTIFICATION_ACCESS_MANAGER_H_
Java