code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
line_mean
float64
0.5
100
line_max
int64
1
1k
alpha_frac
float64
0.25
1
autogenerated
bool
1 class
require 'spec_helper' RSpec.configure do |config| config.before(:suite) do VCR.configuration.configure_rspec_metadata! end end describe VCR::RSpec::Metadata, :skip_vcr_reset do before(:all) { VCR.reset! } after(:each) { VCR.reset! } context 'an example group', :vcr do context 'with a nested example group' do it 'uses a cassette for any examples' do VCR.current_cassette.name.split('/').should eq([ 'VCR::RSpec::Metadata', 'an example group', 'with a nested example group', 'uses a cassette for any examples' ]) end end end context 'with the cassette name overridden at the example group level', :vcr => { :cassette_name => 'foo' } do it 'overrides the cassette name for an example' do VCR.current_cassette.name.should eq('foo') end it 'overrides the cassette name for another example' do VCR.current_cassette.name.should eq('foo') end end it 'allows the cassette name to be overriden', :vcr => { :cassette_name => 'foo' } do VCR.current_cassette.name.should eq('foo') end it 'allows the cassette options to be set', :vcr => { :match_requests_on => [:method] } do VCR.current_cassette.match_requests_on.should eq([:method]) end end describe VCR::RSpec::Macros do extend described_class describe '#use_vcr_cassette' do def self.perform_test(context_name, expected_cassette_name, *args, &block) context context_name do after(:each) do if example.metadata[:test_ejection] VCR.current_cassette.should be_nil end end use_vcr_cassette(*args) it 'ejects the cassette in an after hook', :test_ejection do VCR.current_cassette.should be_a(VCR::Cassette) end it "creates a cassette named '#{expected_cassette_name}" do VCR.current_cassette.name.should eq(expected_cassette_name) end module_eval(&block) if block end end perform_test 'when called with an explicit name', 'explicit_name', 'explicit_name' perform_test 'when called with an explicit name and some options', 'explicit_name', 'explicit_name', :match_requests_on => [:method, :host] do it 'uses the provided cassette options' do VCR.current_cassette.match_requests_on.should eq([:method, :host]) end end perform_test 'when called with nothing', 'VCR::RSpec::Macros/#use_vcr_cassette/when called with nothing' perform_test 'when called with some options', 'VCR::RSpec::Macros/#use_vcr_cassette/when called with some options', :match_requests_on => [:method, :host] do it 'uses the provided cassette options' do VCR.current_cassette.match_requests_on.should eq([:method, :host]) end end end end
spookandpuff/spooky-core
.bundle/gems/vcr-2.0.0/spec/vcr/test_frameworks/rspec_spec.rb
Ruby
mit
2,807
31.264368
161
0.65301
false
/*! * Bootstrap v2.0.3 * * Copyright 2012 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */ article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } audio:not([controls]) { display: none; } html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } a:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } a:hover, a:active { outline: 0; } sub, sup { position: relative; font-size: 75%; line-height: 0; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } img { max-width: 100%; vertical-align: middle; border: 0; -ms-interpolation-mode: bicubic; } button, input, select, textarea { margin: 0; font-size: 100%; vertical-align: middle; } button, input { *overflow: visible; line-height: normal; } button::-moz-focus-inner, input::-moz-focus-inner { padding: 0; border: 0; } button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; } input[type="search"] { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-appearance: textfield; } input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; } textarea { overflow: auto; vertical-align: top; } .clearfix { *zoom: 1; } .clearfix:before, .clearfix:after { display: table; content: ""; } .clearfix:after { clear: both; } .hide-text { font: 0/0 a; color: transparent; text-shadow: none; background-color: transparent; border: 0; } .input-block-level { display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; } body { margin: 0; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; color: #333333; background-color: #ffffff; } a { color: #0088cc; text-decoration: none; } a:hover { color: #005580; text-decoration: underline; } .row { margin-left: -20px; *zoom: 1; } .row:before, .row:after { display: table; content: ""; } .row:after { clear: both; } [class*="span"] { float: left; margin-left: 20px; } .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 940px; } .span12 { width: 940px; } .span11 { width: 860px; } .span10 { width: 780px; } .span9 { width: 700px; } .span8 { width: 620px; } .span7 { width: 540px; } .span6 { width: 460px; } .span5 { width: 380px; } .span4 { width: 300px; } .span3 { width: 220px; } .span2 { width: 140px; } .span1 { width: 60px; } .offset12 { margin-left: 980px; } .offset11 { margin-left: 900px; } .offset10 { margin-left: 820px; } .offset9 { margin-left: 740px; } .offset8 { margin-left: 660px; } .offset7 { margin-left: 580px; } .offset6 { margin-left: 500px; } .offset5 { margin-left: 420px; } .offset4 { margin-left: 340px; } .offset3 { margin-left: 260px; } .offset2 { margin-left: 180px; } .offset1 { margin-left: 100px; } .row-fluid { width: 100%; *zoom: 1; } .row-fluid:before, .row-fluid:after { display: table; content: ""; } .row-fluid:after { clear: both; } .row-fluid [class*="span"] { display: block; width: 100%; min-height: 28px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; float: left; margin-left: 2.127659574%; *margin-left: 2.0744680846382977%; } .row-fluid [class*="span"]:first-child { margin-left: 0; } .row-fluid .span12 { width: 99.99999998999999%; *width: 99.94680850063828%; } .row-fluid .span11 { width: 91.489361693%; *width: 91.4361702036383%; } .row-fluid .span10 { width: 82.97872339599999%; *width: 82.92553190663828%; } .row-fluid .span9 { width: 74.468085099%; *width: 74.4148936096383%; } .row-fluid .span8 { width: 65.95744680199999%; *width: 65.90425531263828%; } .row-fluid .span7 { width: 57.446808505%; *width: 57.3936170156383%; } .row-fluid .span6 { width: 48.93617020799999%; *width: 48.88297871863829%; } .row-fluid .span5 { width: 40.425531911%; *width: 40.3723404216383%; } .row-fluid .span4 { width: 31.914893614%; *width: 31.8617021246383%; } .row-fluid .span3 { width: 23.404255317%; *width: 23.3510638276383%; } .row-fluid .span2 { width: 14.89361702%; *width: 14.8404255306383%; } .row-fluid .span1 { width: 6.382978723%; *width: 6.329787233638298%; } .container { margin-right: auto; margin-left: auto; *zoom: 1; } .container:before, .container:after { display: table; content: ""; } .container:after { clear: both; } .container-fluid { padding-right: 20px; padding-left: 20px; *zoom: 1; } .container-fluid:before, .container-fluid:after { display: table; content: ""; } .container-fluid:after { clear: both; } p { margin: 0 0 9px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; } p small { font-size: 11px; color: #999999; } .lead { margin-bottom: 18px; font-size: 20px; font-weight: 200; line-height: 27px; } h1, h2, h3, h4, h5, h6 { margin: 0; font-family: inherit; font-weight: bold; color: inherit; text-rendering: optimizelegibility; } h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { font-weight: normal; color: #999999; } h1 { font-size: 30px; line-height: 36px; } h1 small { font-size: 18px; } h2 { font-size: 24px; line-height: 36px; } h2 small { font-size: 18px; } h3 { font-size: 18px; line-height: 27px; } h3 small { font-size: 14px; } h4, h5, h6 { line-height: 18px; } h4 { font-size: 14px; } h4 small { font-size: 12px; } h5 { font-size: 12px; } h6 { font-size: 11px; color: #999999; text-transform: uppercase; } .page-header { padding-bottom: 17px; margin: 18px 0; border-bottom: 1px solid #eeeeee; } .page-header h1 { line-height: 1; } ul, ol { padding: 0; margin: 0 0 9px 25px; } ul ul, ul ol, ol ol, ol ul { margin-bottom: 0; } ul { list-style: disc; } ol { list-style: decimal; } li { line-height: 18px; } ul.unstyled, ol.unstyled { margin-left: 0; list-style: none; } dl { margin-bottom: 18px; } dt, dd { line-height: 18px; } dt { font-weight: bold; line-height: 17px; } dd { margin-left: 9px; } .dl-horizontal dt { float: left; width: 120px; clear: left; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dl-horizontal dd { margin-left: 130px; } hr { margin: 18px 0; border: 0; border-top: 1px solid #eeeeee; border-bottom: 1px solid #ffffff; } strong { font-weight: bold; } em { font-style: italic; } .muted { color: #999999; } abbr[title] { cursor: help; border-bottom: 1px dotted #ddd; } abbr.initialism { font-size: 90%; text-transform: uppercase; } blockquote { padding: 0 0 0 15px; margin: 0 0 18px; border-left: 5px solid #eeeeee; } blockquote p { margin-bottom: 0; font-size: 16px; font-weight: 300; line-height: 22.5px; } blockquote small { display: block; line-height: 18px; color: #999999; } blockquote small:before { content: '\2014 \00A0'; } blockquote.pull-right { float: right; padding-right: 15px; padding-left: 0; border-right: 5px solid #eeeeee; border-left: 0; } blockquote.pull-right p, blockquote.pull-right small { text-align: right; } q:before, q:after, blockquote:before, blockquote:after { content: ""; } address { display: block; margin-bottom: 18px; font-style: normal; line-height: 18px; } small { font-size: 100%; } cite { font-style: normal; } code, pre { padding: 0 3px 2px; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 12px; color: #333333; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } code { padding: 2px 4px; color: #d14; background-color: #f7f7f9; border: 1px solid #e1e1e8; } pre { display: block; padding: 8.5px; margin: 0 0 9px; font-size: 12.025px; line-height: 18px; word-break: break-all; word-wrap: break-word; white-space: pre; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } pre.prettyprint { margin-bottom: 18px; } pre code { padding: 0; color: inherit; background-color: transparent; border: 0; } .pre-scrollable { max-height: 340px; overflow-y: scroll; } form { margin: 0 0 18px; } fieldset { padding: 0; margin: 0; border: 0; } legend { display: block; width: 100%; padding: 0; margin-bottom: 27px; font-size: 19.5px; line-height: 36px; color: #333333; border: 0; border-bottom: 1px solid #eee; } legend small { font-size: 13.5px; color: #999999; } label, input, button, select, textarea { font-size: 13px; font-weight: normal; line-height: 18px; } input, button, select, textarea { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } label { display: block; margin-bottom: 5px; color: #333333; } input, textarea, select, .uneditable-input { display: inline-block; width: 210px; height: 18px; padding: 4px; margin-bottom: 9px; font-size: 13px; line-height: 18px; color: #555555; background-color: #ffffff; border: 1px solid #cccccc; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .uneditable-textarea { width: auto; height: auto; } label input, label textarea, label select { display: block; } input[type="image"], input[type="checkbox"], input[type="radio"] { width: auto; height: auto; padding: 0; margin: 3px 0; *margin-top: 0; /* IE7 */ line-height: normal; cursor: pointer; background-color: transparent; border: 0 \9; /* IE9 and down */ -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } input[type="image"] { border: 0; } input[type="file"] { width: auto; padding: initial; line-height: initial; background-color: #ffffff; background-color: initial; border: initial; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } input[type="button"], input[type="reset"], input[type="submit"] { width: auto; height: auto; } select, input[type="file"] { height: 28px; /* In IE7, the height of the select element cannot be changed by height, only font-size */ *margin-top: 4px; /* For IE7, add top margin to align select with labels */ line-height: 28px; } input[type="file"] { line-height: 18px \9; } select { width: 220px; background-color: #ffffff; } select[multiple], select[size] { height: auto; } input[type="image"] { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } textarea { height: auto; } input[type="hidden"] { display: none; } .radio, .checkbox { min-height: 18px; padding-left: 18px; } .radio input[type="radio"], .checkbox input[type="checkbox"] { float: left; margin-left: -18px; } .controls > .radio:first-child, .controls > .checkbox:first-child { padding-top: 5px; } .radio.inline, .checkbox.inline { display: inline-block; padding-top: 5px; margin-bottom: 0; vertical-align: middle; } .radio.inline + .radio.inline, .checkbox.inline + .checkbox.inline { margin-left: 10px; } input, textarea { -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -moz-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 linear 0.2s, box-shadow linear 0.2s; -moz-transition: border linear 0.2s, box-shadow linear 0.2s; -ms-transition: border linear 0.2s, box-shadow linear 0.2s; -o-transition: border linear 0.2s, box-shadow linear 0.2s; transition: border linear 0.2s, box-shadow linear 0.2s; } input:focus, textarea:focus { border-color: rgba(82, 168, 236, 0.8); outline: 0; outline: thin dotted \9; /* IE6-9 */ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6); } input[type="file"]:focus, input[type="radio"]:focus, input[type="checkbox"]:focus, select:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .input-mini { width: 60px; } .input-small { width: 90px; } .input-medium { width: 150px; } .input-large { width: 210px; } .input-xlarge { width: 270px; } .input-xxlarge { width: 530px; } input[class*="span"], select[class*="span"], textarea[class*="span"], .uneditable-input[class*="span"], .row-fluid input[class*="span"], .row-fluid select[class*="span"], .row-fluid textarea[class*="span"], .row-fluid .uneditable-input[class*="span"] { float: none; margin-left: 0; } input, textarea, .uneditable-input { margin-left: 0; } input.span12, textarea.span12, .uneditable-input.span12 { width: 930px; } input.span11, textarea.span11, .uneditable-input.span11 { width: 850px; } input.span10, textarea.span10, .uneditable-input.span10 { width: 770px; } input.span9, textarea.span9, .uneditable-input.span9 { width: 690px; } input.span8, textarea.span8, .uneditable-input.span8 { width: 610px; } input.span7, textarea.span7, .uneditable-input.span7 { width: 530px; } input.span6, textarea.span6, .uneditable-input.span6 { width: 450px; } input.span5, textarea.span5, .uneditable-input.span5 { width: 370px; } input.span4, textarea.span4, .uneditable-input.span4 { width: 290px; } input.span3, textarea.span3, .uneditable-input.span3 { width: 210px; } input.span2, textarea.span2, .uneditable-input.span2 { width: 130px; } input.span1, textarea.span1, .uneditable-input.span1 { width: 50px; } input[disabled], select[disabled], textarea[disabled], input[readonly], select[readonly], textarea[readonly] { cursor: not-allowed; background-color: #eeeeee; border-color: #ddd; } input[type="radio"][disabled], input[type="checkbox"][disabled], input[type="radio"][readonly], input[type="checkbox"][readonly] { background-color: transparent; } .control-group.warning > label, .control-group.warning .help-block, .control-group.warning .help-inline { color: #c09853; } .control-group.warning input, .control-group.warning select, .control-group.warning textarea { color: #c09853; border-color: #c09853; } .control-group.warning input:focus, .control-group.warning select:focus, .control-group.warning textarea:focus { border-color: #a47e3c; -webkit-box-shadow: 0 0 6px #dbc59e; -moz-box-shadow: 0 0 6px #dbc59e; box-shadow: 0 0 6px #dbc59e; } .control-group.warning .input-prepend .add-on, .control-group.warning .input-append .add-on { color: #c09853; background-color: #fcf8e3; border-color: #c09853; } .control-group.error > label, .control-group.error .help-block, .control-group.error .help-inline { color: #b94a48; } .control-group.error input, .control-group.error select, .control-group.error textarea { color: #b94a48; border-color: #b94a48; } .control-group.error input:focus, .control-group.error select:focus, .control-group.error textarea:focus { border-color: #953b39; -webkit-box-shadow: 0 0 6px #d59392; -moz-box-shadow: 0 0 6px #d59392; box-shadow: 0 0 6px #d59392; } .control-group.error .input-prepend .add-on, .control-group.error .input-append .add-on { color: #b94a48; background-color: #f2dede; border-color: #b94a48; } .control-group.success > label, .control-group.success .help-block, .control-group.success .help-inline { color: #468847; } .control-group.success input, .control-group.success select, .control-group.success textarea { color: #468847; border-color: #468847; } .control-group.success input:focus, .control-group.success select:focus, .control-group.success textarea:focus { border-color: #356635; -webkit-box-shadow: 0 0 6px #7aba7b; -moz-box-shadow: 0 0 6px #7aba7b; box-shadow: 0 0 6px #7aba7b; } .control-group.success .input-prepend .add-on, .control-group.success .input-append .add-on { color: #468847; background-color: #dff0d8; border-color: #468847; } input:focus:required:invalid, textarea:focus:required:invalid, select:focus:required:invalid { color: #b94a48; border-color: #ee5f5b; } input:focus:required:invalid:focus, textarea:focus:required:invalid:focus, select:focus:required:invalid:focus { border-color: #e9322d; -webkit-box-shadow: 0 0 6px #f8b9b7; -moz-box-shadow: 0 0 6px #f8b9b7; box-shadow: 0 0 6px #f8b9b7; } .form-actions { padding: 17px 20px 18px; margin-top: 18px; margin-bottom: 18px; background-color: #f5f5f5; border-top: 1px solid #ddd; *zoom: 1; } .form-actions:before, .form-actions:after { display: table; content: ""; } .form-actions:after { clear: both; } .uneditable-input { overflow: hidden; white-space: nowrap; cursor: not-allowed; background-color: #ffffff; border-color: #eee; -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025); } :-moz-placeholder { color: #999999; } ::-webkit-input-placeholder { color: #999999; } .help-block, .help-inline { color: #555555; } .help-block { display: block; margin-bottom: 9px; } .help-inline { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; vertical-align: middle; padding-left: 5px; } .input-prepend, .input-append { margin-bottom: 5px; } .input-prepend input, .input-append input, .input-prepend select, .input-append select, .input-prepend .uneditable-input, .input-append .uneditable-input { position: relative; margin-bottom: 0; *margin-left: 0; vertical-align: middle; -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-prepend input:focus, .input-append input:focus, .input-prepend select:focus, .input-append select:focus, .input-prepend .uneditable-input:focus, .input-append .uneditable-input:focus { z-index: 2; } .input-prepend .uneditable-input, .input-append .uneditable-input { border-left-color: #ccc; } .input-prepend .add-on, .input-append .add-on { display: inline-block; width: auto; height: 18px; min-width: 16px; padding: 4px 5px; font-weight: normal; line-height: 18px; text-align: center; text-shadow: 0 1px 0 #ffffff; vertical-align: middle; background-color: #eeeeee; border: 1px solid #ccc; } .input-prepend .add-on, .input-append .add-on, .input-prepend .btn, .input-append .btn { margin-left: -1px; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .input-prepend .active, .input-append .active { background-color: #a9dba9; border-color: #46a546; } .input-prepend .add-on, .input-prepend .btn { margin-right: -1px; } .input-prepend .add-on:first-child, .input-prepend .btn:first-child { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .input-append input, .input-append select, .input-append .uneditable-input { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .input-append .uneditable-input { border-right-color: #ccc; border-left-color: #eee; } .input-append .add-on:last-child, .input-append .btn:last-child { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .input-prepend.input-append input, .input-prepend.input-append select, .input-prepend.input-append .uneditable-input { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .input-prepend.input-append .add-on:first-child, .input-prepend.input-append .btn:first-child { margin-right: -1px; -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .input-prepend.input-append .add-on:last-child, .input-prepend.input-append .btn:last-child { margin-left: -1px; -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .search-query { padding-right: 14px; padding-right: 4px \9; padding-left: 14px; padding-left: 4px \9; /* IE7-8 doesn't have border-radius, so don't indent the padding */ margin-bottom: 0; -webkit-border-radius: 14px; -moz-border-radius: 14px; border-radius: 14px; } .form-search input, .form-inline input, .form-horizontal input, .form-search textarea, .form-inline textarea, .form-horizontal textarea, .form-search select, .form-inline select, .form-horizontal select, .form-search .help-inline, .form-inline .help-inline, .form-horizontal .help-inline, .form-search .uneditable-input, .form-inline .uneditable-input, .form-horizontal .uneditable-input, .form-search .input-prepend, .form-inline .input-prepend, .form-horizontal .input-prepend, .form-search .input-append, .form-inline .input-append, .form-horizontal .input-append { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; margin-bottom: 0; } .form-search .hide, .form-inline .hide, .form-horizontal .hide { display: none; } .form-search label, .form-inline label { display: inline-block; } .form-search .input-append, .form-inline .input-append, .form-search .input-prepend, .form-inline .input-prepend { margin-bottom: 0; } .form-search .radio, .form-search .checkbox, .form-inline .radio, .form-inline .checkbox { padding-left: 0; margin-bottom: 0; vertical-align: middle; } .form-search .radio input[type="radio"], .form-search .checkbox input[type="checkbox"], .form-inline .radio input[type="radio"], .form-inline .checkbox input[type="checkbox"] { float: left; margin-right: 3px; margin-left: 0; } .control-group { margin-bottom: 9px; } legend + .control-group { margin-top: 18px; -webkit-margin-top-collapse: separate; } .form-horizontal .control-group { margin-bottom: 18px; *zoom: 1; } .form-horizontal .control-group:before, .form-horizontal .control-group:after { display: table; content: ""; } .form-horizontal .control-group:after { clear: both; } .form-horizontal .control-label { float: left; width: 140px; padding-top: 5px; text-align: right; } .form-horizontal .controls { *display: inline-block; *padding-left: 20px; margin-left: 160px; *margin-left: 0; } .form-horizontal .controls:first-child { *padding-left: 160px; } .form-horizontal .help-block { margin-top: 9px; margin-bottom: 0; } .form-horizontal .form-actions { padding-left: 160px; } table { max-width: 100%; background-color: transparent; border-collapse: collapse; border-spacing: 0; } .table { width: 100%; margin-bottom: 18px; } .table th, .table td { padding: 8px; line-height: 18px; text-align: left; vertical-align: top; border-top: 1px solid #dddddd; } .table th { font-weight: bold; } .table thead th { vertical-align: bottom; } .table caption + thead tr:first-child th, .table caption + thead tr:first-child td, .table colgroup + thead tr:first-child th, .table colgroup + thead tr:first-child td, .table thead:first-child tr:first-child th, .table thead:first-child tr:first-child td { border-top: 0; } .table tbody + tbody { border-top: 2px solid #dddddd; } .table-condensed th, .table-condensed td { padding: 4px 5px; } .table-bordered { border: 1px solid #dddddd; border-collapse: separate; *border-collapse: collapsed; border-left: 0; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .table-bordered th, .table-bordered td { border-left: 1px solid #dddddd; } .table-bordered caption + thead tr:first-child th, .table-bordered caption + tbody tr:first-child th, .table-bordered caption + tbody tr:first-child td, .table-bordered colgroup + thead tr:first-child th, .table-bordered colgroup + tbody tr:first-child th, .table-bordered colgroup + tbody tr:first-child td, .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td { border-top: 0; } .table-bordered thead:first-child tr:first-child th:first-child, .table-bordered tbody:first-child tr:first-child td:first-child { -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; } .table-bordered thead:first-child tr:first-child th:last-child, .table-bordered tbody:first-child tr:first-child td:last-child { -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-topright: 4px; } .table-bordered thead:last-child tr:last-child th:first-child, .table-bordered tbody:last-child tr:last-child td:first-child { -webkit-border-radius: 0 0 0 4px; -moz-border-radius: 0 0 0 4px; border-radius: 0 0 0 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; } .table-bordered thead:last-child tr:last-child th:last-child, .table-bordered tbody:last-child tr:last-child td:last-child { -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; } .table-striped tbody tr:nth-child(odd) td, .table-striped tbody tr:nth-child(odd) th { background-color: #f9f9f9; } .table tbody tr:hover td, .table tbody tr:hover th { background-color: #f5f5f5; } table .span1 { float: none; width: 44px; margin-left: 0; } table .span2 { float: none; width: 124px; margin-left: 0; } table .span3 { float: none; width: 204px; margin-left: 0; } table .span4 { float: none; width: 284px; margin-left: 0; } table .span5 { float: none; width: 364px; margin-left: 0; } table .span6 { float: none; width: 444px; margin-left: 0; } table .span7 { float: none; width: 524px; margin-left: 0; } table .span8 { float: none; width: 604px; margin-left: 0; } table .span9 { float: none; width: 684px; margin-left: 0; } table .span10 { float: none; width: 764px; margin-left: 0; } table .span11 { float: none; width: 844px; margin-left: 0; } table .span12 { float: none; width: 924px; margin-left: 0; } table .span13 { float: none; width: 1004px; margin-left: 0; } table .span14 { float: none; width: 1084px; margin-left: 0; } table .span15 { float: none; width: 1164px; margin-left: 0; } table .span16 { float: none; width: 1244px; margin-left: 0; } table .span17 { float: none; width: 1324px; margin-left: 0; } table .span18 { float: none; width: 1404px; margin-left: 0; } table .span19 { float: none; width: 1484px; margin-left: 0; } table .span20 { float: none; width: 1564px; margin-left: 0; } table .span21 { float: none; width: 1644px; margin-left: 0; } table .span22 { float: none; width: 1724px; margin-left: 0; } table .span23 { float: none; width: 1804px; margin-left: 0; } table .span24 { float: none; width: 1884px; margin-left: 0; } [class^="icon-"], [class*=" icon-"] { display: inline-block; width: 14px; height: 14px; *margin-right: .3em; line-height: 14px; vertical-align: text-top; background-image: url("../images/glyphicons-halflings.png"); background-position: 14px 14px; background-repeat: no-repeat; } [class^="icon-"]:last-child, [class*=" icon-"]:last-child { *margin-left: 0; } .icon-white { background-image: url("../images/glyphicons-halflings-white.png"); } .icon-glass { background-position: 0 0; } .icon-music { background-position: -24px 0; } .icon-search { background-position: -48px 0; } .icon-envelope { background-position: -72px 0; } .icon-heart { background-position: -96px 0; } .icon-star { background-position: -120px 0; } .icon-star-empty { background-position: -144px 0; } .icon-user { background-position: -168px 0; } .icon-film { background-position: -192px 0; } .icon-th-large { background-position: -216px 0; } .icon-th { background-position: -240px 0; } .icon-th-list { background-position: -264px 0; } .icon-ok { background-position: -288px 0; } .icon-remove { background-position: -312px 0; } .icon-zoom-in { background-position: -336px 0; } .icon-zoom-out { background-position: -360px 0; } .icon-off { background-position: -384px 0; } .icon-signal { background-position: -408px 0; } .icon-cog { background-position: -432px 0; } .icon-trash { background-position: -456px 0; } .icon-home { background-position: 0 -24px; } .icon-file { background-position: -24px -24px; } .icon-time { background-position: -48px -24px; } .icon-road { background-position: -72px -24px; } .icon-download-alt { background-position: -96px -24px; } .icon-download { background-position: -120px -24px; } .icon-upload { background-position: -144px -24px; } .icon-inbox { background-position: -168px -24px; } .icon-play-circle { background-position: -192px -24px; } .icon-repeat { background-position: -216px -24px; } .icon-refresh { background-position: -240px -24px; } .icon-list-alt { background-position: -264px -24px; } .icon-lock { background-position: -287px -24px; } .icon-flag { background-position: -312px -24px; } .icon-headphones { background-position: -336px -24px; } .icon-volume-off { background-position: -360px -24px; } .icon-volume-down { background-position: -384px -24px; } .icon-volume-up { background-position: -408px -24px; } .icon-qrcode { background-position: -432px -24px; } .icon-barcode { background-position: -456px -24px; } .icon-tag { background-position: 0 -48px; } .icon-tags { background-position: -25px -48px; } .icon-book { background-position: -48px -48px; } .icon-bookmark { background-position: -72px -48px; } .icon-print { background-position: -96px -48px; } .icon-camera { background-position: -120px -48px; } .icon-font { background-position: -144px -48px; } .icon-bold { background-position: -167px -48px; } .icon-italic { background-position: -192px -48px; } .icon-text-height { background-position: -216px -48px; } .icon-text-width { background-position: -240px -48px; } .icon-align-left { background-position: -264px -48px; } .icon-align-center { background-position: -288px -48px; } .icon-align-right { background-position: -312px -48px; } .icon-align-justify { background-position: -336px -48px; } .icon-list { background-position: -360px -48px; } .icon-indent-left { background-position: -384px -48px; } .icon-indent-right { background-position: -408px -48px; } .icon-facetime-video { background-position: -432px -48px; } .icon-picture { background-position: -456px -48px; } .icon-pencil { background-position: 0 -72px; } .icon-map-marker { background-position: -24px -72px; } .icon-adjust { background-position: -48px -72px; } .icon-tint { background-position: -72px -72px; } .icon-edit { background-position: -96px -72px; } .icon-share { background-position: -120px -72px; } .icon-check { background-position: -144px -72px; } .icon-move { background-position: -168px -72px; } .icon-step-backward { background-position: -192px -72px; } .icon-fast-backward { background-position: -216px -72px; } .icon-backward { background-position: -240px -72px; } .icon-play { background-position: -264px -72px; } .icon-pause { background-position: -288px -72px; } .icon-stop { background-position: -312px -72px; } .icon-forward { background-position: -336px -72px; } .icon-fast-forward { background-position: -360px -72px; } .icon-step-forward { background-position: -384px -72px; } .icon-eject { background-position: -408px -72px; } .icon-chevron-left { background-position: -432px -72px; } .icon-chevron-right { background-position: -456px -72px; } .icon-plus-sign { background-position: 0 -96px; } .icon-minus-sign { background-position: -24px -96px; } .icon-remove-sign { background-position: -48px -96px; } .icon-ok-sign { background-position: -72px -96px; } .icon-question-sign { background-position: -96px -96px; } .icon-info-sign { background-position: -120px -96px; } .icon-screenshot { background-position: -144px -96px; } .icon-remove-circle { background-position: -168px -96px; } .icon-ok-circle { background-position: -192px -96px; } .icon-ban-circle { background-position: -216px -96px; } .icon-arrow-left { background-position: -240px -96px; } .icon-arrow-right { background-position: -264px -96px; } .icon-arrow-up { background-position: -289px -96px; } .icon-arrow-down { background-position: -312px -96px; } .icon-share-alt { background-position: -336px -96px; } .icon-resize-full { background-position: -360px -96px; } .icon-resize-small { background-position: -384px -96px; } .icon-plus { background-position: -408px -96px; } .icon-minus { background-position: -433px -96px; } .icon-asterisk { background-position: -456px -96px; } .icon-exclamation-sign { background-position: 0 -120px; } .icon-gift { background-position: -24px -120px; } .icon-leaf { background-position: -48px -120px; } .icon-fire { background-position: -72px -120px; } .icon-eye-open { background-position: -96px -120px; } .icon-eye-close { background-position: -120px -120px; } .icon-warning-sign { background-position: -144px -120px; } .icon-plane { background-position: -168px -120px; } .icon-calendar { background-position: -192px -120px; } .icon-random { background-position: -216px -120px; } .icon-comment { background-position: -240px -120px; } .icon-magnet { background-position: -264px -120px; } .icon-chevron-up { background-position: -288px -120px; } .icon-chevron-down { background-position: -313px -119px; } .icon-retweet { background-position: -336px -120px; } .icon-shopping-cart { background-position: -360px -120px; } .icon-folder-close { background-position: -384px -120px; } .icon-folder-open { background-position: -408px -120px; } .icon-resize-vertical { background-position: -432px -119px; } .icon-resize-horizontal { background-position: -456px -118px; } .icon-hdd { background-position: 0 -144px; } .icon-bullhorn { background-position: -24px -144px; } .icon-bell { background-position: -48px -144px; } .icon-certificate { background-position: -72px -144px; } .icon-thumbs-up { background-position: -96px -144px; } .icon-thumbs-down { background-position: -120px -144px; } .icon-hand-right { background-position: -144px -144px; } .icon-hand-left { background-position: -168px -144px; } .icon-hand-up { background-position: -192px -144px; } .icon-hand-down { background-position: -216px -144px; } .icon-circle-arrow-right { background-position: -240px -144px; } .icon-circle-arrow-left { background-position: -264px -144px; } .icon-circle-arrow-up { background-position: -288px -144px; } .icon-circle-arrow-down { background-position: -312px -144px; } .icon-globe { background-position: -336px -144px; } .icon-wrench { background-position: -360px -144px; } .icon-tasks { background-position: -384px -144px; } .icon-filter { background-position: -408px -144px; } .icon-briefcase { background-position: -432px -144px; } .icon-fullscreen { background-position: -456px -144px; } .dropup, .dropdown { position: relative; } .dropdown-toggle { *margin-bottom: -3px; } .dropdown-toggle:active, .open .dropdown-toggle { outline: 0; } .caret { display: inline-block; width: 0; height: 0; vertical-align: top; border-top: 4px solid #000000; border-right: 4px solid transparent; border-left: 4px solid transparent; content: ""; opacity: 0.3; filter: alpha(opacity=30); } .dropdown .caret { margin-top: 8px; margin-left: 2px; } .dropdown:hover .caret, .open .caret { opacity: 1; filter: alpha(opacity=100); } .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 1000; display: none; float: left; min-width: 160px; padding: 4px 0; margin: 1px 0 0; list-style: none; background-color: #ffffff; border: 1px solid #ccc; border: 1px solid rgba(0, 0, 0, 0.2); *border-right-width: 2px; *border-bottom-width: 2px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); -webkit-background-clip: padding-box; -moz-background-clip: padding; background-clip: padding-box; } .dropdown-menu.pull-right { right: 0; left: auto; } .dropdown-menu .divider { *width: 100%; height: 1px; margin: 8px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #ffffff; } .dropdown-menu a { display: block; padding: 3px 15px; clear: both; font-weight: normal; line-height: 18px; color: #333333; white-space: nowrap; } .dropdown-menu li > a:hover, .dropdown-menu .active > a, .dropdown-menu .active > a:hover { color: #ffffff; text-decoration: none; background-color: #0088cc; } .open { *z-index: 1000; } .open .dropdown-menu { display: block; } .pull-right .dropdown-menu { right: 0; left: auto; } .dropup .caret, .navbar-fixed-bottom .dropdown .caret { border-top: 0; border-bottom: 4px solid #000000; content: "\2191"; } .dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu { top: auto; bottom: 100%; margin-bottom: 1px; } .typeahead { margin-top: 2px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .well { min-height: 20px; padding: 19px; margin-bottom: 20px; background-color: #f5f5f5; border: 1px solid #eee; border: 1px solid rgba(0, 0, 0, 0.05); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -moz-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-large { padding: 24px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .well-small { padding: 9px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .fade { opacity: 0; filter: alpha(opacity=0); -webkit-transition: opacity 0.15s linear; -moz-transition: opacity 0.15s linear; -ms-transition: opacity 0.15s linear; -o-transition: opacity 0.15s linear; transition: opacity 0.15s linear; } .fade.in { opacity: 1; filter: alpha(opacity=100); } .collapse { position: relative; height: 0; overflow: hidden; -webkit-transition: height 0.35s ease; -moz-transition: height 0.35s ease; -ms-transition: height 0.35s ease; -o-transition: height 0.35s ease; transition: height 0.35s ease; } .collapse.in { height: auto; } .close { float: right; font-size: 20px; font-weight: bold; line-height: 18px; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.2; filter: alpha(opacity=20); } .close:hover { color: #000000; text-decoration: none; cursor: pointer; opacity: 0.4; filter: alpha(opacity=40); } button.close { padding: 0; cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; } .btn { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; padding: 4px 10px 4px; margin-bottom: 0; font-size: 13px; line-height: 18px; *line-height: 20px; color: #333333; text-align: center; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); vertical-align: middle; cursor: pointer; background-color: #f5f5f5; background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); background-image: linear-gradient(top, #ffffff, #e6e6e6); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); border-color: #e6e6e6 #e6e6e6 #bfbfbf; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #e6e6e6; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); border: 1px solid #cccccc; *border: 0; border-bottom-color: #b3b3b3; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; *margin-left: .3em; -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); } .btn:hover, .btn:active, .btn.active, .btn.disabled, .btn[disabled] { background-color: #e6e6e6; *background-color: #d9d9d9; } .btn:active, .btn.active { background-color: #cccccc \9; } .btn:first-child { *margin-left: 0; } .btn:hover { color: #333333; text-decoration: none; background-color: #e6e6e6; *background-color: #d9d9d9; /* Buttons in IE7 don't get borders, so darken on hover */ background-position: 0 -15px; -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s linear; -ms-transition: background-position 0.1s linear; -o-transition: background-position 0.1s linear; transition: background-position 0.1s linear; } .btn:focus { outline: thin dotted #333; outline: 5px auto -webkit-focus-ring-color; outline-offset: -2px; } .btn.active, .btn:active { background-color: #e6e6e6; background-color: #d9d9d9 \9; background-image: none; outline: 0; -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); } .btn.disabled, .btn[disabled] { cursor: default; background-color: #e6e6e6; background-image: none; opacity: 0.65; filter: alpha(opacity=65); -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .btn-large { padding: 9px 14px; font-size: 15px; line-height: normal; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .btn-large [class^="icon-"] { margin-top: 1px; } .btn-small { padding: 5px 9px; font-size: 11px; line-height: 16px; } .btn-small [class^="icon-"] { margin-top: -1px; } .btn-mini { padding: 2px 6px; font-size: 11px; line-height: 14px; } .btn-primary, .btn-primary:hover, .btn-warning, .btn-warning:hover, .btn-danger, .btn-danger:hover, .btn-success, .btn-success:hover, .btn-info, .btn-info:hover, .btn-inverse, .btn-inverse:hover { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-inverse.active { color: rgba(255, 255, 255, 0.75); } .btn { border-color: #ccc; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); } .btn-primary { background-color: #0074cc; background-image: -moz-linear-gradient(top, #0088cc, #0055cc); background-image: -ms-linear-gradient(top, #0088cc, #0055cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0055cc); background-image: -o-linear-gradient(top, #0088cc, #0055cc); background-image: linear-gradient(top, #0088cc, #0055cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0); border-color: #0055cc #0055cc #003580; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #0055cc; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { background-color: #0055cc; *background-color: #004ab3; } .btn-primary:active, .btn-primary.active { background-color: #004099 \9; } .btn-warning { background-color: #faa732; background-image: -moz-linear-gradient(top, #fbb450, #f89406); background-image: -ms-linear-gradient(top, #fbb450, #f89406); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); background-image: -webkit-linear-gradient(top, #fbb450, #f89406); background-image: -o-linear-gradient(top, #fbb450, #f89406); background-image: linear-gradient(top, #fbb450, #f89406); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0); border-color: #f89406 #f89406 #ad6704; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #f89406; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-warning:hover, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] { background-color: #f89406; *background-color: #df8505; } .btn-warning:active, .btn-warning.active { background-color: #c67605 \9; } .btn-danger { background-color: #da4f49; background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f); background-image: -ms-linear-gradient(top, #ee5f5b, #bd362f); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f)); background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f); background-image: -o-linear-gradient(top, #ee5f5b, #bd362f); background-image: linear-gradient(top, #ee5f5b, #bd362f); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0); border-color: #bd362f #bd362f #802420; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #bd362f; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-danger:hover, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] { background-color: #bd362f; *background-color: #a9302a; } .btn-danger:active, .btn-danger.active { background-color: #942a25 \9; } .btn-success { background-color: #5bb75b; background-image: -moz-linear-gradient(top, #62c462, #51a351); background-image: -ms-linear-gradient(top, #62c462, #51a351); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351)); background-image: -webkit-linear-gradient(top, #62c462, #51a351); background-image: -o-linear-gradient(top, #62c462, #51a351); background-image: linear-gradient(top, #62c462, #51a351); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0); border-color: #51a351 #51a351 #387038; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #51a351; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-success:hover, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] { background-color: #51a351; *background-color: #499249; } .btn-success:active, .btn-success.active { background-color: #408140 \9; } .btn-info { background-color: #49afcd; background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4); background-image: -ms-linear-gradient(top, #5bc0de, #2f96b4); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4)); background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4); background-image: -o-linear-gradient(top, #5bc0de, #2f96b4); background-image: linear-gradient(top, #5bc0de, #2f96b4); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0); border-color: #2f96b4 #2f96b4 #1f6377; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #2f96b4; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-info:hover, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] { background-color: #2f96b4; *background-color: #2a85a0; } .btn-info:active, .btn-info.active { background-color: #24748c \9; } .btn-inverse { background-color: #414141; background-image: -moz-linear-gradient(top, #555555, #222222); background-image: -ms-linear-gradient(top, #555555, #222222); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222)); background-image: -webkit-linear-gradient(top, #555555, #222222); background-image: -o-linear-gradient(top, #555555, #222222); background-image: linear-gradient(top, #555555, #222222); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0); border-color: #222222 #222222 #000000; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #222222; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); } .btn-inverse:hover, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] { background-color: #222222; *background-color: #151515; } .btn-inverse:active, .btn-inverse.active { background-color: #080808 \9; } button.btn, input[type="submit"].btn { *padding-top: 2px; *padding-bottom: 2px; } button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner { padding: 0; border: 0; } button.btn.btn-large, input[type="submit"].btn.btn-large { *padding-top: 7px; *padding-bottom: 7px; } button.btn.btn-small, input[type="submit"].btn.btn-small { *padding-top: 3px; *padding-bottom: 3px; } button.btn.btn-mini, input[type="submit"].btn.btn-mini { *padding-top: 1px; *padding-bottom: 1px; } .btn-group { position: relative; *zoom: 1; *margin-left: .3em; } .btn-group:before, .btn-group:after { display: table; content: ""; } .btn-group:after { clear: both; } .btn-group:first-child { *margin-left: 0; } .btn-group + .btn-group { margin-left: 5px; } .btn-toolbar { margin-top: 9px; margin-bottom: 9px; } .btn-toolbar .btn-group { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; } .btn-group > .btn { position: relative; float: left; margin-left: -1px; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .btn-group > .btn:first-child { margin-left: 0; -webkit-border-top-left-radius: 4px; -moz-border-radius-topleft: 4px; border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomleft: 4px; border-bottom-left-radius: 4px; } .btn-group > .btn:last-child, .btn-group > .dropdown-toggle { -webkit-border-top-right-radius: 4px; -moz-border-radius-topright: 4px; border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-bottomright: 4px; border-bottom-right-radius: 4px; } .btn-group > .btn.large:first-child { margin-left: 0; -webkit-border-top-left-radius: 6px; -moz-border-radius-topleft: 6px; border-top-left-radius: 6px; -webkit-border-bottom-left-radius: 6px; -moz-border-radius-bottomleft: 6px; border-bottom-left-radius: 6px; } .btn-group > .btn.large:last-child, .btn-group > .large.dropdown-toggle { -webkit-border-top-right-radius: 6px; -moz-border-radius-topright: 6px; border-top-right-radius: 6px; -webkit-border-bottom-right-radius: 6px; -moz-border-radius-bottomright: 6px; border-bottom-right-radius: 6px; } .btn-group > .btn:hover, .btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active { z-index: 2; } .btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle { outline: 0; } .btn-group > .dropdown-toggle { padding-left: 8px; padding-right: 8px; -webkit-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05); *padding-top: 4px; *padding-bottom: 4px; } .btn-group > .btn-mini.dropdown-toggle { padding-left: 5px; padding-right: 5px; } .btn-group > .btn-small.dropdown-toggle { *padding-top: 4px; *padding-bottom: 4px; } .btn-group > .btn-large.dropdown-toggle { padding-left: 12px; padding-right: 12px; } .btn-group.open .dropdown-toggle { background-image: none; -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); -moz-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05); } .btn-group.open .btn.dropdown-toggle { background-color: #e6e6e6; } .btn-group.open .btn-primary.dropdown-toggle { background-color: #0055cc; } .btn-group.open .btn-warning.dropdown-toggle { background-color: #f89406; } .btn-group.open .btn-danger.dropdown-toggle { background-color: #bd362f; } .btn-group.open .btn-success.dropdown-toggle { background-color: #51a351; } .btn-group.open .btn-info.dropdown-toggle { background-color: #2f96b4; } .btn-group.open .btn-inverse.dropdown-toggle { background-color: #222222; } .btn .caret { margin-top: 7px; margin-left: 0; } .btn:hover .caret, .open.btn-group .caret { opacity: 1; filter: alpha(opacity=100); } .btn-mini .caret { margin-top: 5px; } .btn-small .caret { margin-top: 6px; } .btn-large .caret { margin-top: 6px; border-left-width: 5px; border-right-width: 5px; border-top-width: 5px; } .dropup .btn-large .caret { border-bottom: 5px solid #000000; border-top: 0; } .btn-primary .caret, .btn-warning .caret, .btn-danger .caret, .btn-info .caret, .btn-success .caret, .btn-inverse .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; opacity: 0.75; filter: alpha(opacity=75); } .alert { padding: 8px 35px 8px 14px; margin-bottom: 18px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); background-color: #fcf8e3; border: 1px solid #fbeed5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #c09853; } .alert-heading { color: inherit; } .alert .close { position: relative; top: -2px; right: -21px; line-height: 18px; } .alert-success { background-color: #dff0d8; border-color: #d6e9c6; color: #468847; } .alert-danger, .alert-error { background-color: #f2dede; border-color: #eed3d7; color: #b94a48; } .alert-info { background-color: #d9edf7; border-color: #bce8f1; color: #3a87ad; } .alert-block { padding-top: 14px; padding-bottom: 14px; } .alert-block > p, .alert-block > ul { margin-bottom: 0; } .alert-block p + p { margin-top: 5px; } .nav { margin-left: 0; margin-bottom: 18px; list-style: none; } .nav > li > a { display: block; } .nav > li > a:hover { text-decoration: none; background-color: #eeeeee; } .nav > .pull-right { float: right; } .nav .nav-header { display: block; padding: 3px 15px; font-size: 11px; font-weight: bold; line-height: 18px; color: #999999; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); text-transform: uppercase; } .nav li + .nav-header { margin-top: 9px; } .nav-list { padding-left: 15px; padding-right: 15px; margin-bottom: 0; } .nav-list > li > a, .nav-list .nav-header { margin-left: -15px; margin-right: -15px; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); } .nav-list > li > a { padding: 3px 15px; } .nav-list > .active > a, .nav-list > .active > a:hover { color: #ffffff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); background-color: #0088cc; } .nav-list [class^="icon-"] { margin-right: 2px; } .nav-list .divider { *width: 100%; height: 1px; margin: 8px 1px; *margin: -5px 0 5px; overflow: hidden; background-color: #e5e5e5; border-bottom: 1px solid #ffffff; } .nav-tabs, .nav-pills { *zoom: 1; } .nav-tabs:before, .nav-pills:before, .nav-tabs:after, .nav-pills:after { display: table; content: ""; } .nav-tabs:after, .nav-pills:after { clear: both; } .nav-tabs > li, .nav-pills > li { float: left; } .nav-tabs > li > a, .nav-pills > li > a { padding-right: 12px; padding-left: 12px; margin-right: 2px; line-height: 14px; } .nav-tabs { border-bottom: 1px solid #ddd; } .nav-tabs > li { margin-bottom: -1px; } .nav-tabs > li > a { padding-top: 8px; padding-bottom: 8px; line-height: 18px; border: 1px solid transparent; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #dddddd; } .nav-tabs > .active > a, .nav-tabs > .active > a:hover { color: #555555; background-color: #ffffff; border: 1px solid #ddd; border-bottom-color: transparent; cursor: default; } .nav-pills > li > a { padding-top: 8px; padding-bottom: 8px; margin-top: 2px; margin-bottom: 2px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .nav-pills > .active > a, .nav-pills > .active > a:hover { color: #ffffff; background-color: #0088cc; } .nav-stacked > li { float: none; } .nav-stacked > li > a { margin-right: 0; } .nav-tabs.nav-stacked { border-bottom: 0; } .nav-tabs.nav-stacked > li > a { border: 1px solid #ddd; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .nav-tabs.nav-stacked > li:first-child > a { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .nav-tabs.nav-stacked > li:last-child > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .nav-tabs.nav-stacked > li > a:hover { border-color: #ddd; z-index: 2; } .nav-pills.nav-stacked > li > a { margin-bottom: 3px; } .nav-pills.nav-stacked > li:last-child > a { margin-bottom: 1px; } .nav-tabs .dropdown-menu { -webkit-border-radius: 0 0 5px 5px; -moz-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; } .nav-pills .dropdown-menu { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .nav-tabs .dropdown-toggle .caret, .nav-pills .dropdown-toggle .caret { border-top-color: #0088cc; border-bottom-color: #0088cc; margin-top: 6px; } .nav-tabs .dropdown-toggle:hover .caret, .nav-pills .dropdown-toggle:hover .caret { border-top-color: #005580; border-bottom-color: #005580; } .nav-tabs .active .dropdown-toggle .caret, .nav-pills .active .dropdown-toggle .caret { border-top-color: #333333; border-bottom-color: #333333; } .nav > .dropdown.active > a:hover { color: #000000; cursor: pointer; } .nav-tabs .open .dropdown-toggle, .nav-pills .open .dropdown-toggle, .nav > li.dropdown.open.active > a:hover { color: #ffffff; background-color: #999999; border-color: #999999; } .nav li.dropdown.open .caret, .nav li.dropdown.open.active .caret, .nav li.dropdown.open a:hover .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; opacity: 1; filter: alpha(opacity=100); } .tabs-stacked .open > a:hover { border-color: #999999; } .tabbable { *zoom: 1; } .tabbable:before, .tabbable:after { display: table; content: ""; } .tabbable:after { clear: both; } .tab-content { overflow: auto; } .tabs-below > .nav-tabs, .tabs-right > .nav-tabs, .tabs-left > .nav-tabs { border-bottom: 0; } .tab-content > .tab-pane, .pill-content > .pill-pane { display: none; } .tab-content > .active, .pill-content > .active { display: block; } .tabs-below > .nav-tabs { border-top: 1px solid #ddd; } .tabs-below > .nav-tabs > li { margin-top: -1px; margin-bottom: 0; } .tabs-below > .nav-tabs > li > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .tabs-below > .nav-tabs > li > a:hover { border-bottom-color: transparent; border-top-color: #ddd; } .tabs-below > .nav-tabs > .active > a, .tabs-below > .nav-tabs > .active > a:hover { border-color: transparent #ddd #ddd #ddd; } .tabs-left > .nav-tabs > li, .tabs-right > .nav-tabs > li { float: none; } .tabs-left > .nav-tabs > li > a, .tabs-right > .nav-tabs > li > a { min-width: 74px; margin-right: 0; margin-bottom: 3px; } .tabs-left > .nav-tabs { float: left; margin-right: 19px; border-right: 1px solid #ddd; } .tabs-left > .nav-tabs > li > a { margin-right: -1px; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; } .tabs-left > .nav-tabs > li > a:hover { border-color: #eeeeee #dddddd #eeeeee #eeeeee; } .tabs-left > .nav-tabs .active > a, .tabs-left > .nav-tabs .active > a:hover { border-color: #ddd transparent #ddd #ddd; *border-right-color: #ffffff; } .tabs-right > .nav-tabs { float: right; margin-left: 19px; border-left: 1px solid #ddd; } .tabs-right > .nav-tabs > li > a { margin-left: -1px; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; } .tabs-right > .nav-tabs > li > a:hover { border-color: #eeeeee #eeeeee #eeeeee #dddddd; } .tabs-right > .nav-tabs .active > a, .tabs-right > .nav-tabs .active > a:hover { border-color: #ddd #ddd #ddd transparent; *border-left-color: #ffffff; } .navbar { *position: relative; *z-index: 2; overflow: visible; margin-bottom: 18px; } .navbar-inner { min-height: 40px; padding-left: 20px; padding-right: 20px; background-color: #2c2c2c; background-image: -moz-linear-gradient(top, #333333, #222222); background-image: -ms-linear-gradient(top, #333333, #222222); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222)); background-image: -webkit-linear-gradient(top, #333333, #222222); background-image: -o-linear-gradient(top, #333333, #222222); background-image: linear-gradient(top, #333333, #222222); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1); -moz-box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1); box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1); } .nav-collapse.collapse { height: auto; } .navbar { color: #999999; } .navbar .brand:hover { text-decoration: none; } .navbar .brand { float: left; display: block; padding: 8px 20px 12px; margin-left: -20px; font-size: 20px; font-weight: 200; line-height: 1; color: #999999; } .navbar .navbar-text { margin-bottom: 0; line-height: 40px; } .navbar .navbar-link { color: #999999; } .navbar .navbar-link:hover { color: #ffffff; } .navbar .btn, .navbar .btn-group { margin-top: 5px; } .navbar .btn-group .btn { margin: 0; } .navbar-form { margin-bottom: 0; *zoom: 1; } .navbar-form:before, .navbar-form:after { display: table; content: ""; } .navbar-form:after { clear: both; } .navbar-form input, .navbar-form select, .navbar-form .radio, .navbar-form .checkbox { margin-top: 5px; } .navbar-form input, .navbar-form select { display: inline-block; margin-bottom: 0; } .navbar-form input[type="image"], .navbar-form input[type="checkbox"], .navbar-form input[type="radio"] { margin-top: 3px; } .navbar-form .input-append, .navbar-form .input-prepend { margin-top: 6px; white-space: nowrap; } .navbar-form .input-append input, .navbar-form .input-prepend input { margin-top: 0; } .navbar-search { position: relative; float: left; margin-top: 6px; margin-bottom: 0; } .navbar-search .search-query { padding: 4px 9px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 13px; font-weight: normal; line-height: 1; color: #ffffff; background-color: #626262; border: 1px solid #151515; -webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15); -moz-box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15); box-shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15); -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none; transition: none; } .navbar-search .search-query:-moz-placeholder { color: #cccccc; } .navbar-search .search-query::-webkit-input-placeholder { color: #cccccc; } .navbar-search .search-query:focus, .navbar-search .search-query.focused { padding: 5px 10px; color: #333333; text-shadow: 0 1px 0 #ffffff; background-color: #ffffff; border: 0; -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); box-shadow: 0 0 3px rgba(0, 0, 0, 0.15); outline: 0; } .navbar-fixed-top, .navbar-fixed-bottom { position: fixed; right: 0; left: 0; z-index: 1030; margin-bottom: 0; } .navbar-fixed-top .navbar-inner, .navbar-fixed-bottom .navbar-inner { padding-left: 0; padding-right: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .navbar-fixed-top .container, .navbar-fixed-bottom .container { width: 940px; } .navbar-fixed-top { top: 0; } .navbar-fixed-bottom { bottom: 0; } .navbar .nav { position: relative; left: 0; display: block; float: left; margin: 0 10px 0 0; } .navbar .nav.pull-right { float: right; } .navbar .nav > li { display: block; float: left; } .navbar .nav > li > a { float: none; padding: 9px 10px 11px; line-height: 19px; color: #999999; text-decoration: none; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .navbar .btn { display: inline-block; padding: 4px 10px 4px; margin: 5px 5px 6px; line-height: 18px; } .navbar .btn-group { margin: 0; padding: 5px 5px 6px; } .navbar .nav > li > a:hover { background-color: transparent; color: #ffffff; text-decoration: none; } .navbar .nav .active > a, .navbar .nav .active > a:hover { color: #ffffff; text-decoration: none; background-color: #222222; } .navbar .divider-vertical { height: 40px; width: 1px; margin: 0 9px; overflow: hidden; background-color: #222222; border-right: 1px solid #333333; } .navbar .nav.pull-right { margin-left: 10px; margin-right: 0; } .navbar .btn-navbar { display: none; float: right; padding: 7px 10px; margin-left: 5px; margin-right: 5px; background-color: #2c2c2c; background-image: -moz-linear-gradient(top, #333333, #222222); background-image: -ms-linear-gradient(top, #333333, #222222); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222)); background-image: -webkit-linear-gradient(top, #333333, #222222); background-image: -o-linear-gradient(top, #333333, #222222); background-image: linear-gradient(top, #333333, #222222); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0); border-color: #222222 #222222 #000000; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); *background-color: #222222; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); -webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); -moz-box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075); } .navbar .btn-navbar:hover, .navbar .btn-navbar:active, .navbar .btn-navbar.active, .navbar .btn-navbar.disabled, .navbar .btn-navbar[disabled] { background-color: #222222; *background-color: #151515; } .navbar .btn-navbar:active, .navbar .btn-navbar.active { background-color: #080808 \9; } .navbar .btn-navbar .icon-bar { display: block; width: 18px; height: 2px; background-color: #f5f5f5; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); } .btn-navbar .icon-bar + .icon-bar { margin-top: 3px; } .navbar .dropdown-menu:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 9px; } .navbar .dropdown-menu:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; position: absolute; top: -6px; left: 10px; } .navbar-fixed-bottom .dropdown-menu:before { border-top: 7px solid #ccc; border-top-color: rgba(0, 0, 0, 0.2); border-bottom: 0; bottom: -7px; top: auto; } .navbar-fixed-bottom .dropdown-menu:after { border-top: 6px solid #ffffff; border-bottom: 0; bottom: -6px; top: auto; } .navbar .nav li.dropdown .dropdown-toggle .caret, .navbar .nav li.dropdown.open .caret { border-top-color: #ffffff; border-bottom-color: #ffffff; } .navbar .nav li.dropdown.active .caret { opacity: 1; filter: alpha(opacity=100); } .navbar .nav li.dropdown.open > .dropdown-toggle, .navbar .nav li.dropdown.active > .dropdown-toggle, .navbar .nav li.dropdown.open.active > .dropdown-toggle { background-color: transparent; } .navbar .nav li.dropdown.active > .dropdown-toggle:hover { color: #ffffff; } .navbar .pull-right .dropdown-menu, .navbar .dropdown-menu.pull-right { left: auto; right: 0; } .navbar .pull-right .dropdown-menu:before, .navbar .dropdown-menu.pull-right:before { left: auto; right: 12px; } .navbar .pull-right .dropdown-menu:after, .navbar .dropdown-menu.pull-right:after { left: auto; right: 13px; } .breadcrumb { padding: 7px 14px; margin: 0 0 18px; list-style: none; background-color: #fbfbfb; background-image: -moz-linear-gradient(top, #ffffff, #f5f5f5); background-image: -ms-linear-gradient(top, #ffffff, #f5f5f5); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5)); background-image: -webkit-linear-gradient(top, #ffffff, #f5f5f5); background-image: -o-linear-gradient(top, #ffffff, #f5f5f5); background-image: linear-gradient(top, #ffffff, #f5f5f5); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0); border: 1px solid #ddd; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: inset 0 1px 0 #ffffff; -moz-box-shadow: inset 0 1px 0 #ffffff; box-shadow: inset 0 1px 0 #ffffff; } .breadcrumb li { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; text-shadow: 0 1px 0 #ffffff; } .breadcrumb .divider { padding: 0 5px; color: #999999; } .breadcrumb .active a { color: #333333; } .pagination { height: 36px; margin: 18px 0; } .pagination ul { display: inline-block; *display: inline; /* IE7 inline-block hack */ *zoom: 1; margin-left: 0; margin-bottom: 0; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } .pagination li { display: inline; } .pagination a { float: left; padding: 0 14px; line-height: 34px; text-decoration: none; border: 1px solid #ddd; border-left-width: 0; } .pagination a:hover, .pagination .active a { background-color: #f5f5f5; } .pagination .active a { color: #999999; cursor: default; } .pagination .disabled span, .pagination .disabled a, .pagination .disabled a:hover { color: #999999; background-color: transparent; cursor: default; } .pagination li:first-child a { border-left-width: 1px; -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } .pagination li:last-child a { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } .pagination-centered { text-align: center; } .pagination-right { text-align: right; } .pager { margin-left: 0; margin-bottom: 18px; list-style: none; text-align: center; *zoom: 1; } .pager:before, .pager:after { display: table; content: ""; } .pager:after { clear: both; } .pager li { display: inline; } .pager a { display: inline-block; padding: 5px 14px; background-color: #fff; border: 1px solid #ddd; -webkit-border-radius: 15px; -moz-border-radius: 15px; border-radius: 15px; } .pager a:hover { text-decoration: none; background-color: #f5f5f5; } .pager .next a { float: right; } .pager .previous a { float: left; } .pager .disabled a, .pager .disabled a:hover { color: #999999; background-color: #fff; cursor: default; } .modal-open .dropdown-menu { z-index: 2050; } .modal-open .dropdown.open { *z-index: 2050; } .modal-open .popover { z-index: 2060; } .modal-open .tooltip { z-index: 2070; } .modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1040; background-color: #000000; } .modal-backdrop.fade { opacity: 0; } .modal-backdrop, .modal-backdrop.fade.in { opacity: 0.8; filter: alpha(opacity=80); } .modal { position: fixed; top: 50%; left: 50%; z-index: 1050; overflow: auto; width: 560px; margin: -250px 0 0 -280px; background-color: #ffffff; border: 1px solid #999; border: 1px solid rgba(0, 0, 0, 0.3); *border: 1px solid #999; /* IE6-7 */ -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; } .modal.fade { -webkit-transition: opacity .3s linear, top .3s ease-out; -moz-transition: opacity .3s linear, top .3s ease-out; -ms-transition: opacity .3s linear, top .3s ease-out; -o-transition: opacity .3s linear, top .3s ease-out; transition: opacity .3s linear, top .3s ease-out; top: -25%; } .modal.fade.in { top: 50%; } .modal-header { padding: 9px 15px; border-bottom: 1px solid #eee; } .modal-header .close { margin-top: 2px; } .modal-body { overflow-y: auto; max-height: 400px; padding: 15px; } .modal-form { margin-bottom: 0; } .modal-footer { padding: 14px 15px 15px; margin-bottom: 0; text-align: right; background-color: #f5f5f5; border-top: 1px solid #ddd; -webkit-border-radius: 0 0 6px 6px; -moz-border-radius: 0 0 6px 6px; border-radius: 0 0 6px 6px; -webkit-box-shadow: inset 0 1px 0 #ffffff; -moz-box-shadow: inset 0 1px 0 #ffffff; box-shadow: inset 0 1px 0 #ffffff; *zoom: 1; } .modal-footer:before, .modal-footer:after { display: table; content: ""; } .modal-footer:after { clear: both; } .modal-footer .btn + .btn { margin-left: 5px; margin-bottom: 0; } .modal-footer .btn-group .btn + .btn { margin-left: -1px; } .tooltip { position: absolute; z-index: 1020; display: block; visibility: visible; padding: 5px; font-size: 11px; opacity: 0; filter: alpha(opacity=0); } .tooltip.in { opacity: 0.8; filter: alpha(opacity=80); } .tooltip.top { margin-top: -2px; } .tooltip.right { margin-left: 2px; } .tooltip.bottom { margin-top: 2px; } .tooltip.left { margin-left: -2px; } .tooltip.top .tooltip-arrow { bottom: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #000000; } .tooltip.left .tooltip-arrow { top: 50%; right: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 5px solid #000000; } .tooltip.bottom .tooltip-arrow { top: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #000000; } .tooltip.right .tooltip-arrow { top: 50%; left: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 5px solid #000000; } .tooltip-inner { max-width: 200px; padding: 3px 8px; color: #ffffff; text-align: center; text-decoration: none; background-color: #000000; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .tooltip-arrow { position: absolute; width: 0; height: 0; } .popover { position: absolute; top: 0; left: 0; z-index: 1010; display: none; padding: 5px; } .popover.top { margin-top: -5px; } .popover.right { margin-left: 5px; } .popover.bottom { margin-top: 5px; } .popover.left { margin-left: -5px; } .popover.top .arrow { bottom: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid #000000; } .popover.right .arrow { top: 50%; left: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 5px solid #000000; } .popover.bottom .arrow { top: 0; left: 50%; margin-left: -5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid #000000; } .popover.left .arrow { top: 50%; right: 0; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 5px solid #000000; } .popover .arrow { position: absolute; width: 0; height: 0; } .popover-inner { padding: 3px; width: 280px; overflow: hidden; background: #000000; background: rgba(0, 0, 0, 0.8); -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); -moz-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); } .popover-title { padding: 9px 15px; line-height: 1; background-color: #f5f5f5; border-bottom: 1px solid #eee; -webkit-border-radius: 3px 3px 0 0; -moz-border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0; } .popover-content { padding: 14px; background-color: #ffffff; -webkit-border-radius: 0 0 3px 3px; -moz-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; } .popover-content p, .popover-content ul, .popover-content ol { margin-bottom: 0; } .thumbnails { margin-left: -20px; list-style: none; *zoom: 1; } .thumbnails:before, .thumbnails:after { display: table; content: ""; } .thumbnails:after { clear: both; } .row-fluid .thumbnails { margin-left: 0; } .thumbnails > li { float: left; margin-bottom: 18px; margin-left: 20px; } .thumbnail { display: block; padding: 4px; line-height: 1; border: 1px solid #ddd; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); } a.thumbnail:hover { border-color: #0088cc; -webkit-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); -moz-box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); box-shadow: 0 1px 4px rgba(0, 105, 214, 0.25); } .thumbnail > img { display: block; max-width: 100%; margin-left: auto; margin-right: auto; } .thumbnail .caption { padding: 9px; } .label, .badge { font-size: 10.998px; font-weight: bold; line-height: 14px; color: #ffffff; vertical-align: baseline; white-space: nowrap; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #999999; } .label { padding: 1px 4px 2px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .badge { padding: 1px 9px 2px; -webkit-border-radius: 9px; -moz-border-radius: 9px; border-radius: 9px; } a.label:hover, a.badge:hover { color: #ffffff; text-decoration: none; cursor: pointer; } .label-important, .badge-important { background-color: #b94a48; } .label-important[href], .badge-important[href] { background-color: #953b39; } .label-warning, .badge-warning { background-color: #f89406; } .label-warning[href], .badge-warning[href] { background-color: #c67605; } .label-success, .badge-success { background-color: #468847; } .label-success[href], .badge-success[href] { background-color: #356635; } .label-info, .badge-info { background-color: #3a87ad; } .label-info[href], .badge-info[href] { background-color: #2d6987; } .label-inverse, .badge-inverse { background-color: #333333; } .label-inverse[href], .badge-inverse[href] { background-color: #1a1a1a; } @-webkit-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-moz-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-ms-keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } @-o-keyframes progress-bar-stripes { from { background-position: 0 0; } to { background-position: 40px 0; } } @keyframes progress-bar-stripes { from { background-position: 40px 0; } to { background-position: 0 0; } } .progress { overflow: hidden; height: 18px; margin-bottom: 18px; background-color: #f7f7f7; background-image: -moz-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -ms-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9)); background-image: -webkit-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: -o-linear-gradient(top, #f5f5f5, #f9f9f9); background-image: linear-gradient(top, #f5f5f5, #f9f9f9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0); -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .progress .bar { width: 0%; height: 18px; color: #ffffff; font-size: 12px; text-align: center; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #0e90d2; background-image: -moz-linear-gradient(top, #149bdf, #0480be); background-image: -ms-linear-gradient(top, #149bdf, #0480be); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be)); background-image: -webkit-linear-gradient(top, #149bdf, #0480be); background-image: -o-linear-gradient(top, #149bdf, #0480be); background-image: linear-gradient(top, #149bdf, #0480be); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0); -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15); -moz-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-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; -webkit-transition: width 0.6s ease; -moz-transition: width 0.6s ease; -ms-transition: width 0.6s ease; -o-transition: width 0.6s ease; transition: width 0.6s ease; } .progress-striped .bar { background-color: #149bdf; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); 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: -moz-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: -ms-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); -webkit-background-size: 40px 40px; -moz-background-size: 40px 40px; -o-background-size: 40px 40px; background-size: 40px 40px; } .progress.active .bar { -webkit-animation: progress-bar-stripes 2s linear infinite; -moz-animation: progress-bar-stripes 2s linear infinite; -ms-animation: progress-bar-stripes 2s linear infinite; -o-animation: progress-bar-stripes 2s linear infinite; animation: progress-bar-stripes 2s linear infinite; } .progress-danger .bar { background-color: #dd514c; background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35); background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35)); background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35); background-image: -o-linear-gradient(top, #ee5f5b, #c43c35); background-image: linear-gradient(top, #ee5f5b, #c43c35); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0); } .progress-danger.progress-striped .bar { background-color: #ee5f5b; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); 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: -moz-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: -ms-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-success .bar { background-color: #5eb95e; background-image: -moz-linear-gradient(top, #62c462, #57a957); background-image: -ms-linear-gradient(top, #62c462, #57a957); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957)); background-image: -webkit-linear-gradient(top, #62c462, #57a957); background-image: -o-linear-gradient(top, #62c462, #57a957); background-image: linear-gradient(top, #62c462, #57a957); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0); } .progress-success.progress-striped .bar { background-color: #62c462; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); 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: -moz-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: -ms-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-info .bar { background-color: #4bb1cf; background-image: -moz-linear-gradient(top, #5bc0de, #339bb9); background-image: -ms-linear-gradient(top, #5bc0de, #339bb9); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9)); background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9); background-image: -o-linear-gradient(top, #5bc0de, #339bb9); background-image: linear-gradient(top, #5bc0de, #339bb9); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0); } .progress-info.progress-striped .bar { background-color: #5bc0de; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); 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: -moz-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: -ms-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-warning .bar { background-color: #faa732; background-image: -moz-linear-gradient(top, #fbb450, #f89406); background-image: -ms-linear-gradient(top, #fbb450, #f89406); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406)); background-image: -webkit-linear-gradient(top, #fbb450, #f89406); background-image: -o-linear-gradient(top, #fbb450, #f89406); background-image: linear-gradient(top, #fbb450, #f89406); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0); } .progress-warning.progress-striped .bar { background-color: #fbb450; background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent)); 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: -moz-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: -ms-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); } .accordion { margin-bottom: 18px; } .accordion-group { margin-bottom: 2px; border: 1px solid #e5e5e5; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .accordion-heading { border-bottom: 0; } .accordion-heading .accordion-toggle { display: block; padding: 8px 15px; } .accordion-toggle { cursor: pointer; } .accordion-inner { padding: 9px 15px; border-top: 1px solid #e5e5e5; } .carousel { position: relative; margin-bottom: 18px; line-height: 1; } .carousel-inner { overflow: hidden; width: 100%; position: relative; } .carousel .item { display: none; position: relative; -webkit-transition: 0.6s ease-in-out left; -moz-transition: 0.6s ease-in-out left; -ms-transition: 0.6s ease-in-out left; -o-transition: 0.6s ease-in-out left; transition: 0.6s ease-in-out left; } .carousel .item > img { display: block; line-height: 1; } .carousel .active, .carousel .next, .carousel .prev { display: block; } .carousel .active { left: 0; } .carousel .next, .carousel .prev { position: absolute; top: 0; width: 100%; } .carousel .next { left: 100%; } .carousel .prev { left: -100%; } .carousel .next.left, .carousel .prev.right { left: 0; } .carousel .active.left { left: -100%; } .carousel .active.right { left: 100%; } .carousel-control { position: absolute; top: 40%; left: 15px; width: 40px; height: 40px; margin-top: -20px; font-size: 60px; font-weight: 100; line-height: 30px; color: #ffffff; text-align: center; background: #222222; border: 3px solid #ffffff; -webkit-border-radius: 23px; -moz-border-radius: 23px; border-radius: 23px; opacity: 0.5; filter: alpha(opacity=50); } .carousel-control.right { left: auto; right: 15px; } .carousel-control:hover { color: #ffffff; text-decoration: none; opacity: 0.9; filter: alpha(opacity=90); } .carousel-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 15px 5px; background: #333333; background: rgba(0, 0, 0, 0.75); } .carousel-caption h4, .carousel-caption p { color: #ffffff; } .hero-unit { padding: 60px; margin-bottom: 30px; background-color: #eeeeee; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px; } .hero-unit h1 { margin-bottom: 0; font-size: 60px; line-height: 1; color: inherit; letter-spacing: -1px; } .hero-unit p { font-size: 18px; font-weight: 200; line-height: 27px; color: inherit; } .pull-right { float: right; } .pull-left { float: left; } .hide { display: none; } .show { display: block; } .invisible { visibility: hidden; }
psd401/psd-computer-management
app/styles/bootstrap.css
CSS
mit
97,558
22.378624
304
0.675629
false
<?php declare(strict_types=1); namespace OAuth2Framework\Tests\Component\ClientRule; use InvalidArgumentException; use OAuth2Framework\Component\ClientRule\ApplicationTypeParametersRule; use OAuth2Framework\Component\ClientRule\RuleHandler; use OAuth2Framework\Component\Core\Client\ClientId; use OAuth2Framework\Component\Core\DataBag\DataBag; use OAuth2Framework\Tests\Component\OAuth2TestCase; /** * @internal */ final class ApplicationTypeParameterRuleTest extends OAuth2TestCase { /** * @test */ public function applicationTypeParameterRuleSetAsDefault(): void { $clientId = ClientId::create('CLIENT_ID'); $commandParameters = DataBag::create([]); $rule = new ApplicationTypeParametersRule(); $validatedParameters = $rule->handle($clientId, $commandParameters, DataBag::create([]), $this->getCallable()); static::assertTrue($validatedParameters->has('application_type')); static::assertSame('web', $validatedParameters->get('application_type')); } /** * @test */ public function applicationTypeParameterRuleDefineInParameters(): void { $clientId = ClientId::create('CLIENT_ID'); $commandParameters = DataBag::create([ 'application_type' => 'native', ]); $rule = new ApplicationTypeParametersRule(); $validatedParameters = $rule->handle($clientId, $commandParameters, DataBag::create([]), $this->getCallable()); static::assertTrue($validatedParameters->has('application_type')); static::assertSame('native', $validatedParameters->get('application_type')); } /** * @test */ public function applicationTypeParameterRule(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('The parameter "application_type" must be either "native" or "web".'); $clientId = ClientId::create('CLIENT_ID'); $commandParameters = DataBag::create([ 'application_type' => 'foo', ]); $rule = new ApplicationTypeParametersRule(); $rule->handle($clientId, $commandParameters, DataBag::create([]), $this->getCallable()); } private function getCallable(): RuleHandler { return new RuleHandler(function ( ClientId $clientId, DataBag $commandParameters, DataBag $validatedParameters ): DataBag { return $validatedParameters; }); } }
OAuth2-Framework/oauth2-framework
tests/Component/ClientRule/ApplicationTypeParameterRuleTest.php
PHP
mit
2,505
32.851351
119
0.662675
false
function countBs(string) { return countChar(string, "B"); } function countChar(string, ch) { var counted = 0; for (var i = 0; i < string.length; i++) { if (string.charAt(i) == ch) counted += 1; } return counted; } console.log(countBs("BBC")); // -> 2 console.log(countChar("kakkerlak", "k")); // -> 4
jdhunterae/eloquent_js
ch03/su03-bean_counting.js
JavaScript
mit
343
19.176471
45
0.553936
false
// dvt /* 1. Да се напише if-конструкция, * която изчислява стойността на две целочислени променливи и * разменя техните стойности, * ако стойността на първата променлива е по-голяма от втората. */ package myJava; import java.util.Scanner; public class dvt { public static void main(String[] args) { Scanner read = new Scanner(System.in); int a, b, temp; System.out.print("a = "); a = read.nextInt(); System.out.print("b = "); b = read.nextInt(); if (a > b){ temp = a; a = b; b = temp; System.out.println( "a > b! The values have been switched!\n" + "a = " + a + " b = " + b); } } }
dvt32/cpp-journey
Java/Unsorted/21.05.2015.14.36.java
Java
mit
793
18
63
0.595975
false
#!/usr/bin/env bash PYTHONPATH=. DJANGO_SETTINGS_MODULE=sampleproject.settings py.test --create-db
RealGeeks/django-cache-purge-hooks
runtests.sh
Shell
mit
99
48.5
78
0.787879
false
// // DYMEPubChapterFile.h // DYMEpubToPlistConverter // // Created by Dong Yiming on 15/11/13. // Copyright © 2015年 Dong Yiming. All rights reserved. // #import <Foundation/Foundation.h> @interface DYMEPubChapterFile : NSObject @property (nonatomic, copy) NSString *chapterID; @property (nonatomic, copy) NSString *href; @property (nonatomic, copy) NSString *mediaType; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *content; @end
dymx101/DYMEpubToPlistConverter
DYMEpubToPlistConverter/DYMEpubToPlistConverter/DYMEPubChapterFile.h
C
mit
477
26.882353
55
0.746835
false
/* * Copyright (c) André Bargull * Alle Rechte vorbehalten / All Rights Reserved. Use is subject to license terms. * * <https://github.com/anba/es6draft> */ /*--- id: sec-function-calls-runtime-semantics-evaluation info: Check TypeError is thrown from correct realm with tco-call to class constructor from class [[Construct]] invocation. description: > 12.3.4.3 Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments, tailPosition ) ... 4. If tailPosition is true, perform PrepareForTailCall(). 5. Let result be Call(func, thisValue, argList). 6. Assert: If tailPosition is true, the above call will not return here, but instead evaluation will continue as if the following return has already occurred. 7. Assert: If result is not an abrupt completion, then Type(result) is an ECMAScript language type. 8. Return result. 9.2.1 [[Call]] ( thisArgument, argumentsList) ... 2. If F.[[FunctionKind]] is "classConstructor", throw a TypeError exception. 3. Let callerContext be the running execution context. 4. Let calleeContext be PrepareForOrdinaryCall(F, undefined). 5. Assert: calleeContext is now the running execution context. ... features: [tail-call-optimization, class] ---*/ // - The class constructor call is in a valid tail-call position, which means PrepareForTailCall is performed. // - The function call returns from `otherRealm` and proceeds the tail-call in this realm. // - Calling the class constructor throws a TypeError from the current realm, that means this realm and not `otherRealm`. var code = "(class { constructor() { return (class {})(); } });"; var otherRealm = $262.createRealm(); var tco = otherRealm.evalScript(code); assert.throws(TypeError, function() { new tco(); });
anba/es6draft
src/test/scripts/suite262/language/expressions/call/tco-cross-realm-class-construct.js
JavaScript
mit
1,776
43.375
162
0.725634
false
package com.rootulp.rootulpjsona; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.AsyncTask; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.widget.ImageView; import java.io.InputStream; public class picPage extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_pic_page); Intent local = getIntent(); Bundle localBundle = local.getExtras(); artist selected = (artist) localBundle.getSerializable("selected"); String imageURL = selected.getImageURL(); new DownloadImageTask((ImageView) findViewById(R.id.painting)).execute(imageURL); } private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> { ImageView bmImage; public DownloadImageTask(ImageView bmImage) { this.bmImage = bmImage; } protected Bitmap doInBackground(String... urls) { String urldisplay = urls[0]; Bitmap mIcon11 = null; try { InputStream in = new java.net.URL(urldisplay).openStream(); mIcon11 = BitmapFactory.decodeStream(in); } catch (Exception e) { Log.e("Error", e.getMessage()); e.printStackTrace(); } return mIcon11; } protected void onPostExecute(Bitmap result) { bmImage.setImageBitmap(result); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_pic_page, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }
rootulp/school
mobile_apps/assignment6_rootulp/RootulpJsonA/app/src/main/java/com/rootulp/rootulpjsona/picPage.java
Java
mit
2,172
30.028571
89
0.645948
false
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace GameBuilder.BuilderControl { /// <summary> /// Interaction logic for ResourcesSelector.xaml /// </summary> public partial class ResourcesBuilder : UserControl { public string Header { get { return ResourcesBox.Header.ToString(); } set { ResourcesBox.Header = value; } } public ResourcesBuilder() { InitializeComponent(); } } }
bruno-cadorette/IFT232Projet
GameBuilder/BuilderControl/ResourcesControl.xaml.cs
C#
mit
911
22.307692
55
0.625963
false
<?php declare(strict_types=1); namespace JDWil\Xsd\Event; /** * Class FoundAnyAttributeEvent * @package JDWil\Xsd\Event */ class FoundAnyAttributeEvent extends AbstractXsdNodeEvent { }
jdwil/xsd-tool
src/Event/FoundAnyAttributeEvent.php
PHP
mit
190
13.692308
57
0.763158
false
# Copyright (c) 2008-2013 Michael Dvorkin and contributors. # # Fat Free CRM is freely distributable under the terms of MIT license. # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------ # == Schema Information # # Table name: avatars # # id :integer not null, primary key # user_id :integer # entity_id :integer # entity_type :string(255) # image_file_size :integer # image_file_name :string(255) # image_content_type :string(255) # created_at :datetime # updated_at :datetime # class FatFreeCRM::Avatar < ActiveRecord::Base STYLES = { large: "75x75#", medium: "50x50#", small: "25x25#", thumb: "16x16#" }.freeze belongs_to :user belongs_to :entity, polymorphic: true, class_name: 'FatFreeCRM::Entity' # We want to store avatars in separate directories based on entity type # (i.e. /avatar/User/, /avatars/Lead/, etc.), so we are adding :entity_type # interpolation to the Paperclip::Interpolations module. Also, Paperclip # doesn't seem to care preserving styles hash so we must use STYLES.dup. #---------------------------------------------------------------------------- Paperclip::Interpolations.module_eval do def entity_type(attachment, _style_name = nil) attachment.instance.entity_type end end has_attached_file :image, styles: STYLES.dup, url: "/avatars/:entity_type/:id/:style_:filename", default_url: "/assets/avatar.jpg" validates_attachment :image, presence: true, content_type: { content_type: %w(image/jpeg image/jpg image/png image/gif) } # Convert STYLE symbols to 'w x h' format for Gravatar and Rails # e.g. Avatar.size_from_style(:size => :large) -> '75x75' # Allow options to contain :width and :height override keys #---------------------------------------------------------------------------- def self.size_from_style!(options) if options[:width] && options[:height] options[:size] = [:width, :height].map { |d| options[d] }.join("x") elsif FatFreeCRM::Avatar::STYLES.keys.include?(options[:size]) options[:size] = FatFreeCRM::Avatar::STYLES[options[:size]].sub(/\#\z/, '') end options end ActiveSupport.run_load_hooks(:fat_free_crm_avatar, self) end
fkoessler/fat_free_crm
app/models/polymorphic/fat_free_crm/avatar.rb
Ruby
mit
2,377
42.218182
132
0.599074
false
// Copyright (c) 2015 Elements of Programming Interviews. All rights reserved. package com.epi; import java.util.Random; public class RabinKarp { // @include // Returns the index of the first character of the substring if found, -1 // otherwise. public static int rabinKarp(String t, String s) { if (s.length() > t.length()) { return -1; // s is not a substring of t. } final int BASE = 26; int tHash = 0, sHash = 0; // Hash codes for the substring of t and s. int powerS = 1; // BASE^|s|. for (int i = 0; i < s.length(); i++) { powerS = i > 0 ? powerS * BASE : 1; tHash = tHash * BASE + t.charAt(i); sHash = sHash * BASE + s.charAt(i); } for (int i = s.length(); i < t.length(); i++) { // Checks the two substrings are actually equal or not, to protect // against hash collision. if (tHash == sHash && t.substring(i - s.length(), i).equals(s)) { return i - s.length(); // Found a match. } // Uses rolling hash to compute the new hash code. tHash -= t.charAt(i - s.length()) * powerS; tHash = tHash * BASE + t.charAt(i); } // Tries to match s and t.substring(t.length() - s.length()). if (tHash == sHash && t.substring(t.length() - s.length()).equals(s)) { return t.length() - s.length(); } return -1; // s is not a substring of t. } // @exclude private static int checkAnswer(String t, String s) { for (int i = 0; i + s.length() - 1 < t.length(); ++i) { boolean find = true; for (int j = 0; j < s.length(); ++j) { if (t.charAt(i + j) != s.charAt(j)) { find = false; break; } } if (find) { return i; } } return -1; // No matching. } private static String randString(int len) { Random r = new Random(); StringBuilder ret = new StringBuilder(len); while (len-- > 0) { ret.append((char)(r.nextInt(26) + 'a')); } return ret.toString(); } private static void smallTest() { assert(rabinKarp("GACGCCA", "CGC") == 2); assert(rabinKarp("GATACCCATCGAGTCGGATCGAGT", "GAG") == 10); assert(rabinKarp("FOOBARWIDGET", "WIDGETS") == -1); assert(rabinKarp("A", "A") == 0); assert(rabinKarp("A", "B") == -1); assert(rabinKarp("A", "") == 0); assert(rabinKarp("ADSADA", "") == 0); assert(rabinKarp("", "A") == -1); assert(rabinKarp("", "AAA") == -1); assert(rabinKarp("A", "AAA") == -1); assert(rabinKarp("AA", "AAA") == -1); assert(rabinKarp("AAA", "AAA") == 0); assert(rabinKarp("BAAAA", "AAA") == 1); assert(rabinKarp("BAAABAAAA", "AAA") == 1); assert(rabinKarp("BAABBAABAAABS", "AAA") == 8); assert(rabinKarp("BAABBAABAAABS", "AAAA") == -1); assert(rabinKarp("FOOBAR", "BAR") > 0); } public static void main(String args[]) { smallTest(); if (args.length == 2) { String t = args[0]; String s = args[1]; System.out.println("t = " + t); System.out.println("s = " + s); assert(checkAnswer(t, s) == rabinKarp(t, s)); } else { Random r = new Random(); for (int times = 0; times < 10000; ++times) { String t = randString(r.nextInt(1000) + 1); String s = randString(r.nextInt(20) + 1); System.out.println("t = " + t); System.out.println("s = " + s); assert(checkAnswer(t, s) == rabinKarp(t, s)); } } } }
adnanaziz/epicode
java/src/main/java/com/epi/RabinKarp.java
Java
mit
3,435
30.805556
78
0.541194
false
using System; using System.Collections.Generic; using Sekhmet.Serialization.Utility; namespace Sekhmet.Serialization { public class CachingObjectContextFactory : IObjectContextFactory { private readonly IInstantiator _instantiator; private readonly ReadWriteLock _lock = new ReadWriteLock(); private readonly IDictionary<Type, ObjectContextInfo> _mapActualTypeToContextInfo = new Dictionary<Type, ObjectContextInfo>(); private readonly IObjectContextInfoFactory _objectContextInfoFactory; private readonly IObjectContextFactory _recursionFactory; public CachingObjectContextFactory(IInstantiator instantiator, IObjectContextInfoFactory objectContextInfoFactory, IObjectContextFactory recursionFactory) { if (instantiator == null) throw new ArgumentNullException("instantiator"); if (objectContextInfoFactory == null) throw new ArgumentNullException("objectContextInfoFactory"); if (recursionFactory == null) throw new ArgumentNullException("recursionFactory"); _instantiator = instantiator; _objectContextInfoFactory = objectContextInfoFactory; _recursionFactory = recursionFactory; } public IObjectContext CreateForDeserialization(IMemberContext targetMember, Type targetType, IAdviceRequester adviceRequester) { ObjectContextInfo contextInfo = GetContextInfo(targetType, adviceRequester); object target = _instantiator.Create(targetType, adviceRequester); if (target == null) throw new ArgumentException("Unable to create instance of '" + targetType + "' for member '" + targetMember + "'."); return contextInfo.CreateFor(target); } public IObjectContext CreateForSerialization(IMemberContext sourceMember, object source, IAdviceRequester adviceRequester) { if (source == null) return null; ObjectContextInfo contextInfo = GetContextInfo(source.GetType(), adviceRequester); return contextInfo.CreateFor(source); } private ObjectContextInfo CreateContextInfo(Type actualType, IAdviceRequester adviceRequester) { return _objectContextInfoFactory.Create(_recursionFactory, actualType, adviceRequester); } private ObjectContextInfo GetContextInfo(Type actualType, IAdviceRequester adviceRequester) { ObjectContextInfo contextInfo; using (_lock.EnterReadScope()) _mapActualTypeToContextInfo.TryGetValue(actualType, out contextInfo); if (contextInfo == null) { using (_lock.EnterWriteScope()) { if (!_mapActualTypeToContextInfo.TryGetValue(actualType, out contextInfo)) _mapActualTypeToContextInfo[actualType] = contextInfo = CreateContextInfo(actualType, adviceRequester); } } return contextInfo; } } }
kimbirkelund/SekhmetSerialization
trunk/src/Sekhmet.Serialization/CachingObjectContextFactory.cs
C#
mit
3,112
41.643836
162
0.672237
false
require "rails_helper" RSpec.describe DiagnosesController, type: :routing do describe "routing" do it "routes to #index" do expect(:get => "/diagnoses").to route_to("diagnoses#index") end it "routes to #new" do expect(:get => "/diagnoses/new").to route_to("diagnoses#new") end it "routes to #show" do expect(:get => "/diagnoses/1").to route_to("diagnoses#show", :id => "1") end it "routes to #edit" do expect(:get => "/diagnoses/1/edit").to route_to("diagnoses#edit", :id => "1") end it "routes to #create" do expect(:post => "/diagnoses").to route_to("diagnoses#create") end it "routes to #update via PUT" do expect(:put => "/diagnoses/1").to route_to("diagnoses#update", :id => "1") end it "routes to #update via PATCH" do expect(:patch => "/diagnoses/1").to route_to("diagnoses#update", :id => "1") end it "routes to #destroy" do expect(:delete => "/diagnoses/1").to route_to("diagnoses#destroy", :id => "1") end end end
KarlHeitmann/Programa-Clinico
spec/routing/diagnoses_routing_spec.rb
Ruby
mit
1,050
25.923077
84
0.593333
false
__global__ void /*{kernel_name}*/(/*{parameters}*/) { int _tid_ = threadIdx.x + blockIdx.x * blockDim.x; if (_tid_ < /*{num_threads}*/) { /*{execution}*/ _result_[_tid_] = /*{block_invocation}*/; } }
prg-titech/ikra-ruby
lib/resources/cuda/kernel.cpp
C++
mit
238
14.866667
54
0.470588
false
<?php /* * This file is part of the puli/manager package. * * (c) Bernhard Schussek <bschussek@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Puli\Manager\Tests\Api\Package; use Exception; use PHPUnit_Framework_TestCase; use Puli\Manager\Api\Environment; use Puli\Manager\Api\Package\InstallInfo; use Puli\Manager\Api\Package\Package; use Puli\Manager\Api\Package\PackageFile; use Puli\Manager\Api\Package\PackageState; use RuntimeException; use Webmozart\Expression\Expr; /** * @since 1.0 * * @author Bernhard Schussek <bschussek@gmail.com> */ class PackageTest extends PHPUnit_Framework_TestCase { public function testUsePackageNameFromPackageFile() { $packageFile = new PackageFile('vendor/name'); $package = new Package($packageFile, '/path'); $this->assertSame('vendor/name', $package->getName()); } public function testUsePackageNameFromInstallInfo() { $packageFile = new PackageFile(); $installInfo = new InstallInfo('vendor/name', '/path'); $package = new Package($packageFile, '/path', $installInfo); $this->assertSame('vendor/name', $package->getName()); } public function testPreferPackageNameFromInstallInfo() { $packageFile = new PackageFile('vendor/package-file'); $installInfo = new InstallInfo('vendor/install-info', '/path'); $package = new Package($packageFile, '/path', $installInfo); $this->assertSame('vendor/install-info', $package->getName()); } public function testNameIsNullIfNoneSetAndNoInstallInfoGiven() { $packageFile = new PackageFile(); $package = new Package($packageFile, '/path'); $this->assertNull($package->getName()); } public function testEnabledIfFound() { $packageFile = new PackageFile('vendor/name'); $package = new Package($packageFile, __DIR__); $this->assertSame(PackageState::ENABLED, $package->getState()); } public function testNotFoundIfNotFound() { $packageFile = new PackageFile('vendor/name'); $package = new Package($packageFile, __DIR__.'/foobar'); $this->assertSame(PackageState::NOT_FOUND, $package->getState()); } public function testNotLoadableIfLoadErrors() { $packageFile = new PackageFile('vendor/name'); $package = new Package($packageFile, __DIR__, null, array( new RuntimeException('Could not load package'), )); $this->assertSame(PackageState::NOT_LOADABLE, $package->getState()); } public function testCreatePackageWithoutPackageFileNorInstallInfo() { $package = new Package(null, '/path', null, array(new Exception())); $this->assertNull($package->getName()); } public function testMatch() { $packageFile = new PackageFile('vendor/name'); $package = new Package($packageFile, __DIR__); $this->assertFalse($package->match(Expr::same('foobar', Package::NAME))); $this->assertTrue($package->match(Expr::same('vendor/name', Package::NAME))); $this->assertFalse($package->match(Expr::same('/path/foo', Package::INSTALL_PATH))); $this->assertTrue($package->match(Expr::same(__DIR__, Package::INSTALL_PATH))); $this->assertFalse($package->match(Expr::same(PackageState::NOT_LOADABLE, Package::STATE))); $this->assertTrue($package->match(Expr::same(PackageState::ENABLED, Package::STATE))); $this->assertFalse($package->match(Expr::same('webmozart', Package::INSTALLER))); // Packages without install info (= the root package) are assumed to be // installed in the production environment $this->assertTrue($package->match(Expr::same(Environment::PROD, Package::ENVIRONMENT))); $installInfo = new InstallInfo('vendor/install-info', '/path'); $installInfo->setInstallerName('webmozart'); $packageWithInstallInfo = new Package($packageFile, __DIR__, $installInfo); $this->assertFalse($packageWithInstallInfo->match(Expr::same('foobar', Package::INSTALLER))); $this->assertTrue($packageWithInstallInfo->match(Expr::same('webmozart', Package::INSTALLER))); $this->assertTrue($packageWithInstallInfo->match(Expr::notsame(Environment::DEV, Package::ENVIRONMENT))); $installInfo2 = new InstallInfo('vendor/install-info', '/path'); $installInfo2->setEnvironment(Environment::DEV); $packageWithInstallInfo2 = new Package($packageFile, __DIR__, $installInfo2); $this->assertTrue($packageWithInstallInfo2->match(Expr::same(Environment::DEV, Package::ENVIRONMENT))); } }
kormik/manager
tests/Api/Package/PackageTest.php
PHP
mit
4,765
35.374046
113
0.665058
false
#!/usr/bin/env python2.7 import sys for line in open(sys.argv[1]): cut=line.split('\t') if len(cut)<11: continue print ">"+cut[0] print cut[9] print "+" print cut[10]
ursky/metaWRAP
bin/metawrap-scripts/sam_to_fastq.py
Python
mit
173
18.222222
30
0.641618
false
#ifndef __CXXU_TYPE_TRAITS_H__ #define __CXXU_TYPE_TRAITS_H__ #include <type_traits> #include <memory> namespace cxxu { template <typename T> struct is_shared_ptr_helper : std::false_type { typedef T element_type; static element_type& deref(element_type& e) { return e; } static const element_type& deref(const element_type& e) { return e; } }; template <typename T> struct is_shared_ptr_helper<std::shared_ptr<T>> : std::true_type { typedef typename std::remove_cv<T>::type element_type; typedef std::shared_ptr<element_type> ptr_type; static element_type& deref(ptr_type& p) { return *p; } static const element_type& deref(const ptr_type& p) { return *p; } }; template <typename T> struct is_shared_ptr : is_shared_ptr_helper<typename std::remove_cv<T>::type> {}; } // namespace cxxu #endif // __CXXU_TYPE_TRAITS_H__
ExpandiumSAS/cxxutils
sources/include/cxxu/cxxu/type_traits.hpp
C++
mit
890
18.777778
64
0.655056
false
package by.itransition.dpm.service; import by.itransition.dpm.dao.BookDao; import by.itransition.dpm.dao.UserDao; import by.itransition.dpm.entity.Book; import by.itransition.dpm.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; @Service public class BookService { @Autowired private BookDao bookDao; @Autowired private UserDao userDao; @Autowired private UserService userService; public void setBookDao(BookDao bookDao) { this.bookDao = bookDao; } public void setUserDao(UserDao userDao) { this.userDao = userDao; } @Transactional public void addBook(Book book){ Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); String name = authentication.getName(); User user = userDao.getUserByLogin(name); book.setUser(user); bookDao.saveBook(book); userService.addBook(user, book); } @Transactional public List<Book> getAllBooks() { return bookDao.getAllBooks(); } @Transactional public List<Book> getUserBooks(User user) { return user.getBooks(); } @Transactional public void deleteBookById(Integer id) { bookDao.deleteBookById(id); } @Transactional public Book getBookById (Integer id){ return bookDao.getBookById(id); } }
AndreiBiruk/DPM
src/main/java/by/itransition/dpm/service/BookService.java
Java
mit
1,653
24.828125
95
0.712644
false
<scri <!DOCTYPE html> <html lang="fr" itemscope="" itemtype="http://schema.org/Blog"> <head> <script> if (window.parent !== window) { if (typeof btoa !== "function") { window.btoa = function (input) { var str = String(input); for (var block, charCode, idx = 0, map = chars, output = ''; str.charAt(idx | 0) || (map = '=', idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { charCode = str.charCodeAt(idx += 3/4) block = block << 8 | charCode } return output } } var re = /^(?:https?:)?(?:\/\/)?([^\/\?]+)/i var res = re.exec(document.referrer) var domain = res[1] var forbidden = ["aGVsbG8ubGFuZA==","Y3Vpc2luZS5sYW5k","cmVjZXR0ZS5sYW5k","cmVjZXR0ZXMubGFuZA==",] if (forbidden.indexOf(btoa(domain)) > -1) { document.location = document.location.origin + "/system/noframed" } } </script> <link rel="stylesheet" href="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/css/ob-style.css?v2.39.3.0" /> <link rel="stylesheet" href="//assets.over-blog-kiwi.com/b/blog/build/soundplayer.2940b52.css" /> <!-- Forked theme from id 60 - last modified : 2017-02-23T08:01:21+01:00 --> <!-- shortcut:[Meta] --> <!-- title --> <!-- Title --> <title>333 - Le Site dont vous êtes le Héros</title> <!-- metas description, keyword, robots --> <!-- Metas --> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width"> <meta name="author" content="" /> <meta property="og:site_name" content="Le&#x20;Site&#x20;dont&#x20;vous&#x20;&#x00EA;tes&#x20;le&#x20;H&#x00E9;ros" /> <meta property="og:title" content="333&#x20;-&#x20;Le&#x20;Site&#x20;dont&#x20;vous&#x20;&#x00EA;tes&#x20;le&#x20;H&#x00E9;ros" /> <meta name="twitter:title" content="333&#x20;-&#x20;Le&#x20;Site&#x20;dont&#x20;vous&#x20;&#x00EA;tes&#x20;le&#x20;H&#x00E9;ros" /> <meta name="description" content="Une&#x20;fois&#x20;la&#x20;flamme&#x20;de&#x20;la&#x20;bougie&#x20;souffl&#x00E9;e,&#x20;vous&#x20;essayez&#x20;de&#x20;vous&#x20;glisser&#x20;avec&#x20;d&#x00E9;lectation&#x20;dans&#x20;les&#x20;bras&#x20;de&#x20;Morph&#x00E9;e.&#x20;Mais&#x20;vous&#x20;n&#x27;&#x00EA;tes&#x20;pas&#x20;couch&#x00E9;&#x20;depuis&#x20;cinq&#x20;minutes&#x20;qu&#x27;un&#x20;grattement&#x20;furtif&#x20;vous&#x20;parvient&#x20;du&#x20;palier.&#x20;A&#x20;demi&#x20;plong&#x00E9;&#x20;dans&#x20;le&#x20;sommeil,&#x20;vous&#x20;ne&#x20;savez..." /> <meta property="og:description" content="Une&#x20;fois&#x20;la&#x20;flamme&#x20;de&#x20;la&#x20;bougie&#x20;souffl&#x00E9;e,&#x20;vous&#x20;essayez&#x20;de&#x20;vous&#x20;glisser&#x20;avec&#x20;d&#x00E9;lectation&#x20;dans&#x20;les&#x20;bras&#x20;de&#x20;Morph&#x00E9;e.&#x20;Mais&#x20;vous&#x20;n&#x27;&#x00EA;tes&#x20;pas&#x20;couch&#x00E9;&#x20;depuis&#x20;cinq&#x20;minutes&#x20;qu&#x27;un&#x20;grattement&#x20;furtif&#x20;vous&#x20;parvient&#x20;du&#x20;palier.&#x20;A&#x20;demi&#x20;plong&#x00E9;&#x20;dans&#x20;le&#x20;sommeil,&#x20;vous&#x20;ne&#x20;savez..." /> <meta name="twitter:description" content="Une&#x20;fois&#x20;la&#x20;flamme&#x20;de&#x20;la&#x20;bougie&#x20;souffl&#x00E9;e,&#x20;vous&#x20;essayez&#x20;de&#x20;vous&#x20;glisser&#x20;avec&#x20;d&#x00E9;lectation&#x20;dans&#x20;les&#x20;bras&#x20;de&#x20;Morph&#x00E9;e.&#x20;Mais&#x20;vous&#x20;n&#x27;&#x00EA;tes&#x20;pas&#x20;couch&#x00E9;&#x20;depuis&#x20;cinq&#x20;minutes&#x20;qu&#x27;un&#x20;grattement&#x20;furtif&#x20;vous&#x20;parvient&#x20;du..." /> <meta property="og:locale" content="fr_FR" /> <meta property="og:url" content="http://lesitedontvousetesleheros.overblog.com/333-70" /> <meta name="twitter:url" content="http://lesitedontvousetesleheros.overblog.com/333-70" /> <meta property="og:type" content="article" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:site" content="@overblog" /> <meta name="twitter:creator" content="@" /> <meta property="fb:app_id" content="284865384904712" /> <!-- Robots --> <meta name="robots" content="index,follow" /> <!-- RSS --> <link rel="alternate" type="application/rss+xml" title="RSS" href="/rss" /> <!-- Analytics --> <!-- shortcut:[Options] --> </script>ll" group="shares" /> <!-- shortcut:[Includes] --> <!-- favicon --> <!-- Metas --> <link rel="shortcut icon" type="image/x-icon" href="http://fdata.over-blog.net/99/00/00/01/img/favicon.ico" /> <link rel="icon" type="image/png" href="http://fdata.over-blog.net/99/00/00/01/img/favicon.png" /> <link rel="apple-touch-icon" href="http://fdata.over-blog.net/99/00/00/01/img/mobile-favicon.png" /> <!-- SEO --> <!-- includes --> <link rel="alternate" type="application/rss+xml" title="RSS" href="/rss" /> <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link href='http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700' rel='stylesheet' type='text/css'> <!-- Fonts --> <link href='http://fonts.googleapis.com/css?family=Carter+One' rel='stylesheet' type='text/css'> <!-- Fancybox --> <link rel="stylesheet" type="text/css" href="http://assets.over-blog-kiwi.com/themes/jquery/fancybox/jquery.fancybox-1.3.4.css" media="screen" /> <style type="text/css"> /*** RESET ***/ .clearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;} .clearfix {display: inline-block;} /* Hides from IE-mac \*/ * html .clearfix {height: 1%;} .clearfix {display: block;} * {margin:0; padding:0;} body {background-color: #000; color: #fff; font-family: 'PT Sans Caption', sans-serif; font-size: 12px;} a {text-decoration: none;} h1, h2, h3, h4, h5, h6 { font-weight:normal;} img {border:none;} .box li {list-style:none;} #cl_1_0 ul, #cl_1_0 ol {margin-left: 0; padding-left: 25px;} .visuallyhidden, .ob-form-subscription label { position: absolute; overflow: hidden; clip: rect(0 0 0 0); height: 1px; width: 1px; margin: -1px; padding: 0; border: 0; } /*** General ***/ .ln {clear: both;} #ln_2 {padding-bottom: 20px;} .cl {float:left;} .clear {clear:both;} .list-title {font-size: 24px; margin: 10px 0 10px 10px; text-shadow: 1px 1px 1px #000;} /*** Structure ***/ #cl_0_0 {margin-bottom:0; width:100%;} #cl_1_0 {display:inline; padding:0 12px 0 0; width:630px; } #cl_1_1 {display:inline; padding:0; width:308px;} #cl_2_0 {margin-top: 30px; width: 100%;} #global {margin:0px auto; width:950px;} .header {margin: 110px 0 20px; text-align:left;} .avatar, #top{ display: inline-block; vertical-align: middle; } .avatar{ margin-right: 10px; } #top .title {font-family: Carter One, cusrive; font-size: 60px; left: 0; letter-spacing: 2px; line-height: 60px; text-shadow: 0 5px 5px #333; text-transform: uppercase;} #top .description {font-family: Carter One, cusrive; font-size:60px; font-size: 20px; letter-spacing: 2px; text-shadow: 0 2px 1px #333;} article {margin-bottom: 35px;} /** Article **/ .article, .page{ background: #141414; background: rgba(20,20,20,0.9); border: 2px solid #333; -moz-border-radius: 5px; -webkit-border-radius: 5px; -ms-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; padding: 10px; } .noresult{ margin-bottom: 20px; } .beforeArticle {margin-bottom: 10px;} .divTitreArticle .post-title, .divPageTitle .post-title, .special h3 {border-bottom: 1px solid; font-size: 30px; letter-spacing:2px; margin-bottom: 10px; padding-bottom:5px; word-wrap: break-word;} .contenuArticle, .pageContent {padding-top:10px;} .contenuArticle p, .pageContent p .contenuArticle ol, .contenuArticle ul {font-size: 14px; line-height: 22px; padding-bottom: 8px;} .ob-repost {background: #222; border: 1px solid #2A2A2A; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; font-weight: bold; margin: 1em 0; text-align: center;} .ob-repost p {font-size: 12px; line-height: normal; padding: 0;} .ob-repost .ob-link {text-decoration: underline;} /* Sections */ .ob-section-text, .ob-section-images, .ob-section-video, .ob-section-audio, .ob-section-quote, .ob-secton-map {width: 600px;} /* Medias */ .ob-video iframe, .ob-video object, .ob-section-images .ob-slideshow, .ob-slideshow img, .ob-section-map .ob-map { width: 600px; } .ob-video iframe{ border: 0; } .ob-video object { max-height: 345px; } .ob-section-audio .obsoundplayer .obsoundplayername { height: 31px; width: 200px; overflow: hidden; } /* Section texte */ .ob-text h3, .ob-text h4, .ob-text h5 {margin: 15px 0 5px;} .ob-text h3 {font-size: 18px; line-height: 18px;} .ob-text h4 {font-size: 16px; line-height: 16px;} .ob-text h5 {font-size: 14px; font-weight: bold; line-height: 14px;} .ob-text pre {width: 600px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -webkit-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; overflow: auto;} /* Section image */ .ob-media-left {margin-right: 30px;} .ob-media-right {margin-left: 30px; max-width: 100%;} .ob-row-1-col img {width: 100%;} .ob-row-2-col img {width: 50%; margin-top: 0; margin-bottom: 0;} .ob-row-3-col img {width: 200px; margin-top: 0; margin-bottom: 0;} /* Section map */ .ob-map div {color: #282924;} /* Section HTML */ .ob-section-html iframe, .ob-section-html embed, .ob-section-html object {max-width: 100%;} /* Section file */ .ob-section-file .ob-ctn {background: #222; border: none; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); display: block; max-width: 100%;} .ob-section-file .ob-ctn a.ob-link, .ob-section-file .ob-c a.ob-link:visited {color: #FFF; text-decoration: underline; max-width: 521px;} .ob-section-file .ob-ctn a.ob-link:hover {color: #FFF; text-decoration: none;} /* Section Quote */ .ob-section-quote {background: #222; border: none; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); margin-bottom: 20px; width: 100%;} .ob-section-quote .ob-quote p {color: #FFF; min-height: 20px;} .ob-section-quote .ob-quote p:before {color: #444; margin: 20px 0 0 -85px;} .ob-section-quote .ob-quote p:after {color: #444; margin: 80px 0 0;} .ob-section-quote p.ob-author, .ob-section-quote p.ob-source {background: #444; font-size: 14px; font-style: italic; margin: 25px 0 0; max-height: 22px; max-width: 517px; overflow: hidden; padding-bottom: 0\9; position: relative; text-overflow: ellipsis; white-space: nowrap; z-index: 11;} /* Section Link */ .ob-section-link .ob-ctn {background: #222; border: none; -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -ms-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -o-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);} .ob-section-link .ob-media-left {margin: 0;} .ob-section-link p.ob-url {background: #444; margin: 0; max-height: 20px; max-width: 395px;} .ob-section-link p.ob-title {color: #FFF; margin-bottom: 0; margin-left: 20px;} .ob-section-link p.ob-snippet {color: #FFF; margin-bottom: 10px; margin-left: 20px; margin-top: 0;} .ob-section-link p.ob-title .ob-link {color: #FFF; max-height: 42px; overflow: hidden;} .ob-section-link p.ob-snippet {margin-bottom: 35px; max-height: 40px; overflow: hidden;} .ob-section-link .ob-img {float: left; width: 170px;} .ob-section-link .ob-desc {margin-top: 5px;} /* Description */ .contenuArticle .ob-desc {font-size: 13px; font-style: italic;} /* twitter box */ .ob-section .twitter-tweet-rendered {max-width: 100% !important;} .ob-section .twt-border {max-width: 100% !important;} /* Share buttons */ .afterArticle {background: #141414; border: 2px solid #333; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px; margin: 10px 0; -moz-opacity: 0.9; -webkit-opacity: 0.9; -o-opacity: 0.9; -ms-opacity: 0.9; opacity: 0.9; padding: 9px 13px 8px; position: relative; width: 600px; z-index: 1;/* iframe Facebook */} .share h3, .item-comments h3 {margin-bottom: 10px; font-size: 16px; line-height: 16px;} .google-share, .twitter-share, .facebook-share, .ob-share {float: left;} .facebook-share {width: 105px;} .ob-share {margin-top: -2px;} .comment-number {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; display: block; float: right; font-weight: bold; line-height: 17px; padding: 2px 7px; text-align: center;} .item-comments { } /* Contact */ .ob-contact .ob-form {margin-bottom: 80px;} .ob-contact .ob-form-field {margin: 5px 0 0 80px;} .ob-label {width: 20%; font-size: 14px;} .ob-captcha .ob-input-text{ margin-left: 20%; } .ob-input-submit, .ob-error {margin-left: 31%;} .box-content .ob-input-submit, .box-content .ob-error {margin-left: 20%;} .ob-input-text, .ob-input-email, .ob-input-textarea {padding: 6px 0; border: 2px solid #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px;} .ob-input-submit {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; display: block; font-weight: bold; line-height: 17px; margin-top: 5px; padding: 2px 7px; text-align: center;} .ob-form + a {display: block; text-align: center;} /** Sidebar **/ .box {background: #141414; border: 2px solid #333; margin-bottom:10px; -moz-opacity: 0.9; -webkit-opacity: 0.9; -o-opacity: 0.9; -ms-opacity: 0.9; opacity: 0.9; padding:10px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px; border-radius: 5px;} .box{/* ie6 hack */_background:#000;} .box-titre h3 {border-bottom: 1px solid; font-family: Carter One; font-size: 20px; letter-spacing: 1px; margin-bottom: 10px; padding-bottom: 2px; text-shadow: 1px 1px 1px black; text-transform: uppercase;} .box-content {font-size: 14px; line-height:18px;} .box-content strong {font-weight:normal;} .box-footer {display:none;} /* Sidebar > About */ .profile .avatar {float: left; margin-right: 10px;} .profile .avatar img {background: #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; -moz-opacity: 0.8; -webkit-opacity: 0.8; -o-opacity: 0.8; -ms-opacity: 0.8; opacity: 0.8; padding: 3px; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;} .profile .avatar img:hover {-moz-opacity: 1; -webkit-opacity: 1; -o-opacity: 1; -ms-opacity: 1; opacity: 1;} .profile .blog-owner-nickname {font-style: italic; display: block; margin-top: 10px; text-align: right;} /* Sidebar > Search */ .search form {position:relative;} .search form input {border: 2px solid #333; -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 3px; color: #676767; padding: 5px 0; width: 70%;} .search form button {border: 0; -moz-border-radius: 3px; -webkit-border-radius: 3px; -o-border-radius: 3px; -ms-border-radius: 3px; border-radius: 3px; cursor: pointer; font-weight: bold; padding: 5px 0; width: 13%;} /* Sidebar > Subscribe */ .ob-form-subscription .ob-form-field{ display: inline-block; } .ob-form-subscription .ob-form-field input{ width: 170px; } .ob-form-subscription .ob-input-submit{ display: inline-block; margin:0; } /* Sidebar > Last Posts */ .last li {float: left;} .last ul:hover img {-moz-opacity: 0.7; -webkit-opacity: 0.7; -o-opacity: 0.7; -ms-opacity: 0.7; opacity: 0.7; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;} .last ul img {background: #333; -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; margin-bottom: 5px; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;} .last li.left img {margin-right: 8px;} .last ul img:hover {-moz-opacity: 1; -webkit-opacity: 1; -o-opacity: 1; -ms-opacity: 1; opacity: 1; -moz-transition: opacity 300ms; -webkit-transition: opacity 300ms; -o-transition: opacity 300ms; -ms-transition: opacity 300ms; transition: opacity 300ms;} /* Sidebar > Tags */ .tags li { border-bottom: 1px solid #222; margin: 10px 0; padding: 10px 0; word-wrap:break-word; } .tags li a {font-size: 16px;} .tags .number {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; float: right; font-weight: bold; line-height: 17px; margin-top: -2px; padding: 2px 7px; text-align: center;} /* Sidebar > Follow me */ .follow li {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; display: block; float: left; height: 83px; text-indent: -9999999%; width: 83px;} .follow li a {background: url("http://assets.over-blog-kiwi.com/themes/5/images/follow-me.png") no-repeat; display: block; height: 100%; width: 100%;} .follow .facebook-follow {margin-right: 10px;} .follow .facebook-follow:hover {background: #3b5999; border-color: #3b5999;} .follow .facebook-follow a {background-position: center 18px;} .follow .twitter-follow {margin-right: 10px;} .follow .twitter-follow:hover {background: #04bff2; border-color: #04bff2;} .follow .twitter-follow a {background-position: center -74px;} .follow .rss-follow:hover {background: #ff8604; border-color: #ff8604;} .follow .rss-follow a {background-position: center -166px;} /* Sidebar > Archives */ .plustext {font-size: 16px;} .arch_month {margin-left: 20px;} .arch_month li {border-bottom: 1px solid #222; margin: 10px 0; padding: 10px 0;} .archives .number {-moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; float: right; font-weight: bold; line-height: 17px; margin-top: -2px; padding: 2px 7px; text-align: center;} .share > div{ float:left; height:20px; margin-right:28px; } .share .google-share{ margin-right: 0; } .share iframe{ border:none; width:100px; } /** Pagination **/ .pagination { margin: 30px auto 20px; width: 600px; font-size: 14px; padding: 2px 0; } .pagination a { -moz-border-radius: 4px; -webkit-border-radius: 4px; -o-border-radius: 4px; -ms-border-radius: 4px; border-radius: 4px; float: right; line-height: 17px; margin-top: -2px; padding: 2px 7px; text-align: center; text-transform: uppercase; } .pagination .previous {float: left;} .pagination .next {float: right;} .ob-pagination{ margin: 20px 0; text-align: center; } .ob-page{ display: inline-block; margin: 0 1px; padding: 2px 7px; } .ob-page-link{ border-radius: 4px; } /** Credits **/ .credits {display: block; margin: 20px 0; text-align: center; text-shadow: 1px 1px 1px #000;} /************** ** ob-footer ** **************/ .ob-footer{ padding-bottom: 10px; } body.withDisplay{ background-position: 50% 68px; } #cl_1_1 .ads{ margin-bottom: 10px; padding: 2px; -moz-opacity: 0.9; -webkit-opacity: 0.9; -o-opacity: 0.9; -ms-opacity: 0.9; opacity: 0.9; } .ads{ background: #141414; border: 2px solid #333; border-radius: 2px; margin: 0 auto; } .ads-600x250{ padding: 10px; text-align: center; } .ads-728x90{ height: 90px; width: 728px; } .ads-468x60{ height: 60px; width: 468px; } .ads-468x60 + .before_articles, .afterArticle + .ads-468x60{ margin-top:35px; } .ads-300x250{ height: 250px; width: 300px; } .ads-600x250 div{ float: left; } .ads-300{ text-align: center; } /***************** ** Top articles ** *****************/ .ob-top-posts h2{ font-size: 35px; } .ob-top-article{ margin-bottom: 20px; } .ob-top-article h3{ line-height: normal; } /*** Themes ***/ /** JUNGLE **/ /* BACKGROUND */ body {background-image: url("http://img.over-blog-kiwi.com/0/24/52/97/201311/ob_5cf972_lesitedontvousetesleheros.jpg"); background-attachment: fixed; background-position: center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;background-repeat: no-repeat;} /* TOP */ #top .title a, #top .title a:visited {color: #9bb1c5;} #top .title a:hover, #top .description {color: #fff;} /* POSTS */ .beforeArticle .tags a, .beforeArticle .tags a:visited {color: #9bb1c5;} .beforeArticle .tags a:hover {color: #fff;} .post-title, .special h3 {border-bottom-color: #1e3249;} .post-title a, .post-title a:visited, .special h3, .ob-text h3, .ob-text h4, .ob-text h5 {color: #9bb1c5;} .post-title a:hover {color: #fff;} .contenuArticle a, .contenuArticle a:visited, .readmore a {color: #9bb1c5;} .contenuArticle a:hover, .readmore a:hover {color: #fff;} /* Section file */ .ob-section-file .ob-ctn a.ob-link, .ob-section-file .ob-c a.ob-link:visited, .ob-section-file .ob-ctn a.ob-link:hover {color: #9bb1c5;} /* Section Quote */ .ob-section-quote p.ob-author, .ob-section-quote p.ob-source, .ob-section-quote p.ob-author .ob-link, .ob-section-quote p.ob-author .ob-link:visited, .ob-section-quote p.ob-source .ob-link, .ob-section-quote p.ob-source .ob-link:visited {color: #9bb1c5;} .ob-section-quote p.ob-author:hover, .ob-section-quote p.ob-source:hover, .ob-section-quote p.ob-author .ob-link:hover, .ob-section-quote p.ob-source .ob-link:hover {color: #fff;} /* Section Link */ .ob-section-link p.ob-url , .ob-section-link p.ob-url .ob-link, .ob-section-link p.ob-url .ob-link, .ob-section-link p.ob-url .ob-link {color: #9bb1c5;} .ob-section-link p.ob-url .ob-link:hover {color: #fff;} /* SIDEBAR */ .box-titre h3 {border-bottom-color: #254870; color: #fff;} .box-content strong {color:#bebebe;} .box-content a, .box-content a:visited, .ob-footer a, .ob-footer a:visited{color: #9bb1c5;} .box-content a:hover, .ob-footer a:hover{color: #fff;} .archives .number, .box-content form button, .comment-number, .follow li, .ob-input-submit, .pagination a, .ob-page-link, .tags .number { background: #2e5fa4; /* Old browsers */ /* IE9 SVG, needs conditional override of 'filter' to 'none' */ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzJlNWZhNCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjY1JSIgc3RvcC1jb2xvcj0iIzIyNDA2ZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=); background: -moz-linear-gradient(top, #2e5fa4 0%, #22406d 65%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2e5fa4), color-stop(65%,#22406d)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #2e5fa4 0%,#22406d 65%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #2e5fa4 0%,#22406d 65%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #2e5fa4 0%,#22406d 65%); /* IE10+ */ background: linear-gradient(to bottom, #2e5fa4 0%,#22406d 65%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2e5fa4', endColorstr='#22406d',GradientType=0 ); /* IE6-8 */ border: 1px solid #2d5eab; color: #fff; text-shadow: 1px 1px 1px #141414;} .box-content form button:active, .comment-number:active, .ob-input-submit:active, .pagination a:active, .ob-page-link:active{background: #22406d; /* Old browsers */ /* IE9 SVG, needs conditional override of 'filter' to 'none' */ background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIzNSUiIHN0b3AtY29sb3I9IiMyMjQwNmQiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjMmU1ZmE0IiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==); background: -moz-linear-gradient(top, #22406d 35%, #2e5fa4 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(35%,#22406d), color-stop(100%,#2e5fa4)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #22406d 35%,#2e5fa4 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #22406d 35%,#2e5fa4 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #22406d 35%,#2e5fa4 100%); /* IE10+ */ background: linear-gradient(to bottom, #22406d 35%,#2e5fa4 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#22406d', endColorstr='#2e5fa4',GradientType=0 ); /* IE6-8 */ } .blog-owner-nickname {color: #254870;} /* CREDITS */ .credits a, .credits a:visited {color: #fff;} .credits a:hover {color: #9bb1c5;} </style> <script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/ads.js?v2.39.3.0"></script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-5354236-47', { cookieDomain: 'lesitedontvousetesleheros.overblog.com', cookieExpires: 31536000, name: 'ob', allowLinker: true }); ga('ob.require', 'displayfeatures'); ga('ob.require', 'linkid', 'linkid.js'); ga('ob.set', 'anonymizeIp', true); ga('ob.set', 'dimension1', '__ads_loaded__' in window ? '1' : '0'); ga('ob.set', 'dimension2', 'fr'); ga('ob.set', 'dimension3', 'BS'); ga('ob.set', 'dimension4', 'literature-comics-poetry'); ga('ob.set', 'dimension5', '1'); ga('ob.set', 'dimension6', '0'); ga('ob.set', 'dimension7', '0'); ga('ob.set', 'dimension10', '245297'); ga('ob.set', 'dimension11', '1'); ga('ob.set', 'dimension12', '1'); ga('ob.set', 'dimension13', '1'); ga('ob.send', 'pageview'); </script> <script> var obconnected = 0 var obconnectedblog = 0 var obtimestamp = 0 function isConnected(connected, connected_owner, timestamp) { obconnected = connected obconnectedblog = connected_owner obtimestamp = timestamp if (obconnected) { document.querySelector('html').className += ' ob-connected' } if (obconnectedblog) { document.querySelector('html').className += ' ob-connected-blog' } } </script> <script src="//connect.over-blog.com/ping/245297/isConnected"></script> <script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/h.js?v2.39.3.0"></script> <script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/repost.js?v2.39.3.0"></script> <script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/slideshow.js?v2.39.3.0"></script> <script src="//assets.over-blog-kiwi.com/b/blog/build/soundplayer.2940b52.js"></script> <script> var OB = OB || {}; OB.isPost = true; </script> <script src="//assets.over-blog-kiwi.com/blog/js/index.js?v2.39.3.0"></script> <script src="https://assets.over-blog-kiwi.com/ads/js/appconsent.bundle.min.js"></script> <!-- DFP --> <script> var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; (function() { var useSSL = 'https:' == document.location.protocol; var gads = document.createElement('script'); var node = document.getElementsByTagName('script')[0]; gads.async = true; gads.type = 'text/javascript'; gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; node.parentNode.insertBefore(gads, node); })(); </script> <!-- DFP --> <script> googletag.cmd.push(function() { googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [728,90], '_13ed3ef') .set('adsense_background_color','#111111') .set('adsense_border_color','#111111') .set('adsense_text_color','#9bb1c5') .set('adsense_link_color','#ffffff') .set('adsense_url_color','#9bb1c5') .addService(googletag.pubads()); }); googletag.cmd.push(function() { googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [300,250], '_30f3350') .set('adsense_background_color','#111111') .set('adsense_border_color','#111111') .set('adsense_text_color','#9bb1c5') .set('adsense_link_color','#ffffff') .set('adsense_url_color','#9bb1c5') .addService(googletag.pubads()); }); googletag.cmd.push(function() { googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [300,250], '_6d67124') .set('adsense_background_color','#111111') .set('adsense_border_color','#111111') .set('adsense_text_color','#9bb1c5') .set('adsense_link_color','#ffffff') .set('adsense_url_color','#9bb1c5') .addService(googletag.pubads()); }); googletag.cmd.push(function() { googletag.defineSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', [[300,250],[300,600]], '_bb9b0bf') .set('adsense_background_color','#111111') .set('adsense_border_color','#111111') .set('adsense_text_color','#9bb1c5') .set('adsense_link_color','#ffffff') .set('adsense_url_color','#9bb1c5') .addService(googletag.pubads()); }); googletag.cmd.push(function() { googletag.defineOutOfPageSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', '_2c08e5b') .setTargeting('Slot', 'interstitial') .setTargeting('Sliding', 'Both') .addService(googletag.pubads()); }); googletag.cmd.push(function() { googletag.defineOutOfPageSlot('/6783/OverBlogKiwi/fr/245297_lesitedontvousetesleheros.overblog.com', '_3883585') .setTargeting('Slot', 'pop') .addService(googletag.pubads()); }); </script> <script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogpdafront/prebid.js?v2.39.3.0" async></script> <script> googletag.cmd.push(function() { googletag.pubads().disableInitialLoad(); }); function sendAdserverRequest() { if (pbjs.adserverRequestSent) return; pbjs.adserverRequestSent = true; googletag.cmd.push(function() { pbjs.que.push(function() { pbjs.setTargetingForGPTAsync(); googletag.pubads().refresh(); }); }); } var PREBID_TIMEOUT = 2000; var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; pbjs.que.push(function() { pbjs.enableAnalytics({ provider: 'ga', options: { global: 'ga', enableDistribution: false, sampling: 0.01 } }); pbjs.setConfig({ userSync: { enabledBidders: ['rubicon'], iframeEnabled: false } , consentManagement: { cmpApi: 'iab', timeout: 2500, allowAuctionWithoutConsent: true } }); pbjs.bidderSettings = { standard: { adserverTargeting: [{ key: "hb_bidder", val: function(bidResponse) { return bidResponse.bidderCode; } }, { key: "hb_adid", val: function(bidResponse) { return bidResponse.adId; } }, { key: "custom_bid_price", val: function(bidResponse) { var cpm = bidResponse.cpm; if (cpm < 1.00) { return (Math.floor(cpm * 20) / 20).toFixed(2); } else if (cpm < 5.00) { return (Math.floor(cpm * 10) / 10).toFixed(2); } else if (cpm < 10.00) { return (Math.floor(cpm * 5) / 5).toFixed(2); } else if (cpm < 20.00) { return (Math.floor(cpm * 2) / 2).toFixed(2); } else if (cpm < 50.00) { return (Math.floor(cpm * 1) / 1).toFixed(2); } else if (cpm < 100.00) { return (Math.floor(cpm * 0.2) / 0.2).toFixed(2); } else if (cpm < 300.00) { return (Math.floor(cpm * 0.04) / 0.04).toFixed(2); } else { return '300.00'; } } }] } }; }); setTimeout(sendAdserverRequest, PREBID_TIMEOUT); </script> <script> pbjs.que.push(function() { var adUnits = []; adUnits.push({ code: '_13ed3ef', sizes: [[728,90]], bids: [ { bidder: 'appnexusAst', params: { placementId: 6542403, }, }, { bidder: 'rubicon', params: { accountId: 16072, siteId: 119536, zoneId: 775434, }, }, ] }) adUnits.push({ code: '_30f3350', sizes: [[300,250]], bids: [ { bidder: 'appnexusAst', params: { placementId: 6531816, }, }, { bidder: 'rubicon', params: { accountId: 16072, siteId: 119536, zoneId: 775488, }, }, ] }) adUnits.push({ code: '_6d67124', sizes: [[300,250]], bids: [ { bidder: 'appnexusAst', params: { placementId: 6531817, }, }, { bidder: 'rubicon', params: { accountId: 16072, siteId: 119536, zoneId: 775490, }, }, ] }) adUnits.push({ code: '_bb9b0bf', sizes: [[300,250],[300,600]], bids: [ { bidder: 'appnexusAst', params: { placementId: 6542408, }, }, { bidder: 'rubicon', params: { accountId: 16072, siteId: 119536, zoneId: 775484, }, }, ] }) pbjs.addAdUnits(adUnits); pbjs.requestBids({ bidsBackHandler: function(bidResponses) { sendAdserverRequest(); } }); }); </script> <script> try { googletag.cmd.push(function() { // DFP Global Targeting googletag.pubads().setTargeting('Rating', 'BS'); googletag.pubads().setTargeting('Disused', 'Yes'); googletag.pubads().setTargeting('Adult', 'No'); googletag.pubads().setTargeting('Category', 'literature-comics-poetry'); googletag.pubads().enableSingleRequest(); googletag.pubads().collapseEmptyDivs(); googletag.enableServices(); }); } catch(e) {} </script> <!-- DFP --> <script> var _eStat_Whap_loaded=0; </script> <script src="//w.estat.com/js/whap.js"></script> <script> if(_eStat_Whap_loaded) { eStatWhap.serial("800000207013"); eStatWhap.send(); } </script> <script src="https://cdn.tradelab.fr/tag/208269514b.js" async></script> </head> <body class="withDisplay" > <div class="ob-ShareBar ob-ShareBar--dark js-ob-ShareBar"> <div class="ob-ShareBar-container ob-ShareBar-container--left"> <a href="https://www.over-blog.com" class="ob-ShareBar-branding"> <img class="ob-ShareBar-brandingImg" src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/images/shareicon-branding-ob--dark.png?v2.39.3.0" alt="Overblog"> </a> </div> <div class="ob-ShareBar-container ob-ShareBar-container--right"> <a href="#" data-href="https://www.facebook.com/sharer/sharer.php?u={referer}" title=" facebook"="FACEBOOK"|trans }}"" class="ob-ShareBar-share ob-ShareBar-share--facebook"></a> <a href="#" data-href="https://twitter.com/intent/tweet?url={referer}&amp;text={title}" title=" twitter"="TWITTER"|trans }}"" class="ob-ShareBar-share ob-ShareBar-share--twitter"></a> <a href="#" data-href="#" title=" pinterest"="PINTEREST"|trans }}"" class="ob-ShareBar-share ob-ShareBar-share--pinterest js-ob-ShareBar-share--pinterest"></a> <form action="/search" method="post" accept-charset="utf-8" class="ob-ShareBar-search"> <input type="text" name="q" value="" class="ob-ShareBar-input" placeholder="Rechercher"> <button class="ob-ShareBar-submit"></button> </form> <a href="https://admin.over-blog.com/245297/write/29340435" class="ob-ShareBar-edit ob-ShareBar--connected-blog"> <span>Editer l'article</span> </a> <a class="js-ob-ShareBar-follow ob-ShareBar--connected ob-ShareBar-follow" href="https://admin.over-blog.com/_follow/245297" target="_blank" rel="nofollow"> Suivre ce blog </a> <a href="https://admin.over-blog.com/245297" class="ob-ShareBar-admin ob-ShareBar--connected"> <img src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/images/lock-alt-dark.svg?v2.39.3.0" class="ob-ShareBar-lock"> <span>Administration</span> </a> <a href="https://connect.over-blog.com/fr/login" class="ob-ShareBar-login ob-ShareBar--notconnected"> <img src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/images/lock-alt-dark.svg?v2.39.3.0" class="ob-ShareBar-lock"> <span>Connexion</span> </a> <a href="https://connect.over-blog.com/fr/signup" class="ob-ShareBar-create ob-ShareBar--notconnected"> <span class="ob-ShareBar-plus">+</span> <span>Créer mon blog</span> </a> <span class="ob-ShareBar-toggle ob-ShareBar-toggle--hide js-ob-ShareBar-toggle"></span> </div> </div> <div class="ob-ShareBar ob-ShareBar--minified js-ob-ShareBar--minified"> <div class="ob-ShareBar-container"> <span class="ob-ShareBar-toggle ob-ShareBar-toggle--show js-ob-ShareBar-toggle"></span> </div> </div> <script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/sharebar.js?v2.39.3.0"></script> <script> var postTitle = "333" socialShare(document.querySelector('.ob-ShareBar-share--facebook'), postTitle) socialShare(document.querySelector('.ob-ShareBar-share--twitter'), postTitle) </script> <!-- Init Facebook script --> <div id="fb-root"></div> <div class="ads ads-728x90"> <div id='_13ed3ef'><script> try { if (!window.__13ed3ef) { window.__13ed3ef = true; googletag.cmd.push(function() { googletag.display('_13ed3ef'); }); } } catch(e) {} </script></div> </div> <div id="global"> <div id="ln_0" class="ln"> <div id="cl_0_0" class="cl"> <div class="column_content"> <div class="header"> <div id="top"> <h1 class="title"> <a href="http://lesitedontvousetesleheros.overblog.com" class="topLien" title="Lecture des livres dont vous &ecirc;tes le h&eacute;ros">Le Site dont vous êtes le Héros</a> </h1> <p class="description">Lecture des livres dont vous &ecirc;tes le h&eacute;ros</p> </div> </div> </div> </div> <div class="clear"></div> </div> <div id="ln_1" class="ln"> <div id="cl_1_0" class="cl"> <div class="column_content"> <div> <!-- Title --> <!-- list posts --> <article> <div class="article"> <div class="option beforeArticle"> <div class="date"> Publié le <time datetime="2013-06-12T20:57:28+02:00">12 Juin 2013</time> </div> <span class="tags"> </span> </div> <div class="divTitreArticle"> <h2 class="post-title"> <a href="http://lesitedontvousetesleheros.overblog.com/333-70" class="titreArticle" title="Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n'êtes pas couché depuis cinq minutes qu'un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez..."> 333 </a> </h2> </div> <div class="contenuArticle"> <div class="ob-sections"> <div class="ob-section ob-section-text"> <div class="ob-text"> <p>Une fois la flamme de la bougie soufflée, vous essayez de vous glisser avec délectation dans les bras de Morphée. Mais vous n&#039;êtes pas couché depuis cinq minutes qu&#039;un grattement furtif vous parvient du palier. A demi plongé dans le sommeil, vous ne savez trop si quelqu&#039;un essaie de pousser votre porte ou si votre imagination tend à la paranoïa obsessionnelle. Que faire ?</p><p><a href="http://lesitedontvousetesleheros.overblog.com/372-16">Ouvrir la porte pour en avoir le cœur net ?</a></p><p><a href="http://lesitedontvousetesleheros.overblog.com/393-86">Vous poster en embuscade pour surprendre un éventuel visiteur ?</a><em> </em></p><p><a href="http://lesitedontvousetesleheros.overblog.com/245-18">Ignorer tout ceci et dormir ?</a><em> </em></p> </div> </div> </div> </div> <div class="clear"></div> </div> <div class="clear"></div> <!-- Share buttons + comments --> <div class="afterArticle"> <div class="clear"></div> <!-- Pagination --> <div class="pagination clearfix"> <a href="http://lesitedontvousetesleheros.overblog.com/332-28" title="332" class="previous">← 332</a> <a href="http://lesitedontvousetesleheros.overblog.com/334-18" title="334" class="next">334 →</a> </div> <!-- Comments --> </div> </article> </div> <div class="ads ads-600x250 clearfix"> <div id='_30f3350'><script> try { if (!window.__30f3350) { window.__30f3350 = true; googletag.cmd.push(function() { googletag.display('_30f3350'); }); } } catch(e) {} </script></div> <div id='_6d67124'><script> try { if (!window.__6d67124) { window.__6d67124 = true; googletag.cmd.push(function() { googletag.display('_6d67124'); }); } } catch(e) {} </script></div> </div> <!-- Pagination --> </div> </div> <div id="cl_1_1" class="cl"> <div class="column_content"> <div class="box freeModule"> <div class="box-titre"> <h3><span></span></h3> </div> <div class="box-content"> <div><script src="http://h1.flashvortex.com/display.php?id=2_1391984427_52721_435_0_468_60_8_1_13" type="text/javascript"></script></div> </div> </div> <!-- Search --> <div class="ads ads-300"> <div id='_bb9b0bf'><script> try { if (!window.__bb9b0bf) { window.__bb9b0bf = true; googletag.cmd.push(function() { googletag.display('_bb9b0bf'); }); } } catch(e) {} </script></div> </div> <!-- Navigation --> <div class="box blogroll"> <div class="box-titre"> <h3> <span>Liens</span> </h3> </div> <div class="box-content"> <ul class="list"> <li> <a href="http://www.lesitedontvousetesleheros.fr/liste-des-series" target="_blank"> LISTE DES SERIES </a> </li> <li> <a href="http://www.lesitedontvousetesleheros.fr/2017/02/autres-livres-dont-vous-etes-le-heros-chez-divers-editeurs.html" target="_blank"> AUTRES LIVRES DONT VOUS ETES LE HEROS </a> </li> </ul> </div> </div> <p class="credits"> Hébergé par <a href="http://www.over-blog.com" target="_blank">Overblog</a> </p> </div> </div> <div class="clear"></div> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script src="http://assets.over-blog-kiwi.com/themes/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script> <script> $(document).ready(function() { // Fancybox $(".ob-section-images a, .ob-link-img").attr("rel", "fancybox"); $("a[rel=fancybox]").fancybox({ 'overlayShow' : true, 'transitionIn' : 'fadin', 'transitionOut' : 'fadin', 'type' : 'image' }); }); // Twitter share + tweets !function(d,s,id){ var js, fjs = d.getElementsByTagName(s)[0]; if(!d.getElementById(id)){ js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js,fjs); } }(document,"script","twitter-wjs"); // Google + button window.___gcfg = {lang: 'fr'}; (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> <script src="//assets.over-blog-kiwi.com/b/blog/bundles/overblogblogblog/js/print.js?v2.39.3.0"></script> <script> var postTitle = "333" printPost(postTitle) </script> <div class="ob-footer" id="legals" > <ul> <li class="ob-footer-item"><a href="https://www.over-blog.com/" target="_blank">Créer un blog gratuit sur Overblog</a></li> <li class="ob-footer-item"><a href="/top">Top articles</a></li> <li class="ob-footer-item"><a href="/contact">Contact</a></li> <li class="ob-footer-item"><a href="https://www.over-blog.com/abuse/245297"> Signaler un abus </a></li> <li class="ob-footer-item"><a href="https://www.over-blog.com/terms-of-use" target="_blank">C.G.U.</a></li> <li class="ob-footer-item"><a href="https://www.over-blog.com/features/earn-money.html" target="_blank">Rémunération en droits d'auteur</a></li> <li class="ob-footer-item"><a href="https://www.over-blog.com/features/premium.html" target="_blank">Offre Premium</a></li> <li class="ob-footer-item"><a href="https://www.over-blog.com/cookies" target="_blank">Cookies et données personnelles</a></li> </ul> </div> <div id='_2c08e5b'><script> googletag.cmd.push(function() { googletag.display('_2c08e5b'); }); </script></div><div id='_3883585'><script> googletag.cmd.push(function() { googletag.display('_3883585'); }); </script></div> <!-- End Google Tag Manager --> <script> dataLayer = [{ 'category' : 'Literature, Comics & Poetry', 'rating' : 'BS', 'unused' : 'Yes', 'adult' : 'No', 'pda' : 'No', 'hasAds' : 'Yes', 'lang' : 'fr', 'adblock' : '__ads_loaded__' in window ? 'No' : 'Yes' }]; </script> <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-KJ6B85" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script> googletag.cmd.push(function() { (function(w,d,s,l,i){ w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'}); var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:''; j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KJ6B85'); }); </script> <!-- Begin comScore Tag --> <script> var _comscore = _comscore || []; _comscore.push({ c1: "2", c2: "6035191" }); (function() { var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true; s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js"; el.parentNode.insertBefore(s, el); })(); </script> <noscript> <img src="http://b.scorecardresearch.com/p?c1=2&c2=6035191&cv=2.0&cj=1" /> </noscript> <!-- End comScore Tag --> <!-- Begin Mediamétrie Tag --> <script> function _eStat_Whap_loaded_func(){ eStatWhap.serial("800000207013"); eStatWhap.send(); } (function() { var myscript = document.createElement('script'); myscript.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'w.estat.com/js/whap.js'; myscript.setAttribute('async', 'true'); var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(myscript, s); })(); </script> <!-- End Mediamétrie Tag --> <script> (function() { var alreadyAccept = getCookie('wbCookieNotifier'); if(alreadyAccept != 1) showWbCookieNotifier(); window.closeWbCookieNotifier = function() { setCookie('wbCookieNotifier', 1, 730); window.document.getElementById("ob-cookies").style.display = "none"; } function showWbCookieNotifier(){ var el = document.createElement("div"); var bo = document.body; el.id = "ob-cookies"; el.className = "__wads_no_click ob-cookies"; var p = document.createElement("p"); p.className = "ob-cookies-content"; p.innerHTML = "En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies. Ces derniers assurent le bon fonctionnement de nos services, d'outils d'analyse et l’affichage de publicités pertinentes. <a class='ob-cookies-link' href='https://www.over-blog.com/cookies' target='_blank'>En savoir plus et agir</a> sur les cookies. <span class='ob-cookies-button' onclick='closeWbCookieNotifier()'>J'accepte</span>" document.body.appendChild(el); el.appendChild(p); window.wbCookieNotifier = el; } function setCookie(e,t,n,d){var r=new Date;r.setDate(r.getDate()+n);var i=escape(t)+(n==null?"":"; expires="+r.toUTCString())+(d==null?"":"; domain="+d)+";path=/";document.cookie=e+"="+i} function getCookie(e){var t,n,r,i=document.cookie.split(";");for(t=0;t<i.length;t++){n=i[t].substr(0,i[t].indexOf("="));r=i[t].substr(i[t].indexOf("=")+1);n=n.replace(/^\s+|\s+$/g,"");if(n==e){return unescape(r)}}} })(); </script> </body> </html>
czuger/haute_tension
work/raw_data/pretre_jean_adorateurs_mal/daa931d1d025cc6e01cae4c69445f3823df6e84f4690e8461ce2df0bf4593a92.html
HTML
mit
66,141
47.28634
777
0.490893
false
/** * getRoles - get all roles * * @api {get} /roles Get all roles * @apiName GetRoles * @apiGroup Role * * * @apiSuccess {Array[Role]} raw Return table of roles * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * [ * { * "id": 1, * "name": "Administrator", * "slug": "administrator" * } * ] * * @apiUse InternalServerError */ /** * createRole - create new role * * @api {post} /roles Create a role * @apiName CreateRole * @apiGroup Role * @apiPermission admin * * @apiParam {String} name Name of new role * @apiParam {String} slug Slug from name of new role * * @apiSuccess (Created 201) {Number} id Id of new role * @apiSuccess (Created 201) {String} name Name of new role * @apiSuccess (Created 201) {String} slug Slug of new role * @apiSuccessExample {json} Success-Response: * HTTP/1.1 201 Created * { * "id": 3, * "name": "Custom", * "slug": "custom" * } * * @apiUse BadRequest * @apiUse InternalServerError */ /** * getRole - get role by id * * @api {get} /roles/:id Get role by id * @apiName GetRole * @apiGroup Role * * @apiSuccess {Number} id Id of role * @apiSuccess {String} name Name of role * @apiSuccess {String} slug Slug of role * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * { * "id": 2, * "name": "User", * "slug": "user" * } * * @apiUse NotFound * @apiUse InternalServerError */ /** * updateRole - update role * * @api {put} /roles/:id Update role from id * @apiName UpdateRole * @apiGroup Role * @apiPermission admin * * * @apiParam {String} name New role name * @apiParam {String} slug New role slug * * @apiSuccess {Number} id Id of role * @apiSuccess {String} name Name of role * @apiSuccess {String} slug Slug of role * @apiSuccessExample {json} Success-Response: * HTTP/1.1 200 OK * { * "id": 3, * "name": "Customer", * "slug": "customer" * } * * @apiUse NotFound * @apiUse BadRequest * @apiUse InternalServerError */ /** * deleteRole - delete role * * @api {delete} /roles/:id Delete role from id * @apiName DeleteRole * @apiGroup Role * @apiPermission admin * * * @apiSuccessExample Success-Response: * HTTP/1.1 204 No Content * * @apiUse NotFound * @apiUse BadRequest * @apiUse InternalServerError */
MadDeveloper/easy.js
src/bundles/role/doc/role.doc.js
JavaScript
mit
2,414
20.175439
59
0.601906
false
#include "icu.h" #include "unicode/uspoof.h" #define GET_SPOOF_CHECKER(_data) icu_spoof_checker_data* _data; \ TypedData_Get_Struct(self, icu_spoof_checker_data, &icu_spoof_checker_type, _data) VALUE rb_cICU_SpoofChecker; VALUE rb_mChecks; VALUE rb_mRestrictionLevel; typedef struct { VALUE rb_instance; USpoofChecker* service; } icu_spoof_checker_data; static void spoof_checker_free(void* _this) { icu_spoof_checker_data* this = _this; uspoof_close(this->service); } static size_t spoof_checker_memsize(const void* _) { return sizeof(icu_spoof_checker_data); } static const rb_data_type_t icu_spoof_checker_type = { "icu/spoof_checker", {NULL, spoof_checker_free, spoof_checker_memsize,}, 0, 0, RUBY_TYPED_FREE_IMMEDIATELY, }; VALUE spoof_checker_alloc(VALUE self) { icu_spoof_checker_data* this; return TypedData_Make_Struct(self, icu_spoof_checker_data, &icu_spoof_checker_type, this); } VALUE spoof_checker_initialize(VALUE self) { GET_SPOOF_CHECKER(this); this->rb_instance = self; this->service = FALSE; UErrorCode status = U_ZERO_ERROR; this->service = uspoof_open(&status); if (U_FAILURE(status)) { icu_rb_raise_icu_error(status); } return self; } static inline VALUE spoof_checker_get_restriction_level_internal(const icu_spoof_checker_data* this) { URestrictionLevel level = uspoof_getRestrictionLevel(this->service); return INT2NUM(level); } VALUE spoof_checker_get_restriction_level(VALUE self) { GET_SPOOF_CHECKER(this); return spoof_checker_get_restriction_level_internal(this); } VALUE spoof_checker_set_restriction_level(VALUE self, VALUE level) { GET_SPOOF_CHECKER(this); uspoof_setRestrictionLevel(this->service, NUM2INT(level)); return spoof_checker_get_restriction_level_internal(this); } static inline VALUE spoof_checker_get_checks_internal(const icu_spoof_checker_data* this) { UErrorCode status = U_ZERO_ERROR; int32_t checks = uspoof_getChecks(this->service, &status); if (U_FAILURE(status)) { icu_rb_raise_icu_error(status); } return INT2NUM(checks); } VALUE spoof_checker_get_checks(VALUE self) { GET_SPOOF_CHECKER(this); return spoof_checker_get_checks_internal(this); } VALUE spoof_checker_set_checks(VALUE self, VALUE checks) { GET_SPOOF_CHECKER(this); UErrorCode status = U_ZERO_ERROR; uspoof_setChecks(this->service, NUM2INT(checks), &status); if (U_FAILURE(status)) { icu_rb_raise_icu_error(status); } return spoof_checker_get_checks_internal(this); } VALUE spoof_checker_confusable(VALUE self, VALUE str_a, VALUE str_b) { StringValue(str_a); StringValue(str_b); GET_SPOOF_CHECKER(this); VALUE tmp_a = icu_ustring_from_rb_str(str_a); VALUE tmp_b = icu_ustring_from_rb_str(str_b); UErrorCode status = U_ZERO_ERROR; int32_t result = uspoof_areConfusable(this->service, icu_ustring_ptr(tmp_a), icu_ustring_len(tmp_a), icu_ustring_ptr(tmp_b), icu_ustring_len(tmp_b), &status); return INT2NUM(result); } VALUE spoof_checker_get_skeleton(VALUE self, VALUE str) { StringValue(str); GET_SPOOF_CHECKER(this); VALUE in = icu_ustring_from_rb_str(str); VALUE out = icu_ustring_init_with_capa_enc(icu_ustring_capa(in), ICU_RUBY_ENCODING_INDEX); int retried = FALSE; int32_t len_bytes; UErrorCode status = U_ZERO_ERROR; do { // UTF-8 version does the conversion internally so we relies on UChar version here! len_bytes = uspoof_getSkeleton(this->service, 0 /* deprecated */, icu_ustring_ptr(in), icu_ustring_len(in), icu_ustring_ptr(out), icu_ustring_capa(out), &status); if (!retried && status == U_BUFFER_OVERFLOW_ERROR) { retried = TRUE; icu_ustring_resize(out, len_bytes + RUBY_C_STRING_TERMINATOR_SIZE); status = U_ZERO_ERROR; } else if (U_FAILURE(status)) { icu_rb_raise_icu_error(status); } else { // retried == true && U_SUCCESS(status) break; } } while (retried); return icu_ustring_to_rb_enc_str_with_len(out, len_bytes); } VALUE spoof_checker_check(VALUE self, VALUE rb_str) { StringValue(rb_str); GET_SPOOF_CHECKER(this); UErrorCode status = U_ZERO_ERROR; int32_t result = 0; // TODO: Migrate to uspoof_check2UTF8 once it's not draft if (icu_is_rb_str_as_utf_8(rb_str)) { result = uspoof_checkUTF8(this->service, RSTRING_PTR(rb_str), RSTRING_LENINT(rb_str), NULL, &status); } else { VALUE in = icu_ustring_from_rb_str(rb_str); // TODO: Migrate to uspoof_check once it's not draft result = uspoof_check(this->service, icu_ustring_ptr(in), icu_ustring_len(in), NULL, &status); } if (U_FAILURE(status)) { icu_rb_raise_icu_error(status); } return INT2NUM(result); } static const char* k_checks_name = "@checks"; VALUE spoof_checker_available_checks(VALUE klass) { VALUE iv = rb_iv_get(klass, k_checks_name); if (NIL_P(iv)) { iv = rb_hash_new(); rb_hash_aset(iv, ID2SYM(rb_intern("single_script_confusable")), INT2NUM(USPOOF_SINGLE_SCRIPT_CONFUSABLE)); rb_hash_aset(iv, ID2SYM(rb_intern("mixed_script_confusable")), INT2NUM(USPOOF_MIXED_SCRIPT_CONFUSABLE)); rb_hash_aset(iv, ID2SYM(rb_intern("whole_script_confusable")), INT2NUM(USPOOF_WHOLE_SCRIPT_CONFUSABLE)); rb_hash_aset(iv, ID2SYM(rb_intern("confusable")), INT2NUM(USPOOF_CONFUSABLE)); // USPOOF_ANY_CASE deprecated in 58 rb_hash_aset(iv, ID2SYM(rb_intern("restriction_level")), INT2NUM(USPOOF_RESTRICTION_LEVEL)); // USPOOF_SINGLE_SCRIPT deprecated in 51 rb_hash_aset(iv, ID2SYM(rb_intern("invisible")), INT2NUM(USPOOF_INVISIBLE)); rb_hash_aset(iv, ID2SYM(rb_intern("char_limit")), INT2NUM(USPOOF_CHAR_LIMIT)); rb_hash_aset(iv, ID2SYM(rb_intern("mixed_numbers")), INT2NUM(USPOOF_MIXED_NUMBERS)); rb_hash_aset(iv, ID2SYM(rb_intern("all_checks")), INT2NUM(USPOOF_ALL_CHECKS)); rb_hash_aset(iv, ID2SYM(rb_intern("aux_info")), INT2NUM(USPOOF_AUX_INFO)); rb_iv_set(klass, k_checks_name, iv); } return iv; } static const char* k_restriction_level_name = "@restriction_levels"; VALUE spoof_checker_available_restriction_levels(VALUE klass) { VALUE iv = rb_iv_get(klass, k_restriction_level_name); if (NIL_P(iv)) { iv = rb_hash_new(); rb_hash_aset(iv, ID2SYM(rb_intern("ascii")), INT2NUM(USPOOF_ASCII)); rb_hash_aset(iv, ID2SYM(rb_intern("single_script_restrictive")), INT2NUM(USPOOF_SINGLE_SCRIPT_RESTRICTIVE)); rb_hash_aset(iv, ID2SYM(rb_intern("highly_restrictive")), INT2NUM(USPOOF_HIGHLY_RESTRICTIVE)); rb_hash_aset(iv, ID2SYM(rb_intern("moderately_restrictive")), INT2NUM(USPOOF_MODERATELY_RESTRICTIVE)); rb_hash_aset(iv, ID2SYM(rb_intern("minimally_restrictive")), INT2NUM(USPOOF_MINIMALLY_RESTRICTIVE)); rb_hash_aset(iv, ID2SYM(rb_intern("unrestrictive")), INT2NUM(USPOOF_UNRESTRICTIVE)); rb_hash_aset(iv, ID2SYM(rb_intern("restriction_level_mask")), INT2NUM(USPOOF_RESTRICTION_LEVEL_MASK)); rb_hash_aset(iv, ID2SYM(rb_intern("undefined_restrictive")), INT2NUM(USPOOF_UNDEFINED_RESTRICTIVE)); rb_iv_set(klass, k_restriction_level_name, iv); } return iv; } void init_icu_spoof_checker(void) { rb_cICU_SpoofChecker = rb_define_class_under(rb_mICU, "SpoofChecker", rb_cObject); rb_define_singleton_method(rb_cICU_SpoofChecker, "available_checks", spoof_checker_available_checks, 0); rb_define_singleton_method(rb_cICU_SpoofChecker, "available_restriction_levels", spoof_checker_available_restriction_levels, 0); rb_define_alloc_func(rb_cICU_SpoofChecker, spoof_checker_alloc); rb_define_method(rb_cICU_SpoofChecker, "initialize", spoof_checker_initialize, 0); rb_define_method(rb_cICU_SpoofChecker, "restriction_level", spoof_checker_get_restriction_level, 0); rb_define_method(rb_cICU_SpoofChecker, "restriction_level=", spoof_checker_set_restriction_level, 1); rb_define_method(rb_cICU_SpoofChecker, "check", spoof_checker_check, 1); rb_define_method(rb_cICU_SpoofChecker, "checks", spoof_checker_get_checks, 0); rb_define_method(rb_cICU_SpoofChecker, "checks=", spoof_checker_set_checks, 1); rb_define_method(rb_cICU_SpoofChecker, "confusable?", spoof_checker_confusable, 2); rb_define_method(rb_cICU_SpoofChecker, "get_skeleton", spoof_checker_get_skeleton, 1); } #undef DEFINE_SPOOF_ENUM_CONST #undef GET_SPOOF_CHECKER /* vim: set expandtab sws=4 sw=4: */
fantasticfears/icu4r
ext/icu/icu_spoof_checker.c
C
mit
9,203
36.563265
132
0.638161
false
--- layout: sieutv title: it 227 tags: [ittv] thumb_re: q7t1227 --- {% include q7t1 key="227" %}
binhbat/binhbat.github.io
_drafts/1/it/_posts/2016-08-08-227_q7t1.md
Markdown
mit
99
13.142857
29
0.616162
false
import { Component } from 'react'; import format from '../components/format'; import parse from 'date-fns/parse'; import getDay from 'date-fns/get_day'; import Media from 'react-media'; import Page from '../layouts/Page'; import TimelineView from '../components/TimelineView'; import ListView from '../components/ListView'; import db from '../events'; export default class extends Component { static async getInitialProps({ query }) { const response = db .map((event, id) => ({ ...event, id })) .filter((event) => { if (!query.day) { return true; } return getDay(event.startsAt) === parseInt(query.day, 10); }); const events = await Promise.resolve(response); return { events: events.reduce((groupedByDay, event) => { const day = format(event.startsAt, 'dddd'); groupedByDay[day] = [...(groupedByDay[day] || []), event]; return groupedByDay; }, {}) }; } render() { return ( <Page title="Arrangementer"> <Media query="(max-width: 799px)" > {(matches) => { const Component = matches ? ListView : TimelineView; return <Component events={this.props.events} />; }} </Media> </Page> ); } }
webkom/jubileum.abakus.no
pages/index.js
JavaScript
mit
1,320
25.4
66
0.563636
false
--- title: エレコム 3.5インチ外付けHDD/USB3.0/2.0TB/ホワイト HD-SG2.0U3WH-Dが特価6,980円!送料無料! author: 激安・格安・特価情報ツウ layout: post date: 2016-06-10 23:00:10 permalink: /pc/elecom-hdd-usb3-2tb-white-hd-hd-sg2.0u3wh-d-nttx-6980.html categories: - 外付けHDD --- <div class="img-bg2 img_L"> <a href="//px.a8.net/svt/ejp?a8mat=ZYP6S+8IMA3E+S1Q+BWGDT&#038;a8ejpredirect=//nttxstore.jp/_II_EL15275362" target="_blank"><img border="0" alt="エレコム 3.5インチ外付けHDD/USB3.0/2.0TB/ホワイト HD-SG2.0U3WH-D" src="//image.nttxstore.jp/l2_images/E/EL/EL15275362.jpg" data-recalc-dims="1" /></a> </div> ### エレコム 3.5インチ外付けHDD/USB3.0/2.0TB/ホワイト HD-SG2.0U3WH-D <!--more--> * 対応パソコン:標準でUSB3.0またはUSB2.0ポートを搭載したパソコンおよびAppleMacシリーズ * 対応OS:Windows10、8.1、8、7/MacOSX10.11、10.10、10.9、10.8 * 容量:2TB * PC電源連動:○ <br clear="all" />7,980円(税込)+期間限定:1,000円割引 = 激安特価 <span class="tokka-price"><strong>8,980</strong></span> 円(税込)**送料無料** <価格比較サイト最安値 他店: 7,980円> NTT-Xにて激安特価情報を見る: <span class="fs150p"><a href="//px.a8.net/svt/ejp?a8mat=ZYP6S+8IMA3E+S1Q+BWGDT&#038;a8ejpredirect=//nttxstore.jp/_II_EL15275362" target="_blank">エレコム 3.5インチ外付けHDD/USB3.0/2.0TB/ホワイト HD-SG2.0U3WH-D</a></span>
tokka2/tokka2.github.io
_posts/2016-06-11-elecom-hdd-usb3-2tb-white-hd-hd-sg2.0u3wh-d-nttx-6980.md
Markdown
mit
1,478
42.153846
281
0.71123
false
### Explanation: [home.js](https://github.com/vlad3489/ExampleOfCode/blob/master/home.js) - fragment code from project "Moe Misto" [opening.js](https://github.com/vlad3489/ExampleOfCode/blob/master/opening.cs) - code from game
vlad3489/ExampleOfCode
README.md
Markdown
mit
229
44.8
113
0.759825
false
/* * Simple Vulkan application * * Copyright (c) 2016 by Mathias Johansson * * This code is licensed under the MIT license * https://opensource.org/licenses/MIT */ #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <string.h> #include "util/vulkan.h" #include "util/window.h" int main() { // Create an instance of vulkan createInstance("Vulkan"); setupDebugging(); getDevice(); openWindow(); createCommandPool(); createCommandBuffer(); prepRender(); beginCommands(); VkClearColorValue clearColor = { .uint32 = {1, 0, 0, 1} }; VkImageMemoryBarrier preImageBarrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, queueFam, queueFam, swapImages[nextImage], swapViewInfos[nextImage].subresourceRange }; vkCmdPipelineBarrier( comBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, 0, 0, NULL, 0, NULL, 1, &preImageBarrier ); vkCmdClearColorImage( comBuffer, swapImages[nextImage], VK_IMAGE_LAYOUT_GENERAL, &clearColor, 1, &swapViewInfos[nextImage].subresourceRange ); VkImageMemoryBarrier postImageBarrier = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, NULL, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT, VK_IMAGE_LAYOUT_GENERAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, VK_QUEUE_FAMILY_IGNORED, VK_QUEUE_FAMILY_IGNORED, swapImages[nextImage], swapViewInfos[nextImage].subresourceRange }; vkCmdPipelineBarrier( comBuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, NULL, 0, NULL, 1, &postImageBarrier ); endCommands(); submitCommandBuffer(); tickWindow(); sleep(3); // DESTROY destroyInstance(); quitWindow(); return 0; }
Mathias9807/Vulkan-Demo
src/main.c
C
mit
1,993
20.430108
60
0.723532
false
import { defineAsyncComponent } from 'vue'; import { showModal } from '../../../modal/modal.service'; import { User } from '../../../user/user.model'; import { GameBuild } from '../../build/build.model'; import { Game } from '../../game.model'; import { GamePackage } from '../package.model'; interface GamePackagePurchaseModalOptions { game: Game; package: GamePackage; build: GameBuild | null; fromExtraSection: boolean; partnerKey?: string; partner?: User; } export class GamePackagePurchaseModal { static async show(options: GamePackagePurchaseModalOptions) { return await showModal<void>({ modalId: 'GamePackagePurchase', component: defineAsyncComponent(() => import('./purchase-modal.vue')), size: 'sm', props: options, }); } }
gamejolt/gamejolt
src/_common/game/package/purchase-modal/purchase-modal.service.ts
TypeScript
mit
761
27.185185
73
0.69251
false
SET DEFINE OFF; ALTER TABLE AFW_04_CONTX_ETEND ADD ( CONSTRAINT AFW_04_CONTX_ETEND_FK1 FOREIGN KEY (REF_CONTX) REFERENCES AFW_04_CONTX (REF_FIL_ARIAN) ON DELETE CASCADE ENABLE VALIDATE) /
lgcarrier/APEXFramework
5.2.3/Database/Constraints/AFW_04_CONTX_ETEND_FK1.sql
SQL
mit
200
24
41
0.73
false
// // detail/win_iocp_socket_recvfrom_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2012 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.lslboost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP #define BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include <lslboost/asio/detail/config.hpp> #if defined(BOOST_ASIO_HAS_IOCP) #include <lslboost/utility/addressof.hpp> #include <lslboost/asio/detail/bind_handler.hpp> #include <lslboost/asio/detail/buffer_sequence_adapter.hpp> #include <lslboost/asio/detail/fenced_block.hpp> #include <lslboost/asio/detail/handler_alloc_helpers.hpp> #include <lslboost/asio/detail/handler_invoke_helpers.hpp> #include <lslboost/asio/detail/operation.hpp> #include <lslboost/asio/detail/socket_ops.hpp> #include <lslboost/asio/error.hpp> #include <lslboost/asio/detail/push_options.hpp> namespace lslboost { namespace asio { namespace detail { template <typename MutableBufferSequence, typename Endpoint, typename Handler> class win_iocp_socket_recvfrom_op : public operation { public: BOOST_ASIO_DEFINE_HANDLER_PTR(win_iocp_socket_recvfrom_op); win_iocp_socket_recvfrom_op(Endpoint& endpoint, socket_ops::weak_cancel_token_type cancel_token, const MutableBufferSequence& buffers, Handler& handler) : operation(&win_iocp_socket_recvfrom_op::do_complete), endpoint_(endpoint), endpoint_size_(static_cast<int>(endpoint.capacity())), cancel_token_(cancel_token), buffers_(buffers), handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)) { } int& endpoint_size() { return endpoint_size_; } static void do_complete(io_service_impl* owner, operation* base, const lslboost::system::error_code& result_ec, std::size_t bytes_transferred) { lslboost::system::error_code ec(result_ec); // Take ownership of the operation object. win_iocp_socket_recvfrom_op* o( static_cast<win_iocp_socket_recvfrom_op*>(base)); ptr p = { lslboost::addressof(o->handler_), o, o }; BOOST_ASIO_HANDLER_COMPLETION((o)); #if defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING) // Check whether buffers are still valid. if (owner) { buffer_sequence_adapter<lslboost::asio::mutable_buffer, MutableBufferSequence>::validate(o->buffers_); } #endif // defined(BOOST_ASIO_ENABLE_BUFFER_DEBUGGING) socket_ops::complete_iocp_recvfrom(o->cancel_token_, ec); // Record the size of the endpoint returned by the operation. o->endpoint_.resize(o->endpoint_size_); // Make a copy of the handler so that the memory can be deallocated before // the upcall is made. Even if we're not about to make an upcall, a // sub-object of the handler may be the true owner of the memory associated // with the handler. Consequently, a local copy of the handler is required // to ensure that any owning sub-object remains valid until after we have // deallocated the memory here. detail::binder2<Handler, lslboost::system::error_code, std::size_t> handler(o->handler_, ec, bytes_transferred); p.h = lslboost::addressof(handler.handler_); p.reset(); // Make the upcall if required. if (owner) { fenced_block b(fenced_block::half); BOOST_ASIO_HANDLER_INVOCATION_BEGIN((handler.arg1_, handler.arg2_)); lslboost_asio_handler_invoke_helpers::invoke(handler, handler.handler_); BOOST_ASIO_HANDLER_INVOCATION_END; } } private: Endpoint& endpoint_; int endpoint_size_; socket_ops::weak_cancel_token_type cancel_token_; MutableBufferSequence buffers_; Handler handler_; }; } // namespace detail } // namespace asio } // namespace lslboost #include <lslboost/asio/detail/pop_options.hpp> #endif // defined(BOOST_ASIO_HAS_IOCP) #endif // BOOST_ASIO_DETAIL_WIN_IOCP_SOCKET_RECVFROM_OP_HPP
gazzlab/LSL-gazzlab-branch
liblsl/external/lslboost/asio/detail/win_iocp_socket_recvfrom_op.hpp
C++
mit
4,108
31.864
79
0.701315
false
--- layout: page subheadline: "The software is and was used in research on concurrent conceptual design of complex systems" title: "References" teaser: categories: tags: header: no permalink: "/references/" --- ### CERA 2017 The tool CEDESK and a processguide for concurrent conceptual design is descibed in a paper in a special issue of the [Journal on Concurrent Engineering Research and Applications](http://journals.sagepub.com/home/cer). Knoll, Dominik, and Alessandro Golkar. 2016. “A Coordination Method for Concurrent Design and a Collaboration Tool for Parametric System Models.” In SECESA 2016, Madrid, 1–11. [doi:10.1177/1063293X17732374](http://journals.sagepub.com/doi/abs/10.1177/1063293X17732374). The release of CEDESK as open source software was covered by [Skoltech News](http://www.skoltech.ru/en/2017/08/skoltech-research-team-releases-cutting-edge-concurrent-engineering-software/). ### PLM Conference 2017 The data structures and conceptual modeling approach was presented at the Annual [PLM Conference](http://www.plm-conference.org), in Seville, July 2017. Fortin, Clément, Grant Mcsorley, Dominik Knoll, Alessandro Golkar, and Ralina Tsykunova. 2017. “Study of Data Structures and Tools for the Concurrent Conceptual Design of Complex Space Systems.” In IFIP 14th International Conference on Product Lifecycle Management 9-12 July 2017, Seville, Spain. Seville. [doi:10.1007/978-3-319-72905-3_53](https://doi.org/10.1007/978-3-319-72905-3_53). ### SECESA 2016 CEDESK was first presented on the [Systems Engineering and Concurrent Engineering for Space Applications](http://www.esa.int/Our_Activities/Space_Engineering_Technology/CDF/Systems_and_Concurrent_Engineering_for_Space_Applications_SECESA_2016) conference held 5-7 October 2016 in Madrid. Presentation slides available at [ResearchGate](https://www.researchgate.net/publication/318641101_A_coordination_method_for_concurrent_design_and_a_collaboration_tool_for_parametric_system_models). Our successful presentation was covered by [Skoltech News](http://www.skoltech.ru/en/2016/11/the-paper-of-skoltech-phd-student-is-one-of-the-top-10-at-the-secesa-2016-conference-of-the-european-space-agency/). ### INCOSE Symposium 2016 We have developed a concurrent design laboratory at the Skolkovo Institute of Science and Technology where CEDESK is being developed. Our learnings from the process were presented at the [INCOSE Symosium 2016](http://www.incose.org/symp2016/home). Golkar, A. (2016), Lessons learnt in the development of a Concurrent Engineering Infrastructure. INCOSE International Symposium, 26: 1759–1769. [doi:10.1002/j.2334-5837.2016.00259.x](http://onlinelibrary.wiley.com/doi/10.1002/j.2334-5837.2016.00259.x/abstract)
cedesk/cedesk.github.io
pages/references.md
Markdown
mit
2,748
69.128205
387
0.79415
false
package Rakudobrew::ShellHook::Sh; use strict; use warnings; use 5.010; use File::Spec::Functions qw(catdir splitpath); use FindBin qw($RealBin $RealScript); use Rakudobrew::Variables; use Rakudobrew::Tools; use Rakudobrew::VersionHandling; use Rakudobrew::ShellHook; use Rakudobrew::Build; sub get_init_code { my $path = $ENV{PATH}; $path = Rakudobrew::ShellHook::clean_path($path, $RealBin); $path = "$RealBin:$path"; if (get_brew_mode() eq 'env') { if (get_global_version() && get_global_version() ne 'system') { $path = join(':', get_bin_paths(get_global_version()), $path); } } else { # get_brew_mode() eq 'shim' $path = join(':', $shim_dir, $path); } return <<EOT; export PATH="$path" $brew_name() { command $brew_name internal_hooked "\$@" && eval "`command $brew_name internal_shell_hook Sh post_call_eval "\$@"`" } EOT } sub post_call_eval { Rakudobrew::ShellHook::print_shellmod_code('Sh', @_); } sub get_path_setter_code { my $path = shift; return "export PATH=\"$path\""; } sub get_shell_setter_code { my $version = shift; return "export $env_var=\"$version\""; } sub get_shell_unsetter_code { return "unset $env_var"; } 1;
tadzik/rakudobrew
lib/Rakudobrew/ShellHook/Sh.pm
Perl
mit
1,246
21.25
75
0.61878
false
--- title: "Krita Brushes Presets Pack v2" date: 2016-09-16 14:00 thumb: '/img/blog/brush-pack-v2/icon-nylnook-brush-pack-v2-art-pen.jpg' lang_fr: '/fr/blog/pack-brosses-krita-v2' tags: - download - graphic novel - making of - tutorials --- ![Krita icon](/website-img/icon-krita.svg) Time for update ! I'm happy to introduce **36 brushes** presets for digital painting I crafted for and with **[Krita 3.0.1](https://krita.org/)** , used for [my latest comic](/en/comics/mokatori-ep0-the-end/)... This is version 2. They are free to use, under a [Creative Commons Zero License](http://creativecommons.org/publicdomain/zero/1.0/deed) ! ## What's new in v2 ? First of all, now there are 2 packs, depending on your stylus : does it support rotation additionally to pressure and tilt ? If you have a [Wacom Art Pen](https://www.wacom.com/en-us/store/pens/art-pen) or similar, that support rotation, you will be interested by the Art Pen pack: [![Nylnook Art Pen Brush pack icon](/img/blog/brush-pack-v2/icon-nylnook-brush-pack-v2-art-pen.jpg)](https://github.com/nylnook/nylnook-krita-brushes/releases/download/v2/nylnook-v2-art.bundle) And if you have any other Pen, you will be interested by the Generic Pen pack, which emulate rotation on some brushes: [![Nylnook Generic Pen Brush pack icon](/img/blog/brush-pack-v2/icon-nylnook-brush-pack-v2-generic-pen.jpg)](https://github.com/nylnook/nylnook-krita-brushes/releases/download/v2/nylnook-v2-gen.bundle) Emulation is acheived with brand new Krita features : Drawing Angle Lock (introduced in 3.0), and Fuzzy Stroke (introduced in 3.0.1) ! I also : - added 3 new brushes presets (Aboriginal Dots, Ink Power Rectangle and Clone Tool) - updated almost every brush - removed 2 not so interesting brushes that were no longer working - updated textures and redo some - and the basic brushes now use the "Greater" blending mode, which give better results when a stroke overlap another stroke, but works only on a transparent layer: if you want to use them on an opaque layer like a background, just switch the blending mode to Normal again ## Installation Download the [Generic Pen Bundle](https://github.com/nylnook/nylnook-krita-brushes/releases/download/v2/nylnook-v2-gen.bundle), or the [Art Pen Bundle](https://github.com/nylnook/nylnook-krita-brushes/releases/download/v2/nylnook-v2-art.bundle). In Krita, go to *Settings > Manage Resources… > Import Bundle/Resource*, and make sure the bundle is in the *Active Bundles* column on the left. You should choose one of the bundle, and do not install or activate both of them, otherwise the Krita tagging system will be confused with brushes that are common to both packs. ## Usage I usually use them on a large canvas (mininimum 2K)... so theses presets may look big on a smaller canvas. ### Small Icons ![Nylnook rotation icon](/img/blog/brush-pack-v2/icon-rotation-crop.png) Brushes with a rotation icon for the Art Pen pack are meant to be used with a stylus **supporting rotation** like the [Wacom Art Pen](https://www.wacom.com/en-us/store/pens/art-pen) (the best stylus I know if you want my opinion). This allow to do thick and thin strokes, essentials for inking. ![Nylnook rotation generic icon](/img/blog/brush-pack-v2/icon-rotation-generic-crop.png) Brushes with a G with an arrow icon for "Generic rotation" are brushes with **emulated rotation** which can work with any stylus, and rely on Krita features Drawing Angle Lock and Fuzzy Stroke. Most of them are in the Generic Pen pack, but you can find two in the Art Pen pack when Fuzzy Stroke is more intersting than controlled rotation. ![Nylnook mix icon](/img/blog/brush-pack-v2/icon-mix-crop.png) Brushes with a drop icon mix there colors with the color already on the canvas... so they feel "wet". Brushes with mixing and rotation use more computing power than other brushes, especially when they are combined with textures. Should work on any recent computer nevertheless ;) ### Naming As Krita tagging system is sometimes capricious, every brush preset start with "Nylnook" to quickly find them. Then they are sorted by types : **Aboriginal Dots** : I created this one specially to mimic australian aboriginal dot painting for a specific projet. Just draw your line and the preset will paint dots along the way in this aboriginal style. ![Aboriginal Dots presentation](/img/blog/brush-pack-v2/presentation-aboriginal.jpg) **Airbrush** is a textured airbrush for shading, it's more interesting with a texture ;) ![Airbrush presentation](/img/blog/brush-pack-v2/presentation-airbrush.jpg) **Basic** Brushes are the simplest, and the less demanding for your computer. Slightly noising to allow soft mixing between colors. Now using the "Greater" Blending mode. ![Basic presentation](/img/blog/brush-pack-v2/presentation-basic.jpg) **Block** allow to do large blocking of colors in speed painting for example. Noise and not texture to make it quicker. ![Block presentation](/img/blog/brush-pack-v2/presentation-block.jpg) **Clone Tool** allow to copy part of an image on another part. Define the source spot with Ctrl+clic. With the airbrush texture for more random mixings, less repetitive. ![Clone presentation](/img/blog/brush-pack-v2/presentation-clone.jpg) **Erase** : One really hard (just erase that mistake now in one stoke) and one soft with a texture for shadings. ![Erase presentation](/img/blog/brush-pack-v2/presentation-erase.jpg) **Fill or Erase Shape**: for quick filling, or quick erasing of large areas with the "E" shortcut. ![Fill or Erase Shape presentation](/img/blog/brush-pack-v2/presentation-fill-or-erase.jpg) **Ink**: Brushes for quick inking or details and some experiments for original inkings. ![Ink presentation](/img/blog/brush-pack-v2/presentation-ink.jpg) **Ink Power**: The three best inking brushes, but they are hard to use : I recommend the Dynamic Brush tool to draw with it. ![Ink Power presentation](/img/blog/brush-pack-v2/presentation-ink-power.jpg) **Paint**: Three brushes with rotation and mixing for "real" painting or watercoloring. ![Paint presentation](/img/blog/brush-pack-v2/presentation-paint.jpg) **Pencil**: a simple pencil for sketches, really similar to default Pencil 2B, with addtional settings for more realism ![Pencil presentation](/img/blog/brush-pack-v2/presentation-pencil.jpg) **Poska**: Small markers brushes inspired by the famous [Posca](http://www.posca.com)s ![Poska presentation](/img/blog/brush-pack-v2/presentation-poska.jpg) ## Compatibility Compatible with Krita **3.0.1** (not 3.0), and next point releases at least ;) ## Changelog **September 16th 2016**: 36 brushes crafted for and with Krita 3.0.1, used for [my comics](http://nylnook.com/en/comics/)... This is version 2 ! **January 7th 2016**: 25 brushes crafted for and with Krita 2.9, used for [my comics](http://nylnook.com/en/comics/)... This is version 1 ! **April 24th 2015**: 12 brushes I craft since Krita 2.8, and finalized with Krita 2.9... They are working, but more work is needed ! This is a beta. ## License CC-0 / Public Domain. Credit *Camille Bissuel* if needed. ## Thanks Theses brushes are born with the inspiration of other brushes made by theses great peoples : - [Timothée Giet](http://timotheegiet.com) - [David Revoy](http://davidrevoy.com/) - [Pablo Cazorla](http://www.pcazorla.com/) - [Wolthera van Hövell](http://wolthera.info/) ## Full Sources You can find the full sources [here on Framagit](https://framagit.org/nylnook/nylnook-krita-brushes), so each brush individually, icons, and so on...
nylnook/nylnook-website
src/documents/en/blog/krita-brushes-pack-v2.html.md
Markdown
mit
7,656
55.264706
428
0.751699
false
module.exports = (req, res, next) => { req.context = req.context || {}; next(); };
thedavisproject/davis-web
src/middleware/initContext.js
JavaScript
mit
87
20.75
38
0.54023
false
'use strict'; angular.module('achan.previewer').service('imagePreviewService', function () { var source; var ImagePreviewService = { render: function (scope, element) { element.html('<img src="' + source + '" class="img-responsive" />'); }, forSource: function (src) { source = src; return ImagePreviewService; } }; return ImagePreviewService; });
achan/angular-previewer
app/scripts/services/imagePreviewService.js
JavaScript
mit
392
23.5
78
0.630102
false
require 'spec_helper' describe Group do # Check that gems are installed # Acts as Taggable on gem it { should have_many(:base_tags).through(:taggings) } # Check that appropriate fields are accessible it { should allow_mass_assignment_of(:name) } it { should allow_mass_assignment_of(:description) } it { should allow_mass_assignment_of(:public) } it { should allow_mass_assignment_of(:tag_list) } # Check that validations are happening properly it { should validate_presence_of(:name) } context 'Class Methods' do describe '#open_to_the_public' do include_context 'groups support' subject { Group.open_to_the_public } it { should include public_group } it { should_not include private_group } end end end
gemvein/cooperative
spec/models/group_spec.rb
Ruby
mit
768
25.517241
56
0.69401
false
#ifndef DIMACSGENERATOR_H #define DIMACSGENERATOR_H 1 #include <vector> #include <fstream> #include "cnfclause.h" #include "cnfformula.h" #include "satgenerator.h" /** A very very basic DIMACS parser. Only parses for cnf formulas. */ class DimacsGenerator : public SatGenerator{ private: std::string filename; public: /** constructor - reads the formula from the file and creates it @param file the file to read @param k arity of a clause */ DimacsGenerator(std::string filename, unsigned int k); /** @return sat formula from the file */ void generate_sat(CNFFormula & f); }; #endif
Balise42/sattools
include/dimacsgenerator.h
C
mit
619
27.136364
69
0.707593
false
# -*- coding: utf-8 -*- # Keyak v2 implementation by Jos Wetzels and Wouter Bokslag # hereby denoted as "the implementer". # Based on Keccak Python and Keyak v2 C++ implementations # by the Keccak, Keyak and Ketje Teams, namely, Guido Bertoni, # Joan Daemen, Michaël Peeters, Gilles Van Assche and Ronny Van Keer # # For more information, feedback or questions, please refer to: # http://keyak.noekeon.org/ # http://keccak.noekeon.org/ # http://ketje.noekeon.org/ from StringIO import StringIO class stringStream(StringIO): # Peek (extract byte without advancing position, return None if no more stream is available) def peek(self): oldPos = self.tell() b = self.read(1) newPos = self.tell() if((newPos == (oldPos+1)) and (b != '')): r = ord(b) else: r = None self.seek(oldPos, 0) return r # Pop a single byte (as integer representation) def get(self): return ord(self.read(1)) # Push a single byte (as integer representation) def put(self, b): self.write(chr(b)) return # Erase buffered contents def erase(self): self.truncate(0) self.seek(0, 0) return # Set buffered contents def setvalue(self, s): self.erase() self.write(s) return def hasMore(I): return (I.peek() != None) def enc8(x): if (x > 255): raise Exception("The integer %d cannot be encoded on 8 bits." % x) else: return x # Constant-time comparison from the Django source: https://github.com/django/django/blob/master/django/utils/crypto.py # Is constant-time only if both strings are of equal length but given the use-case that is always the case. def constant_time_compare(val1, val2): if len(val1) != len(val2): return False result = 0 for x, y in zip(val1, val2): result |= ord(x) ^ ord(y) return result == 0
samvartaka/keyak-python
utils.py
Python
mit
1,775
25.102941
118
0.684329
false
--- layout: post title: Summer Sailing excerpt: Random photos of summer sailing and favorite anchorages. categories: 2016-LakeSuperior date: 2016-07-27 published: true image: ogimage: "2016/DSCF3171.jpg" images-array: - path: 2016/DSCF3080.jpg label: - path: 2016/DSCF3095.jpg label: - path: 2016/DSCF3096.jpg label: - path: 2016/DSCF3100.jpg label: - path: 2016/DSCF3119.jpg label: - path: 2016/DSCF3121.jpg label: - path: 2016/DSCF3156.jpg label: I like my rope rigging enough that I'm always taking pictures of it. Dead eyes and lashings with a huge ship in the background. Could it be more nautical? - path: 2016/DSCF3159.jpg label: - path: 2016/DSCF3171.jpg label: --- I mysteriously lost most of the pictures from our summer circle tour. This is what I could find. Basically the sunset is from the day before we left and there are a few from the Apostle Islands just before we got home. That's it!
jilse/jilse.github.io
_posts/2016/2016-07-27-random-2016-Lake-Superior-sailing-picutres.md
Markdown
mit
953
29.774194
229
0.725079
false
package deliver import ( "testing" "net/http" "net/http/httptest" "reflect" ) func TestMiddlewareBasic(t *testing.T) { d := New() d.Use(MiddlewareHandlerFunc(func(res Response, req *Request, next func()) { res.Send("Hello") })) response, body := testMiddleware(t, d) expect(t, body, "Hello") expect(t, response.Code, http.StatusOK) } func TestMiddlewareMultiple(t *testing.T) { d := New() content := "" d.Use(MiddlewareHandlerFunc(func(res Response, req *Request, next func()) { content += "Hello" next() })) d.Use(MiddlewareHandlerFunc(func(res Response, req *Request, next func()) { content += "World" res.SetStatus(http.StatusOK) })) response, _ := testMiddleware(t, d) expect(t, content, "HelloWorld") expect(t, response.Code, http.StatusOK) } func TestMiddlewareMultipleAfter(t *testing.T) { d := New() content := "" d.Use(MiddlewareHandlerFunc(func(res Response, req *Request, next func()) { next() content += "Hello" })) d.Use(MiddlewareHandlerFunc(func(res Response, req *Request, next func()) { content += "World" res.SetStatus(http.StatusOK) })) response, _ := testMiddleware(t, d) expect(t, content, "WorldHello") expect(t, response.Code, http.StatusOK) } func TestMiddlewareMultipleInterrupt(t *testing.T) { d := New() content := "" d.Use(MiddlewareHandlerFunc(func(res Response, req *Request, next func()) { content += "Hello" })) d.Use(MiddlewareHandlerFunc(func(res Response, req *Request, next func()) { content += "Should not be called" res.SetStatus(http.StatusOK) })) response, _ := testMiddleware(t, d) expect(t, content, "Hello") expect(t, response.Code, http.StatusNotFound) } /* Helpers */ func testMiddleware(t *testing.T, deliver *Deliver) (*httptest.ResponseRecorder, string) { response := httptest.NewRecorder() deliver.ServeHTTP(response, (*http.Request)(nil)) return response, response.Body.String() } func expect(t *testing.T, a interface{}, b interface{}) { if a != b { t.Errorf("Expected %v (%v) - Got %v (%v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a)) } }
msavela/deliver
middleware_test.go
GO
mit
2,081
21.387097
90
0.677078
false
import _plotly_utils.basevalidators class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="bordercolor", parent_name="sankey.hoverlabel", **kwargs ): super(BordercolorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, array_ok=kwargs.pop("array_ok", True), edit_type=kwargs.pop("edit_type", "calc"), **kwargs )
plotly/plotly.py
packages/python/plotly/plotly/validators/sankey/hoverlabel/_bordercolor.py
Python
mit
482
33.428571
82
0.609959
false
# Si se lleva a cabo un docker build de portal-andino sin el parámetro "--build-arg IMAGE_VERSION={versión de portal-base}, se usa el ARG IMAGE_VERSION por default ARG IMAGE_VERSION=release-0.11.3 FROM datosgobar/portal-base:$IMAGE_VERSION MAINTAINER Leandro Gomez<lgomez@devartis.com> ARG PORTAL_VERSION ENV CKAN_HOME /usr/lib/ckan/default ENV CKAN_DIST_MEDIA /usr/lib/ckan/default/src/ckanext-gobar-theme/ckanext/gobar_theme/public/user_images ENV CKAN_DEFAULT /etc/ckan/default WORKDIR /portal # portal-andino-theme RUN $CKAN_HOME/bin/pip install -e git+https://github.com/datosgobar/portal-andino-theme.git@0c4b0021bde0e312505e0e4ff90a2d017c755f98#egg=ckanext-gobar_theme && \ $CKAN_HOME/bin/pip install -r $CKAN_HOME/src/ckanext-gobar-theme/requirements.txt && \ /etc/ckan_init.d/build-combined-ckan-mo.sh $CKAN_HOME/src/ckanext-gobar-theme/ckanext/gobar_theme/i18n/es/LC_MESSAGES/ckan.po # Series de Tiempo Ar explorer RUN $CKAN_HOME/bin/pip install -e git+https://github.com/datosgobar/ckanext-seriestiempoarexplorer.git@2.8.1#egg=ckanext-seriestiempoarexplorer # DCAT dependencies (el plugin se instala desde el `requirements.txt` de portal-andino-theme) RUN $CKAN_HOME/bin/pip install -r $CKAN_HOME/src/ckanext-dcat/requirements.txt RUN mkdir -p $CKAN_DIST_MEDIA RUN chown -R www-data:www-data $CKAN_DIST_MEDIA RUN chmod u+rwx $CKAN_DIST_MEDIA RUN echo "$PORTAL_VERSION" > /portal/version RUN mkdir -p /var/lib/ckan/theme_config/templates RUN cp $CKAN_HOME/src/ckanext-gobar-theme/ckanext/gobar_theme/templates/seccion-acerca.html /var/lib/ckan/theme_config/templates VOLUME $CKAN_DIST_MEDIA $CKAN_DEFAULT
datosgobar/portal-andino
Dockerfile
Dockerfile
mit
1,633
49.96875
163
0.786021
false
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace jaytwo.Common.Futures.Numbers { public static class MathUtility { public static double StandardDeviation(IEnumerable<double> data) { var average = data.Average(); var individualDeviations = data.Select(x => Math.Pow(x - average, 2)); return Math.Sqrt(individualDeviations.Average()); } public static double StandardDeviation(params double[] data) { return StandardDeviation((IEnumerable<double>)data); } } }
jakegough/jaytwo.CommonLib
CommonLib.Futures/Numbers/MathUtility.cs
C#
mit
534
23.227273
73
0.742481
false
using FFImageLoading.Forms.Sample.WinPhoneSL.Resources; namespace FFImageLoading.Forms.Sample.WinPhoneSL { /// <summary> /// Provides access to string resources. /// </summary> public class LocalizedStrings { private static AppResources _localizedResources = new AppResources(); public AppResources LocalizedResources { get { return _localizedResources; } } } }
AndreiMisiukevich/FFImageLoading
samples/ImageLoading.Forms.Sample/WinPhoneSL/FFImageLoading.Forms.Sample.WinPhoneSL/LocalizedStrings.cs
C#
mit
407
27.928571
86
0.706173
false
package com.aws.global.dao; import java.util.ArrayList; import com.aws.global.classes.Pizza; import com.aws.global.common.base.BaseDAO; import com.aws.global.mapper.PizzaRowMapper; public class PizzaDAO extends BaseDAO{ //SQL Statement when user adds a pizza to his inventory public void addPizza(String pizzaName, int pizzaPrice) { String sql = "INSERT INTO PIZZA (pizza_id, pizza_name, pizza_price) VALUES (NULL, ?, ?);"; getJdbcTemplate().update(sql, new Object[] { pizzaName, pizzaPrice}); } //SQL Statement when user wants to get a list of pizzas public ArrayList<Pizza> getAllPizza() { String sql = "SELECT * FROM Pizza"; ArrayList<Pizza> pizzas = (ArrayList<Pizza>) getJdbcTemplate().query(sql, new PizzaRowMapper()); return pizzas; } //SQL Statement when user wants to get a pizza record using a pizza id public Pizza getPizzaById(int id) { String sql = "SELECT * FROM PIZZA WHERE pizza_id = ?"; Pizza pizza = (Pizza)getJdbcTemplate().queryForObject( sql, new Object[] { id }, new PizzaRowMapper()); return pizza; } //SQL Statement when user wants to update a certain pizza's information public void editPizza(String pizza_name, int pizza_price, int id) { String sql = "UPDATE PIZZA SET pizza_name = ?, pizza_price = ? WHERE pizza_id = ?;"; getJdbcTemplate().update(sql, new Object[] { pizza_name, pizza_price, id }); } //SQL Statement when user wants to delete a pizza information public void deletePizza(int id) { String sql = "DELETE FROM PIZZA WHERE pizza_id = ?"; getJdbcTemplate().update(sql, new Object[] { id }); } }
sethbusque/pizzaccio
src_custom/com/aws/global/dao/PizzaDAO.java
Java
mit
1,598
31.612245
98
0.711514
false
#ifdef __OBJC__ #import <UIKit/UIKit.h> #endif #import "DataStatistic.h" #import "TalkingData.h" #import "TalkingDataSMS.h" FOUNDATION_EXPORT double DataStatisticVersionNumber; FOUNDATION_EXPORT const unsigned char DataStatisticVersionString[];
howardhou/DataStatistic
Example/Pods/Target Support Files/DataStatistic/DataStatistic-umbrella.h
C
mit
248
21.545455
67
0.794355
false
var test = require('./tape') var mongojs = require('../index') test('should export bson types', function (t) { t.ok(mongojs.Binary) t.ok(mongojs.Code) t.ok(mongojs.DBRef) t.ok(mongojs.Double) t.ok(mongojs.Long) t.ok(mongojs.MinKey) t.ok(mongojs.MaxKey) t.ok(mongojs.ObjectID) t.ok(mongojs.ObjectId) t.ok(mongojs.Symbol) t.ok(mongojs.Timestamp) t.ok(mongojs.Decimal128) t.end() })
mafintosh/mongojs
test/test-expose-bson-types.js
JavaScript
mit
408
20.473684
47
0.676471
false
class SuchStreamingBot class << self def matches? text !!(text =~ /hello world/) end end end
coleww/twitter_bot_generator
such_streaming_bot/src/such_streaming_bot.rb
Ruby
mit
115
9.454545
31
0.582609
false
# Frontend de NOMS/NMX/Normas Los tres frontend se encuentran en ramas distintas de desarrollo: * master ---> http://noms.imco.org.mx * nmx ---> http://nmx.imco.org.mx * normas ---> http://normas.imco.org.mx Para cambiar de ramas utilice el comando de GIT `git checkout ${BRANCH}` La construcción del sitio de despliege se ejecuta en la carpeta `frontend` > #### NOTA: > Cada sitio debe construirse desde su rama de forma individual. ## Build & development Run `grunt` for building and `grunt serve` for preview. ## Testing Running `grunt test` will run the unit tests with karma.
imco/nmx
frontend/README.md
Markdown
mit
603
25.173913
74
0.709302
false
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Les informations générales relatives à un assembly dépendent de // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations // associées à un assembly. [assembly: AssemblyTitle("Client")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Client")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly // aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de // COM, affectez la valeur true à l'attribut ComVisible sur ce type. [assembly: ComVisible(false)] // Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM [assembly: Guid("210de826-2c8c-4023-a45b-777ce845b803")] // Les informations de version pour un assembly se composent des quatre valeurs suivantes : // // Version principale // Version secondaire // Numéro de build // Révision // // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
Monkios/ClientServerGame
ConsoleClient/Properties/AssemblyInfo.cs
C#
mit
1,546
40.25
103
0.73044
false
package com.instaclick.filter; /** * Defines a behavior that should be implement by all filter * * @author Fabio B. Silva <fabio.bat.silva@gmail.com> */ public interface DataFilter { /** * Adds the given {@link Data} if it does not exists * * @param data * * @return <b>TRUE</b> if the the {@link Data} does not exists; <b>FALSE</b> otherwise */ public boolean add(Data data); /** * Check if the given {@link Data} exists * * @param data * * @return <b>TRUE</b> if the the {@link Data} does not exists; <b>FALSE</b> otherwise */ public boolean contains(Data data); /** * Flushes the filter data, this operation should be invoked at the end of the filter */ public void flush(); }
instaclick/PDI-Plugin-Step-BloomFilter
ic-filter/src/main/java/com/instaclick/filter/DataFilter.java
Java
mit
780
23.40625
90
0.602564
false
#include <bits/stdc++.h> using namespace std; int count_consecutive(string &s, int n, int k, char x) { int mx_count = 0; int x_count = 0; int curr_count = 0; int l = 0; int r = 0; while (r < n) { if (x_count <= k) { if (s[r] == x) x_count++; r++; curr_count++; if (s[r-1] != x) mx_count = max(mx_count, curr_count); } else { if (s[l] == x) { x_count--; } l++; curr_count--; } } if (s[s.size()-1] == x && x_count) mx_count++; return mx_count; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n, k; string s; cin >> n >> k; cin >> s; cout << max(count_consecutive(s, n, k, 'b'), count_consecutive(s, n, k, 'a')) << endl; return 0; }
sazid/codes
problem_solving/codeforces/676C.cpp
C++
mit
881
16.979592
90
0.415437
false
# Expectacle [![Gem Version](https://badge.fury.io/rb/expectacle.svg)](https://badge.fury.io/rb/expectacle) Expectacle ("expect + spectacle") is a small wrapper of `pty`/`expect`. It can send commands (command-list) to hosts (including network devices etc) using telnet/ssh session. Expectacle is portable (instead of less feature). Because it depends on only standard modules (YAML, ERB, PTY, Expect and Logger). It can work on almost ruby(>2.2) system without installation other gems. (probably...) ## Installation Add this line to your application's Gemfile: ```ruby gem 'expectacle' ``` And then execute: $ bundle Or install it yourself as: $ gem install expectacle ## Usage ### Send commands to hosts See [exe/run_command](./exe/run_command) and [vendor directory](./vendor). `run_command` can send commands to hosts with `-r`/`--run` option. $ bundle exec run_command -r -h l2switch.yml -c cisco_show_arp.yml - See details of command line options with `--help` option. - [l2switch.yml](./vendor/hosts/l2switch.yml) is host-list file. It is a data definitions for each hosts to send commands. - At username and password (login/enable) parameter, you can write environment variables with ERB manner to avoid write raw login information. - [exe/readne](./exe/readne) is a small bash script to set environment variable in your shell. ``` $ export L2SW_USER=`./exe/readne` Input: (type username) $ export L2SW_PASS=`./exe/readne` Input: (type password) ``` - `Expectacle::Thrower` read prompt-file by "type" parameter in host-list file. - In prompt-file, prompt regexps that used for interactive operation to host are defined. (These regexp are common information for some host-groups. (vendor, OS, ...)) - Prompt-file is searched by filename: `#{type}_prompt.yml` from [prompts directory](./vendor/prompts). `type` parameter defined in host-list file. - [cisco_show_arp.yml](./vendor/commands/cisco_show_arp.yml) is command-list file. - it is a list of commands. - Each files are written by YAML. ### Parameter expansion and preview Expectacle has parameter expansion feature using ERB. In a command list file, you can write command strings including environment variable and parameters defined in host file. See [Parameter definitions](#parameter-definitions) section about details of parameter expansion feature. Thereby, there are some risks sending danger commands by using wrong parameter and command definitions. Then, you can preview expanded command strings to send a host and parameters before execute actually. For Example: ``` stereocat@tftpserver:~/expectacle$ bundle exec run_command -p -h l2switch.yml -c cisco_save_config_tftp.yml --- :spawn_cmd: ssh -o StrictHostKeyChecking=no -o KexAlgorithms=+diffie-hellman-group1-sha1 -l cisco 192.168.20.150 :prompt: :password: "^Password\\s*:" :username: "^Username\\s*:" :sub1: "\\][:\\?]" :sub2: "\\[confirm\\]" :yn: "\\[yes\\/no\\]:" :command1: "^[\\w\\-]+>" :command2: "^[\\w\\-]+(:?\\(config\\))?\\#" :enable_password: SAME_AS_LOGIN_PASSWORD :enable_command: enable :host: :hostname: l2sw1 :type: c3750g :ipaddr: 192.168.20.150 :protocol: ssh :username: cisco :password: ******** :enable: ******** :tftp_server: 192.168.20.170 :commands: - copy run start - copy run tftp://192.168.20.170/l2sw1.confg --- (snip) ``` **Notice** : Passwords were masked above example, but actually, raw password strings are printed out. ### Change place of log message With `-l`/`--logfile`, [run_command](./exe/run_command) changes logging IO to file instead of standard-out (default). $ bundle exec run_command -r -l foo.log -h l2switch.yml -c cisco_show_arp.yml With `-s`/`--syslog`, [run_command](./exe/run_command) changes logging instance to `syslog/logger`. So, log messages are printed out to syslog on localhost. $ bundle exec run_command -rs -h l2switch.yml -c cisco_show_arp.yml **Notice** : When specified `--logfile` and `--syslog` at the same time, `--syslog` is used to logging. ### Quiet mode With `-q`/`--quiet`, [run_command](./exe/run_command) stop printing out results received from a host to standard out. For example: $ bundle exec run_command -rq -h l2switch.yml -c cisco_show_arp.yml the command prints only log message (without host output) to standard out. If you use options syslog(`-s`) and quiet(`-q`), there is nothing to be appeared in terminal (standard out). $ bundle exec run_command -rqs -h l2switch.yml -c cisco_show_arp.yml ## Parameter Definitions ### Expectacle::Thrower `Expectacle::Thrower` argument description. - `:timeout` : (Optional) Timeout interval (sec) to connect a host. (default: 60sec) - `:verbose` : (Optional) When `:verbose` is `false`, `Expectacle` does not output spawned process input/output to standard-out(`$stdout`). (default: `true`) - `:base_dir`: (Optional) Base path to search host/prompt/command files. (default: current working directory (`Dir.pwd`)) - `#{base_dir}/commands`: command-list file directory. - `#{base_dir}/prompts` : prompt-file directory. - `#{base_dir}/hosts` : host-file directory. - `:logger` : (Optional) IO object to logging `Expectacle` operations. (default: `$stdout`) **Notice** : When `Expectacle` success to connect(spawn) host, it will change the user mode to privilege (root/super-user/enable) at first, ASAP. All commands are executed with privilege mode at the host. ### Host-list parameter Host-list file is a list of host-parameters. - `:hostname`: Indication String of host name. - `:type`: Host type (used to choose prompt-file). - `:ipaddr`: IP(v4) address to connect host. - `:protocol`: Protocol to connect host. (telnet or ssh) - `:username`: Login name. - `:password`: Login password. - `:enable`: Password to be privilege mode. It can use ERB to set values from environment variable in `:username`, `:password` and `:enable`. You can add other parameter(s) to refer in command-list files. See also: [Command list](#command-list-with-erb) section. ### Prompt parameter Prompt file is a table of prompt regexp of host group(type). - `:password`: Login password prompt - `:username`: Login username prompt - `:sub1`: Sub command prompt - `:sub2`: Sub command prompt - `:yn`: Yes/No prompt - `:command1`: Command prompt (normal mode) - `:command2`: Command prompt (privilege mode) - `enable_password`: Enable password prompt - `enable_command`: command to be privilege mode (Only this parameter is not a "prompt regexp") ### Command list with ERB Command-list is a simple list of command-string. A command-string can contain host-parameter reference by ERB. For example, if you want to save configuration of a Cisco device to tftp server: - Add a parameter to tftp server info (IP address) in [host-list file](vendor/hosts/l2switch.yml). ```YAML - :hostname : 'l2sw1' :type : 'c3750g' :ipaddr : '192.168.20.150' :protocol : 'ssh' :username : "<%= ENV['L2SW_USER'] %>" :password : "<%= ENV['L2SW_PASS'] %>" :enable : "<%= ENV['L2SW_PASS'] %>" :tftp_server: '192.168.20.170' - :hostname : 'l2sw2' :type : 'c3750g' :ipaddr : '192.168.20.151' :protocol : 'ssh' :username : "<%= ENV['L2SW_USER'] %>" :password : "<%= ENV['L2SW_PASS'] %>" :enable : "<%= ENV['L2SW_PASS'] %>" :tftp_server: '192.168.20.170' ``` - Write [command-list file](vendor/commands/cisco_save_config_tftp.yml) using ERB. When send a command to host, ERB string was evaluated in `Expectacle::Thrower` bindings. Then, it can refer host-parameter as `@host_param` hash. - When exec below command-list, host configuration will be saved a file as `l2sw1.confg` on tftp server. - See also: [parameter preview](#parameter-expansion-and-preview) section. ```YAML - "copy run start" - "copy run tftp://<%= @host_param[:tftp_server] %>/<%= @host_param[:hostname] %>.confg" ``` ## Default SSH Options When use `ssh` (OpenSSH) command to spawn device, the user can set options for the command via `#{base_dir}/opts/ssh_opts.yml`. With options as list in [ssh_opts.yml](./vendor/opts/ssh_opts.yml), ``` - '-o StrictHostKeyChecking=no' - '-o KexAlgorithms=+diffie-hellman-group1-sha1' - '-o Ciphers=+aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc' ``` it works same as `~/.ssh/config` below. ``` Host * StrictHostKeyChecking no KexAlgorithms +diffie-hellman-group1-sha1 Ciphers +aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc ``` ## Use Local Serial Port Expectacle can handle `cu` (call up another system) command to operate via device local serial port. At first, install `cu`. If you use Ubuntu, install it with `apt`. ``` sudo apt install cu ``` Next, set parameter `:protocol` to `cu`, and write `cu` command options as `:cu_opts`. Usually, one serial port correspond to one device. So host parameter `:cu_opts` is used as options to connect a host via serial port. For example: ``` - :hostname : 'l2sw1' :type : 'c3750g' :protocol : 'cu' :cu_opts : '-l /dev/ttyUSB0 -s 9600' ``` File `#{base_dir}/opts/cu_opts.yml` has default options for `cu` command. At last, execute by `run_command` with `sudo`. Because it requires superuser permission to handle local device. ``` sudo -E bundle exec run_command -r -h l2switch.yml -c cisco_show_version.yml ``` **Notice** : Without `sudo -E` (`--preserve-env`) option, it do not preserve environment variables such as username/password and others you defined. ## TODO ### Sub prompt operation (interactive command) Feature for sub-prompt (interactive command) is not enough. Now, Expectacle sends fixed command for sub-prompt. (These actions were defined for cisco to execute above "copy run" example...) - Yex/No (`:yn`) : always sends "yes" - Sub prompt (`:sub1` and `:sub2`) : always sends Empty string (RETURN) ### Error handling Expectacle does not have error message handling feature. If a host returns a error message when expectacle sent a command, then expectacle ignores it and continue sending rest commands (until command list is empty). ## Contributing Bug reports and pull requests are welcome on GitHub at <https://github.com/stereocat/expectacle>. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
stereocat/expectacle
README.md
Markdown
mit
10,236
36.221818
233
0.707894
false
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"> <title>font-image test</title> <script src="../../webcomponentsjs/webcomponents-lite.js"></script> <script src="../../web-component-tester/browser.js"></script> <link rel="import" href="../font-image.html"> </head> <body> <test-fixture id="basic"> <template> <font-image></font-image> </template> </test-fixture> <script> suite('font-image', function() { test('instantiating the element works', function() { var element = fixture('basic'); assert.equal(element.is, 'font-image'); }); }); </script> </body> </html>
ryanburns23/font-image
test/font-image_test.html
HTML
mit
802
25.733333
108
0.583541
false
using BaxterWorks.B2.Exceptions; using BaxterWorks.B2.Types; namespace BaxterWorks.B2.Extensions { public static class BucketExtensions { public static Bucket GetOrCreateBucket(this ServiceStackB2Api client, CreateBucketRequest request) { try { return client.CreateBucket(request); } catch (DuplicateBucketException) //todo: there are other ways this could fail { return client.GetBucketByName(request.BucketName); } } /// <summary> /// Get an existing bucket, or create a new one if it doesn't exist. Defaults to a private bucket /// </summary> /// <param name="client"></param> /// <param name="bucketName"></param> /// <returns><see cref="Bucket"/></returns> public static Bucket GetOrCreateBucket(this ServiceStackB2Api client, string bucketName) { try { return client.CreateBucket(bucketName); } catch (DuplicateBucketException) //todo: there are other ways this could fail { return client.GetBucketByName(bucketName); } } public static Bucket OverwriteBucket(this ServiceStackB2Api client, CreateBucketRequest request, bool deleteFiles = false) { try { return client.CreateBucket(request); } catch (DuplicateBucketException) //todo: there are other ways this could fail { Bucket targetBucket = client.GetBucketByName(request.BucketName); if (deleteFiles) { client.DeleteBucketRecursively(targetBucket); } else { client.DeleteBucket(targetBucket); } return client.CreateBucket(request); } } } }
voltagex/b2-csharp
BaxterWorks.B2/Extensions/BucketExtensions.cs
C#
mit
2,003
32.366667
130
0.547726
false
.favorites-container{ margin-top: 16px; min-height: 350px; padding-bottom: 30px; font-family: Helvetica, Verdana; border-radius: 2px; background: rgba(255,255,255,0.8); border: solid 2px rgba(255,255,255,0.3); -webkit-box-shadow: 2px 2px 5px rgba(0,0,0,0.2); -moz-box-shadow: 2px 2px 5px rgba(0,0,0,0.2); box-shadow: 2px 2px 5px rgba(0,0,0,0.2); } .favorites-container p { color: #50737a; margin-left: 40px; margin-top: 20px; } .cat-small.favorite{ display: inline-block; margin-left: 10px; margin-top: 10px; } .cat-small.favorite .image img { } a.credit { display:block; font-size: 11px; font-family: Arial,Helvetica,sans-serif; color: #999; position: absolute; bottom: 6px; right: 7px; } a.credit:hover{ color: #fff; }
mdimitrov/oldcrafts
css/favorites.css
CSS
mit
808
18.731707
52
0.636139
false
/* * The MIT License * * Copyright 2017 Arnaud Hamon * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.github.ptitnoony.components.fxtreemap; import java.beans.PropertyChangeListener; import java.util.List; /** * * @author ahamon */ public interface MapData { /** * Data type that represents whether a data is represents a single object * (ie LEAF) or an aggregation of objects (ie NODE) */ enum DataType { LEAF, NODE }; DataType getType(); /** * Get the data value. * * @return the data value */ double getValue(); /** * Set the data value. If the data has children data, their value will be * set with the same percentage of the value they use to have before the * setValue is applied. The value must be equal or greater to 0. * * @param newValue the new data value */ void setValue(double newValue); /** * Get the data name. * * @return the data name */ String getName(); /** * Set the data name. * * @param newName the new data name */ void setName(String newName); /** * If the data is an aggregation of children data. * * @return if the data is an aggregation of children data */ boolean hasChildrenData(); /** * Get the children aggregated data if any. * * @return the list of aggregated data */ List<MapData> getChildrenData(); /** * Add a child data. If the data had no child before, adding a child data * will override the previously set data value. * * @param data the data to be added as a child data to aggregate */ void addChildrenData(MapData data); /** * Remove a child data. * * @param data the data to be removed */ void removeChildrenData(MapData data); /** * Add a property change listener. * * @param listener the listener to be added */ void addPropertyChangeListener(PropertyChangeListener listener); /** * Remove a property change listener. * * @param listener the listener to be removed */ void removePropertyChangeListener(PropertyChangeListener listener); }
PtitNoony/FxTreeMap
src/main/java/com/github/ptitnoony/components/fxtreemap/MapData.java
Java
mit
3,281
26.805085
80
0.662908
false
# Potrubi gemName = 'potrubi' #requireList = %w(mixin/bootstrap) #requireList.each {|r| require_relative "#{gemName}/#{r}"} __END__
ianrumford/potrubi
lib/potrubi/potrubi.rb
Ruby
mit
137
12.7
58
0.649635
false
import numpy as np import warnings from .._explainer import Explainer from packaging import version torch = None class PyTorchDeep(Explainer): def __init__(self, model, data): # try and import pytorch global torch if torch is None: import torch if version.parse(torch.__version__) < version.parse("0.4"): warnings.warn("Your PyTorch version is older than 0.4 and not supported.") # check if we have multiple inputs self.multi_input = False if type(data) == list: self.multi_input = True if type(data) != list: data = [data] self.data = data self.layer = None self.input_handle = None self.interim = False self.interim_inputs_shape = None self.expected_value = None # to keep the DeepExplainer base happy if type(model) == tuple: self.interim = True model, layer = model model = model.eval() self.layer = layer self.add_target_handle(self.layer) # if we are taking an interim layer, the 'data' is going to be the input # of the interim layer; we will capture this using a forward hook with torch.no_grad(): _ = model(*data) interim_inputs = self.layer.target_input if type(interim_inputs) is tuple: # this should always be true, but just to be safe self.interim_inputs_shape = [i.shape for i in interim_inputs] else: self.interim_inputs_shape = [interim_inputs.shape] self.target_handle.remove() del self.layer.target_input self.model = model.eval() self.multi_output = False self.num_outputs = 1 with torch.no_grad(): outputs = model(*data) # also get the device everything is running on self.device = outputs.device if outputs.shape[1] > 1: self.multi_output = True self.num_outputs = outputs.shape[1] self.expected_value = outputs.mean(0).cpu().numpy() def add_target_handle(self, layer): input_handle = layer.register_forward_hook(get_target_input) self.target_handle = input_handle def add_handles(self, model, forward_handle, backward_handle): """ Add handles to all non-container layers in the model. Recursively for non-container layers """ handles_list = [] model_children = list(model.children()) if model_children: for child in model_children: handles_list.extend(self.add_handles(child, forward_handle, backward_handle)) else: # leaves handles_list.append(model.register_forward_hook(forward_handle)) handles_list.append(model.register_backward_hook(backward_handle)) return handles_list def remove_attributes(self, model): """ Removes the x and y attributes which were added by the forward handles Recursively searches for non-container layers """ for child in model.children(): if 'nn.modules.container' in str(type(child)): self.remove_attributes(child) else: try: del child.x except AttributeError: pass try: del child.y except AttributeError: pass def gradient(self, idx, inputs): self.model.zero_grad() X = [x.requires_grad_() for x in inputs] outputs = self.model(*X) selected = [val for val in outputs[:, idx]] grads = [] if self.interim: interim_inputs = self.layer.target_input for idx, input in enumerate(interim_inputs): grad = torch.autograd.grad(selected, input, retain_graph=True if idx + 1 < len(interim_inputs) else None, allow_unused=True)[0] if grad is not None: grad = grad.cpu().numpy() else: grad = torch.zeros_like(X[idx]).cpu().numpy() grads.append(grad) del self.layer.target_input return grads, [i.detach().cpu().numpy() for i in interim_inputs] else: for idx, x in enumerate(X): grad = torch.autograd.grad(selected, x, retain_graph=True if idx + 1 < len(X) else None, allow_unused=True)[0] if grad is not None: grad = grad.cpu().numpy() else: grad = torch.zeros_like(X[idx]).cpu().numpy() grads.append(grad) return grads def shap_values(self, X, ranked_outputs=None, output_rank_order="max", check_additivity=False): # X ~ self.model_input # X_data ~ self.data # check if we have multiple inputs if not self.multi_input: assert type(X) != list, "Expected a single tensor model input!" X = [X] else: assert type(X) == list, "Expected a list of model inputs!" X = [x.detach().to(self.device) for x in X] if ranked_outputs is not None and self.multi_output: with torch.no_grad(): model_output_values = self.model(*X) # rank and determine the model outputs that we will explain if output_rank_order == "max": _, model_output_ranks = torch.sort(model_output_values, descending=True) elif output_rank_order == "min": _, model_output_ranks = torch.sort(model_output_values, descending=False) elif output_rank_order == "max_abs": _, model_output_ranks = torch.sort(torch.abs(model_output_values), descending=True) else: assert False, "output_rank_order must be max, min, or max_abs!" model_output_ranks = model_output_ranks[:, :ranked_outputs] else: model_output_ranks = (torch.ones((X[0].shape[0], self.num_outputs)).int() * torch.arange(0, self.num_outputs).int()) # add the gradient handles handles = self.add_handles(self.model, add_interim_values, deeplift_grad) if self.interim: self.add_target_handle(self.layer) # compute the attributions output_phis = [] for i in range(model_output_ranks.shape[1]): phis = [] if self.interim: for k in range(len(self.interim_inputs_shape)): phis.append(np.zeros((X[0].shape[0], ) + self.interim_inputs_shape[k][1: ])) else: for k in range(len(X)): phis.append(np.zeros(X[k].shape)) for j in range(X[0].shape[0]): # tile the inputs to line up with the background data samples tiled_X = [X[l][j:j + 1].repeat( (self.data[l].shape[0],) + tuple([1 for k in range(len(X[l].shape) - 1)])) for l in range(len(X))] joint_x = [torch.cat((tiled_X[l], self.data[l]), dim=0) for l in range(len(X))] # run attribution computation graph feature_ind = model_output_ranks[j, i] sample_phis = self.gradient(feature_ind, joint_x) # assign the attributions to the right part of the output arrays if self.interim: sample_phis, output = sample_phis x, data = [], [] for k in range(len(output)): x_temp, data_temp = np.split(output[k], 2) x.append(x_temp) data.append(data_temp) for l in range(len(self.interim_inputs_shape)): phis[l][j] = (sample_phis[l][self.data[l].shape[0]:] * (x[l] - data[l])).mean(0) else: for l in range(len(X)): phis[l][j] = (torch.from_numpy(sample_phis[l][self.data[l].shape[0]:]).to(self.device) * (X[l][j: j + 1] - self.data[l])).cpu().detach().numpy().mean(0) output_phis.append(phis[0] if not self.multi_input else phis) # cleanup; remove all gradient handles for handle in handles: handle.remove() self.remove_attributes(self.model) if self.interim: self.target_handle.remove() if not self.multi_output: return output_phis[0] elif ranked_outputs is not None: return output_phis, model_output_ranks else: return output_phis # Module hooks def deeplift_grad(module, grad_input, grad_output): """The backward hook which computes the deeplift gradient for an nn.Module """ # first, get the module type module_type = module.__class__.__name__ # first, check the module is supported if module_type in op_handler: if op_handler[module_type].__name__ not in ['passthrough', 'linear_1d']: return op_handler[module_type](module, grad_input, grad_output) else: print('Warning: unrecognized nn.Module: {}'.format(module_type)) return grad_input def add_interim_values(module, input, output): """The forward hook used to save interim tensors, detached from the graph. Used to calculate the multipliers """ try: del module.x except AttributeError: pass try: del module.y except AttributeError: pass module_type = module.__class__.__name__ if module_type in op_handler: func_name = op_handler[module_type].__name__ # First, check for cases where we don't need to save the x and y tensors if func_name == 'passthrough': pass else: # check only the 0th input varies for i in range(len(input)): if i != 0 and type(output) is tuple: assert input[i] == output[i], "Only the 0th input may vary!" # if a new method is added, it must be added here too. This ensures tensors # are only saved if necessary if func_name in ['maxpool', 'nonlinear_1d']: # only save tensors if necessary if type(input) is tuple: setattr(module, 'x', torch.nn.Parameter(input[0].detach())) else: setattr(module, 'x', torch.nn.Parameter(input.detach())) if type(output) is tuple: setattr(module, 'y', torch.nn.Parameter(output[0].detach())) else: setattr(module, 'y', torch.nn.Parameter(output.detach())) if module_type in failure_case_modules: input[0].register_hook(deeplift_tensor_grad) def get_target_input(module, input, output): """A forward hook which saves the tensor - attached to its graph. Used if we want to explain the interim outputs of a model """ try: del module.target_input except AttributeError: pass setattr(module, 'target_input', input) # From the documentation: "The current implementation will not have the presented behavior for # complex Module that perform many operations. In some failure cases, grad_input and grad_output # will only contain the gradients for a subset of the inputs and outputs. # The tensor hook below handles such failure cases (currently, MaxPool1d). In such cases, the deeplift # grad should still be computed, and then appended to the complex_model_gradients list. The tensor hook # will then retrieve the proper gradient from this list. failure_case_modules = ['MaxPool1d'] def deeplift_tensor_grad(grad): return_grad = complex_module_gradients[-1] del complex_module_gradients[-1] return return_grad complex_module_gradients = [] def passthrough(module, grad_input, grad_output): """No change made to gradients""" return None def maxpool(module, grad_input, grad_output): pool_to_unpool = { 'MaxPool1d': torch.nn.functional.max_unpool1d, 'MaxPool2d': torch.nn.functional.max_unpool2d, 'MaxPool3d': torch.nn.functional.max_unpool3d } pool_to_function = { 'MaxPool1d': torch.nn.functional.max_pool1d, 'MaxPool2d': torch.nn.functional.max_pool2d, 'MaxPool3d': torch.nn.functional.max_pool3d } delta_in = module.x[: int(module.x.shape[0] / 2)] - module.x[int(module.x.shape[0] / 2):] dup0 = [2] + [1 for i in delta_in.shape[1:]] # we also need to check if the output is a tuple y, ref_output = torch.chunk(module.y, 2) cross_max = torch.max(y, ref_output) diffs = torch.cat([cross_max - ref_output, y - cross_max], 0) # all of this just to unpool the outputs with torch.no_grad(): _, indices = pool_to_function[module.__class__.__name__]( module.x, module.kernel_size, module.stride, module.padding, module.dilation, module.ceil_mode, True) xmax_pos, rmax_pos = torch.chunk(pool_to_unpool[module.__class__.__name__]( grad_output[0] * diffs, indices, module.kernel_size, module.stride, module.padding, list(module.x.shape)), 2) org_input_shape = grad_input[0].shape # for the maxpool 1d grad_input = [None for _ in grad_input] grad_input[0] = torch.where(torch.abs(delta_in) < 1e-7, torch.zeros_like(delta_in), (xmax_pos + rmax_pos) / delta_in).repeat(dup0) if module.__class__.__name__ == 'MaxPool1d': complex_module_gradients.append(grad_input[0]) # the grad input that is returned doesn't matter, since it will immediately be # be overridden by the grad in the complex_module_gradient grad_input[0] = torch.ones(org_input_shape) return tuple(grad_input) def linear_1d(module, grad_input, grad_output): """No change made to gradients.""" return None def nonlinear_1d(module, grad_input, grad_output): delta_out = module.y[: int(module.y.shape[0] / 2)] - module.y[int(module.y.shape[0] / 2):] delta_in = module.x[: int(module.x.shape[0] / 2)] - module.x[int(module.x.shape[0] / 2):] dup0 = [2] + [1 for i in delta_in.shape[1:]] # handles numerical instabilities where delta_in is very small by # just taking the gradient in those cases grads = [None for _ in grad_input] grads[0] = torch.where(torch.abs(delta_in.repeat(dup0)) < 1e-6, grad_input[0], grad_output[0] * (delta_out / delta_in).repeat(dup0)) return tuple(grads) op_handler = {} # passthrough ops, where we make no change to the gradient op_handler['Dropout3d'] = passthrough op_handler['Dropout2d'] = passthrough op_handler['Dropout'] = passthrough op_handler['AlphaDropout'] = passthrough op_handler['Conv1d'] = linear_1d op_handler['Conv2d'] = linear_1d op_handler['Conv3d'] = linear_1d op_handler['ConvTranspose1d'] = linear_1d op_handler['ConvTranspose2d'] = linear_1d op_handler['ConvTranspose3d'] = linear_1d op_handler['Linear'] = linear_1d op_handler['AvgPool1d'] = linear_1d op_handler['AvgPool2d'] = linear_1d op_handler['AvgPool3d'] = linear_1d op_handler['AdaptiveAvgPool1d'] = linear_1d op_handler['AdaptiveAvgPool2d'] = linear_1d op_handler['AdaptiveAvgPool3d'] = linear_1d op_handler['BatchNorm1d'] = linear_1d op_handler['BatchNorm2d'] = linear_1d op_handler['BatchNorm3d'] = linear_1d op_handler['LeakyReLU'] = nonlinear_1d op_handler['ReLU'] = nonlinear_1d op_handler['ELU'] = nonlinear_1d op_handler['Sigmoid'] = nonlinear_1d op_handler["Tanh"] = nonlinear_1d op_handler["Softplus"] = nonlinear_1d op_handler['Softmax'] = nonlinear_1d op_handler['MaxPool1d'] = maxpool op_handler['MaxPool2d'] = maxpool op_handler['MaxPool3d'] = maxpool
slundberg/shap
shap/explainers/_deep/deep_pytorch.py
Python
mit
16,170
39.730479
176
0.579221
false
using Lemonade.Data.Entities; namespace Lemonade.Data.Commands { public interface IUpdateFeature { void Execute(Feature feature); } }
thesheps/lemonade
src/Lemonade.Data/Commands/IUpdateFeature.cs
C#
mit
157
16.333333
38
0.696774
false
# We borrow heavily from the kernel build setup, though we are simpler since # we don't have Kconfig tweaking settings on us. # The implicit make rules have it looking for RCS files, among other things. # We instead explicitly write all the rules we care about. # It's even quicker (saves ~200ms) to pass -r on the command line. MAKEFLAGS=-r # The source directory tree. srcdir := .. abs_srcdir := $(abspath $(srcdir)) # The name of the builddir. builddir_name ?= . # The V=1 flag on command line makes us verbosely print command lines. ifdef V quiet= else quiet=quiet_ endif # Specify BUILDTYPE=Release on the command line for a release build. BUILDTYPE ?= Release # Directory all our build output goes into. # Note that this must be two directories beneath src/ for unit tests to pass, # as they reach into the src/ directory for data with relative paths. builddir ?= $(builddir_name)/$(BUILDTYPE) abs_builddir := $(abspath $(builddir)) depsdir := $(builddir)/.deps # Object output directory. obj := $(builddir)/obj abs_obj := $(abspath $(obj)) # We build up a list of every single one of the targets so we can slurp in the # generated dependency rule Makefiles in one pass. all_deps := CC.target ?= $(CC) CFLAGS.target ?= $(CFLAGS) CXX.target ?= $(CXX) CXXFLAGS.target ?= $(CXXFLAGS) LINK.target ?= $(LINK) LDFLAGS.target ?= $(LDFLAGS) AR.target ?= $(AR) # C++ apps need to be linked with g++. # # Note: flock is used to seralize linking. Linking is a memory-intensive # process so running parallel links can often lead to thrashing. To disable # the serialization, override LINK via an envrionment variable as follows: # # export LINK=g++ # # This will allow make to invoke N linker processes as specified in -jN. LINK ?= ./gyp-mac-tool flock $(builddir)/linker.lock $(CXX.target) # TODO(evan): move all cross-compilation logic to gyp-time so we don't need # to replicate this environment fallback in make as well. CC.host ?= gcc CFLAGS.host ?= CXX.host ?= g++ CXXFLAGS.host ?= LINK.host ?= $(CXX.host) LDFLAGS.host ?= AR.host ?= ar # Define a dir function that can handle spaces. # http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions # "leading spaces cannot appear in the text of the first argument as written. # These characters can be put into the argument value by variable substitution." empty := space := $(empty) $(empty) # http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces replace_spaces = $(subst $(space),?,$1) unreplace_spaces = $(subst ?,$(space),$1) dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) # Flags to make gcc output dependency info. Note that you need to be # careful here to use the flags that ccache and distcc can understand. # We write to a dep file on the side first and then rename at the end # so we can't end up with a broken dep file. depfile = $(depsdir)/$(call replace_spaces,$@).d DEPFLAGS = -MMD -MF $(depfile).raw # We have to fixup the deps output in a few ways. # (1) the file output should mention the proper .o file. # ccache or distcc lose the path to the target, so we convert a rule of # the form: # foobar.o: DEP1 DEP2 # into # path/to/foobar.o: DEP1 DEP2 # (2) we want missing files not to cause us to fail to build. # We want to rewrite # foobar.o: DEP1 DEP2 \ # DEP3 # to # DEP1: # DEP2: # DEP3: # so if the files are missing, they're just considered phony rules. # We have to do some pretty insane escaping to get those backslashes # and dollar signs past make, the shell, and sed at the same time. # Doesn't work with spaces, but that's fine: .d files have spaces in # their names replaced with other characters. define fixup_dep # The depfile may not exist if the input file didn't have any #includes. touch $(depfile).raw # Fixup path as in (1). sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) # Add extra rules as in (2). # We remove slashes and replace spaces with new lines; # remove blank lines; # delete the first line and append a colon to the remaining lines. sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ grep -v '^$$' |\ sed -e 1d -e 's|$$|:|' \ >> $(depfile) rm $(depfile).raw endef # Command definitions: # - cmd_foo is the actual command to run; # - quiet_cmd_foo is the brief-output summary of the command. quiet_cmd_cc = CC($(TOOLSET)) $@ cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_cxx = CXX($(TOOLSET)) $@ cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_objc = CXX($(TOOLSET)) $@ cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< quiet_cmd_objcxx = CXX($(TOOLSET)) $@ cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< # Commands for precompiled header files. quiet_cmd_pch_c = CXX($(TOOLSET)) $@ cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< quiet_cmd_pch_m = CXX($(TOOLSET)) $@ cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< # gyp-mac-tool is written next to the root Makefile by gyp. # Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd # already. quiet_cmd_mac_tool = MACTOOL $(4) $< cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) quiet_cmd_infoplist = INFOPLIST $@ cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" quiet_cmd_touch = TOUCH $@ cmd_touch = touch $@ quiet_cmd_copy = COPY $@ # send stderr to /dev/null to ignore messages when linking directories. cmd_copy = rm -rf "$@" && cp -af "$<" "$@" quiet_cmd_alink = LIBTOOL-STATIC $@ cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) quiet_cmd_link = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) quiet_cmd_solink = SOLINK($(TOOLSET)) $@ cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) # Define an escape_quotes function to escape single quotes. # This allows us to handle quotes properly as long as we always use # use single quotes and escape_quotes. escape_quotes = $(subst ','\'',$(1)) # This comment is here just to include a ' to unconfuse syntax highlighting. # Define an escape_vars function to escape '$' variable syntax. # This allows us to read/write command lines with shell variables (e.g. # $LD_LIBRARY_PATH), without triggering make substitution. escape_vars = $(subst $$,$$$$,$(1)) # Helper that expands to a shell command to echo a string exactly as it is in # make. This uses printf instead of echo because printf's behaviour with respect # to escape sequences is more portable than echo's across different shells # (e.g., dash, bash). exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' # Helper to compare the command we're about to run against the command # we logged the last time we ran the command. Produces an empty # string (false) when the commands match. # Tricky point: Make has no string-equality test function. # The kernel uses the following, but it seems like it would have false # positives, where one string reordered its arguments. # arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ # $(filter-out $(cmd_$@), $(cmd_$(1)))) # We instead substitute each for the empty string into the other, and # say they're equal if both substitutions produce the empty string. # .d files contain ? instead of spaces, take that into account. command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) # Helper that is non-empty when a prerequisite changes. # Normally make does this implicitly, but we force rules to always run # so we can check their command lines. # $? -- new prerequisites # $| -- order-only dependencies prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) # Helper that executes all postbuilds until one fails. define do_postbuilds @E=0;\ for p in $(POSTBUILDS); do\ eval $$p;\ E=$$?;\ if [ $$E -ne 0 ]; then\ break;\ fi;\ done;\ if [ $$E -ne 0 ]; then\ rm -rf "$@";\ exit $$E;\ fi endef # do_cmd: run a command via the above cmd_foo names, if necessary. # Should always run for a given target to handle command-line changes. # Second argument, if non-zero, makes it do asm/C/C++ dependency munging. # Third argument, if non-zero, makes it do POSTBUILDS processing. # Note: We intentionally do NOT call dirx for depfile, since it contains ? for # spaces already and dirx strips the ? characters. define do_cmd $(if $(or $(command_changed),$(prereq_changed)), @$(call exact_echo, $($(quiet)cmd_$(1))) @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" $(if $(findstring flock,$(word 2,$(cmd_$1))), @$(cmd_$(1)) @echo " $(quiet_cmd_$(1)): Finished", @$(cmd_$(1)) ) @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) @$(if $(2),$(fixup_dep)) $(if $(and $(3), $(POSTBUILDS)), $(call do_postbuilds) ) ) endef # Declare the "all" target first so it is the default, # even though we don't have the deps yet. .PHONY: all all: # make looks for ways to re-generate included makefiles, but in our case, we # don't have a direct way. Explicitly telling make that it has nothing to do # for them makes it go faster. %.d: ; # Use FORCE_DO_CMD to force a target to run. Should be coupled with # do_cmd. .PHONY: FORCE_DO_CMD FORCE_DO_CMD: TOOLSET := target # Suffix rules, putting all outputs into $(obj). $(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD @$(call do_cmd,objc,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD @$(call do_cmd,objcxx,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD @$(call do_cmd,cc,1) # Try building from generated source, too. $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD @$(call do_cmd,objc,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD @$(call do_cmd,objcxx,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD @$(call do_cmd,cxx,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD @$(call do_cmd,objc,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD @$(call do_cmd,objcxx,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD @$(call do_cmd,cc,1) $(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD @$(call do_cmd,cc,1) ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ $(findstring $(join ^,$(prefix)),\ $(join ^,validation.target.mk)))),) include validation.target.mk endif quiet_cmd_regen_makefile = ACTION Regenerating $@ cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/ericdowty/Techblog/apps/rails-pub-sub-node-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/ericdowty/.node-gyp/0.12.4/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/ericdowty/.node-gyp/0.12.4" "-Dmodule_root_dir=/Users/ericdowty/Techblog/apps/rails-pub-sub-node-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate" binding.gyp Makefile: $(srcdir)/../../../../../../../../../../../../../.node-gyp/0.12.4/common.gypi $(srcdir)/../../../../../../../../../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(call do_cmd,regen_makefile) # "all" is a concatenation of the "all" targets from all the included # sub-makefiles. This is just here to clarify. all: # Add in dependency-tracking rules. $(all_deps) is the list of every single # target in our tree. Only consider the ones with .d (dependency) info: d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) ifneq ($(d_files),) include $(d_files) endif
eric-dowty/eric-dowty.github.io
apps/rails-pub-sub-node-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate/build/Makefile
Makefile
mit
13,890
38.685714
844
0.656299
false
/* Misojs Codemirror component */ var m = require('mithril'), basePath = "external/codemirror/", pjson = require("./package.json"); // Here we have a few fixes to make CM work in node - we only setup each, // if they don't already exist, otherwise we would override the browser global.document = global.document || {}; global.document.createElement = global.document.createElement || function(){ return { setAttribute: function(){} }; }; global.window = global.window || {}; global.window.getSelection = global.window.getSelection || function(){ return false; }; global.navigator = global.navigator || {}; global.navigator.userAgent = global.navigator.userAgent || "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36"; // Grab code mirror and the javascript language // Note: you cannot dynamically require with browserify, // so we must get whatever modes we need here. // If you need other languages, simply equire them statically in your program. var CodeMirror = require('codemirror'); require("codemirror/mode/javascript/javascript.js"); require("codemirror/mode/htmlmixed/htmlmixed.js"); require("codemirror/mode/css/css.js"); // Our component var CodemirrorComponent = { // Returns a textarea view: function(ctrl, attrs) { return m("div", [ // It is ok to include CSS here - the browser will cache it, // though a more ideal setup would be the ability to load only // once when required. m("LINK", { href: basePath + "lib/codemirror.css", rel: "stylesheet"}), m("textarea", {config: CodemirrorComponent.config(attrs)}, attrs.value()) ]); }, config: function(attrs) { return function(element, isInitialized) { if(typeof CodeMirror !== 'undefined') { if (!isInitialized) { var editor = CodeMirror.fromTextArea(element, { lineNumbers: true }); editor.on("change", function(instance, object) { m.startComputation(); attrs.value(editor.doc.getValue()); if (typeof attrs.onchange == "function"){ attrs.onchange(instance, object); } m.endComputation(); }); } } else { console.warn('ERROR: You need Codemirror in the page'); } }; } }; // Allow the user to pass in arguments when loading. module.exports = function(args){ if(args && args.basePath) { basePath = args.basePath; } return CodemirrorComponent; };
jsguy/misojs-codemirror-component
codemirror.component.js
JavaScript
mit
2,410
31.581081
183
0.688797
false
// github package provides an API client for github.com // // Copyright (C) 2014 Yohei Sasaki // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // package github import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" "strconv" "time" ) const BaseUrl = "https://api.github.com" type Client struct { RateLimit int RateLimitRemaining int RateLimitReset time.Time baseUrl string client *http.Client } func NewClient(c *http.Client) *Client { return &Client{ baseUrl: BaseUrl, client: c, } } type MarkdownMode string var Markdown = MarkdownMode("markdown") var Gfm = MarkdownMode("gfm") type ApiError struct { Status int Body string *Client } func (e *ApiError) Error() string { return fmt.Sprintf("Github API Error: %d - %v", e.Status, e.Body) } func NewApiError(status int, body string, c *Client) *ApiError { return &ApiError{Status: status, Body: body, Client: c} } func IsApiError(err error) bool { switch err.(type) { case *ApiError: return true default: return false } } // Call /markdown API // See: https://developer.github.com/v3/markdown/ func (g *Client) Markdown(text string, mode MarkdownMode, context string) (string, error) { url := g.baseUrl + "/markdown" body := map[string]string{ "text": text, "mode": string(mode), "context": context, } buff, _ := json.Marshal(body) resp, err := g.client.Post(url, "application/json", bytes.NewBuffer(buff)) if err != nil { return "", err } defer resp.Body.Close() buff, err = ioutil.ReadAll(resp.Body) if err != nil { return "", err } g.updateRateLimit(resp) if resp.StatusCode != http.StatusOK { return "", NewApiError(resp.StatusCode, string(buff), g) } return string(buff), nil } // Returns if the client exceeds the limit or not. func (g *Client) LimitExceeded() bool { if g.RateLimit == 0 && g.RateLimitRemaining == 0 { // initial value return false } return g.RateLimitRemaining == 0 } func (g *Client) updateRateLimit(resp *http.Response) { limit := resp.Header.Get("X-Ratelimit-Limit") i, err := strconv.ParseInt(limit, 10, 32) if err == nil { g.RateLimit = int(i) } remaining := resp.Header.Get("X-Ratelimit-Remaining") i, err = strconv.ParseInt(remaining, 10, 32) if err == nil { g.RateLimitRemaining = int(i) } reset := resp.Header.Get("X-Ratelimit-Reset") i, err = strconv.ParseInt(reset, 10, 32) if err == nil { g.RateLimitReset = time.Unix(i, 0) } }
speedland/wcg
supports/github/api.go
GO
mit
3,000
22.4375
91
0.674333
false
<?php namespace Oro\Bundle\AttachmentBundle\Tests\Unit\Entity; use Oro\Bundle\AttachmentBundle\Entity\File; use Oro\Bundle\UserBundle\Entity\User; use Oro\Component\Testing\Unit\EntityTestCaseTrait; use Oro\Component\Testing\Unit\EntityTrait; use Symfony\Component\HttpFoundation\File\File as ComponentFile; class FileTest extends \PHPUnit\Framework\TestCase { use EntityTestCaseTrait; use EntityTrait; /** @var File */ private $entity; protected function setUp() { $this->entity = new File(); } public function testAccessors(): void { $properties = [ ['id', 1], ['uuid', '123e4567-e89b-12d3-a456-426655440000', false], ['owner', new User()], ['filename', 'sample_filename'], ['extension', 'smplext'], ['mimeType', 'sample/mime-type'], ['originalFilename', 'sample_original_filename'], ['fileSize', 12345], ['parentEntityClass', \stdClass::class], ['parentEntityId', 2], ['parentEntityFieldName', 'sampleFieldName'], ['createdAt', new \DateTime('today')], ['updatedAt', new \DateTime('today')], ['file', new ComponentFile('sample/file', false)], ['emptyFile', true], ]; static::assertPropertyAccessors($this->entity, $properties); } public function testPrePersists(): void { $testDate = new \DateTime('now', new \DateTimeZone('UTC')); $this->entity->prePersist(); $this->entity->preUpdate(); $this->assertEquals($testDate->format('Y-m-d'), $this->entity->getCreatedAt()->format('Y-m-d')); $this->assertEquals($testDate->format('Y-m-d'), $this->entity->getUpdatedAt()->format('Y-m-d')); } public function testEmptyFile(): void { $this->assertNull($this->entity->isEmptyFile()); $this->entity->setEmptyFile(true); $this->assertTrue($this->entity->isEmptyFile()); } public function testToString(): void { $this->assertSame('', $this->entity->__toString()); $this->entity->setFilename('file.doc'); $this->entity->setOriginalFilename('original.doc'); $this->assertEquals('file.doc (original.doc)', $this->entity->__toString()); } public function testSerialize(): void { $this->assertSame(serialize([null, null, $this->entity->getUuid()]), $this->entity->serialize()); $this->assertEquals( serialize([1, 'sample_filename', 'test-uuid']), $this->getEntity( File::class, ['id' => 1, 'filename' => 'sample_filename', 'uuid' => 'test-uuid'] )->serialize() ); } public function testUnserialize(): void { $this->entity->unserialize(serialize([1, 'sample_filename', 'test-uuid'])); $this->assertSame('sample_filename', $this->entity->getFilename()); $this->assertSame(1, $this->entity->getId()); $this->assertSame('test-uuid', $this->entity->getUuid()); } }
orocrm/platform
src/Oro/Bundle/AttachmentBundle/Tests/Unit/Entity/FileTest.php
PHP
mit
3,094
31.568421
105
0.582418
false
require 'json_diff/version' # Provides helper methods to compare object trees (like those generated by JSON.parse) # and generate a list of their differences. module JSONDiff # Generates an Array of differences between the two supplied object trees with Hash roots. # # @param a [Hash] the left hand side of the comparison. # @param b [Hash] the right hand side of the comparison. # @param path [String] the JSON path at which `a` and `b` are found in a larger object tree. # @return [Array<String>] the differences found between `a` and `b`. def self.objects(a, b, path='') differences = [] a.each do |k, v| if b.has_key? k if v.class != b[k].class differences << "type mismatch: #{path}/#{k} '#{v.class}' != '#{b[k].class}'" else if v.is_a? Hash differences += objects(v, b[k], "#{path}/#{k}") elsif v.is_a? Array differences += arrays(v, b[k], "#{path}/#{k}") elsif v != b[k] # String, TrueClass, FalseClass, NilClass, Float, Fixnum differences << "value mismatch: #{path}/#{k} '#{v}' != '#{b[k]}'" end end else differences << "b is missing: #{path}/#{k}" end end (b.keys - a.keys).each do |k, v| differences << "a is missing: #{path}/#{k}" end differences end # Generates an Array of differences between the two supplied object trees with Array roots. # # @param a [Array] the left hand side of the comparison. # @param b [Array] the right hand side of the comparison. # @param path [String] the JSON path at which `a` and `b` are found in a larger object tree. # @return [Array<String>] the differences found between `a` and `b`. def self.arrays(a, b, path='/') differences = [] if a.size != b.size differences << "size mismatch: #{path}" else a.zip(b).each_with_index do |pair, index| if pair[0].class != pair[1].class differences << "type mismatch: #{path}[#{index}] '#{pair[0].class}' != '#{pair[1].class}'" else if pair[0].is_a? Hash differences += objects(pair[0], pair[1], "#{path}[#{index}]") elsif pair[0].is_a? Array differences += arrays(pair[0], pair[1], "#{path}[#{index}]") elsif pair[0] != pair[1] # String, TrueClass, FalseClass, NilClass, Float, Fixnum differences << "value mismatch: #{path}[#{index}] '#{pair[0]}' != '#{pair[1]}'" end end end end differences end end
chrisvroberts/json_diff
lib/json_diff.rb
Ruby
mit
2,550
35.956522
101
0.575294
false
<html> <head> <meta http-equiv="Page-Enter" content="revealTrans(Duration=4,Transition=12)"> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="language" content="en" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> <meta name="viewport" content="width=device-width"/> <meta name="author" content="T"> <META NAME="robots" content="index"> <META NAME="robots" content="follow"> <meta name="description" content="Our mission is to help facilitate the newly independent East-Timor in accessing the voices and the key events in its past and fostering an understanding of its unique cultural heritage; to help unite and secure the identity of the country and its people; and to contribute to the forging of a new democratic nation. To ensure the survival of unique resources which contain and communicate the experience and the story of Timor-Leste and to place these at the service of peace and understanding, in Timor-Leste, Regionally and Internationally."> <meta name="keywords" content="CAMSTL, East-Timor, Timor-Leste, Timor-Lorosae"> <title>Raster and Vector Attributes</title> </head> <body bgcolor="#FFFFFF"> <table width="90" border="0" cellspacing="2" cellpadding="2" align="Center"> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Id </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 386 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Facility </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> Railacoleten HP </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> District </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> Ermera </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Code </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> HP </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Owner_ </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> Government </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Management </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> Railaco CHC </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Visitmnth </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 0 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Physician </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 0.00 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Nurse </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 1.00 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Midwife </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 0.00 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Dental </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 0.00 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Lab </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 0.00 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Ass_nurse </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 0.00 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Other </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 0.00 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Assumption </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> &nbsp; </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Check_date </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> 20030211 </font> </td> </tr> <tr> <td bgcolor="#CC3333"> <font face="Courier New, Courier, mono" size="-1"> Verified </font> </td> <td bgcolor="#CCCCCC"> <font face="Courier New, Courier, mono" size="-1"> CHC verified </font> </td> </tr> </table> </body> </html>
timorleste/health-facility
att/health_facilities_dbf257.html
HTML
mit
5,889
24.408072
578
0.526915
false
import { observable, action } from 'mobx'; import Fuse from 'fuse.js'; import Activity from './../utils/Activity'; import noop from 'lodash/noop'; import uniqBy from 'lodash/uniqBy'; const inactive = Activity(500); export default class Story { @observable keyword = ''; @observable allStories = []; @observable stories = []; @action search(keyword) { this.keyword = keyword; inactive().then(() => { this.stories = this.searchStories(this.allStories, this.keyword); }, noop); } @action addStories(stories){ this.allStories = uniqBy(this.allStories.concat(stories), story => story.key); this.stories = this.searchStories(this.allStories, this.keyword); } searchStories(stories, keyword) { /** * threshold is the correctness of the search * @type {{threshold: number, keys: string[]}} */ const options = { threshold: 0.2, keys: ['text'] }; const google = new Fuse(stories, options); return google.search(keyword) || []; } }
nadimtuhin/facebook-activity-monitor
src/content/store/Story.js
JavaScript
mit
1,020
24.5
82
0.643137
false
# -*- coding: utf-8 -*- from __future__ import unicode_literals import time import curses from . import docs from .content import SubmissionContent, SubredditContent from .page import Page, PageController, logged_in from .objects import Navigator, Color, Command from .exceptions import TemporaryFileError class SubmissionController(PageController): character_map = {} class SubmissionPage(Page): FOOTER = docs.FOOTER_SUBMISSION def __init__(self, reddit, term, config, oauth, url=None, submission=None): super(SubmissionPage, self).__init__(reddit, term, config, oauth) self.controller = SubmissionController(self, keymap=config.keymap) if url: self.content = SubmissionContent.from_url( reddit, url, term.loader, max_comment_cols=config['max_comment_cols']) else: self.content = SubmissionContent( submission, term.loader, max_comment_cols=config['max_comment_cols']) # Start at the submission post, which is indexed as -1 self.nav = Navigator(self.content.get, page_index=-1) self.selected_subreddit = None @SubmissionController.register(Command('SUBMISSION_TOGGLE_COMMENT')) def toggle_comment(self): "Toggle the selected comment tree between visible and hidden" current_index = self.nav.absolute_index self.content.toggle(current_index) # This logic handles a display edge case after a comment toggle. We # want to make sure that when we re-draw the page, the cursor stays at # its current absolute position on the screen. In order to do this, # apply a fixed offset if, while inverted, we either try to hide the # bottom comment or toggle any of the middle comments. if self.nav.inverted: data = self.content.get(current_index) if data['hidden'] or self.nav.cursor_index != 0: window = self._subwindows[-1][0] n_rows, _ = window.getmaxyx() self.nav.flip(len(self._subwindows) - 1) self.nav.top_item_height = n_rows @SubmissionController.register(Command('SUBMISSION_EXIT')) def exit_submission(self): "Close the submission and return to the subreddit page" self.active = False @SubmissionController.register(Command('REFRESH')) def refresh_content(self, order=None, name=None): "Re-download comments and reset the page index" order = order or self.content.order url = name or self.content.name with self.term.loader('Refreshing page'): self.content = SubmissionContent.from_url( self.reddit, url, self.term.loader, order=order, max_comment_cols=self.config['max_comment_cols']) if not self.term.loader.exception: self.nav = Navigator(self.content.get, page_index=-1) @SubmissionController.register(Command('PROMPT')) def prompt_subreddit(self): "Open a prompt to navigate to a different subreddit" name = self.term.prompt_input('Enter page: /') if name is not None: with self.term.loader('Loading page'): content = SubredditContent.from_name( self.reddit, name, self.term.loader) if not self.term.loader.exception: self.selected_subreddit = content self.active = False @SubmissionController.register(Command('SUBMISSION_OPEN_IN_BROWSER')) def open_link(self): "Open the selected item with the webbrowser" data = self.get_selected_item() url = data.get('permalink') if url: self.term.open_browser(url) else: self.term.flash() @SubmissionController.register(Command('SUBMISSION_OPEN_IN_PAGER')) def open_pager(self): "Open the selected item with the system's pager" data = self.get_selected_item() if data['type'] == 'Submission': text = '\n\n'.join((data['permalink'], data['text'])) self.term.open_pager(text) elif data['type'] == 'Comment': text = '\n\n'.join((data['permalink'], data['body'])) self.term.open_pager(text) else: self.term.flash() @SubmissionController.register(Command('SUBMISSION_POST')) @logged_in def add_comment(self): """ Submit a reply to the selected item. Selected item: Submission - add a top level comment Comment - add a comment reply """ data = self.get_selected_item() if data['type'] == 'Submission': body = data['text'] reply = data['object'].add_comment elif data['type'] == 'Comment': body = data['body'] reply = data['object'].reply else: self.term.flash() return # Construct the text that will be displayed in the editor file. # The post body will be commented out and added for reference lines = ['# |' + line for line in body.split('\n')] content = '\n'.join(lines) comment_info = docs.COMMENT_FILE.format( author=data['author'], type=data['type'].lower(), content=content) with self.term.open_editor(comment_info) as comment: if not comment: self.term.show_notification('Canceled') return with self.term.loader('Posting', delay=0): reply(comment) # Give reddit time to process the submission time.sleep(2.0) if self.term.loader.exception is None: self.refresh_content() else: raise TemporaryFileError() @SubmissionController.register(Command('DELETE')) @logged_in def delete_comment(self): "Delete the selected comment" if self.get_selected_item()['type'] == 'Comment': self.delete_item() else: self.term.flash() @SubmissionController.register(Command('SUBMISSION_OPEN_IN_URLVIEWER')) def comment_urlview(self): data = self.get_selected_item() comment = data.get('body') or data.get('text') or data.get('url_full') if comment: self.term.open_urlview(comment) else: self.term.flash() def _draw_item(self, win, data, inverted): if data['type'] == 'MoreComments': return self._draw_more_comments(win, data) elif data['type'] == 'HiddenComment': return self._draw_more_comments(win, data) elif data['type'] == 'Comment': return self._draw_comment(win, data, inverted) else: return self._draw_submission(win, data) def _draw_comment(self, win, data, inverted): n_rows, n_cols = win.getmaxyx() n_cols -= 1 # Handle the case where the window is not large enough to fit the text. valid_rows = range(0, n_rows) offset = 0 if not inverted else -(data['n_rows'] - n_rows) # If there isn't enough space to fit the comment body on the screen, # replace the last line with a notification. split_body = data['split_body'] if data['n_rows'] > n_rows: # Only when there is a single comment on the page and not inverted if not inverted and len(self._subwindows) == 0: cutoff = data['n_rows'] - n_rows + 1 split_body = split_body[:-cutoff] split_body.append('(Not enough space to display)') row = offset if row in valid_rows: attr = curses.A_BOLD attr |= (Color.BLUE if not data['is_author'] else Color.GREEN) self.term.add_line(win, '{author} '.format(**data), row, 1, attr) if data['flair']: attr = curses.A_BOLD | Color.YELLOW self.term.add_line(win, '{flair} '.format(**data), attr=attr) text, attr = self.term.get_arrow(data['likes']) self.term.add_line(win, text, attr=attr) self.term.add_line(win, ' {score} {created} '.format(**data)) if data['gold']: text, attr = self.term.guilded self.term.add_line(win, text, attr=attr) if data['stickied']: text, attr = '[stickied]', Color.GREEN self.term.add_line(win, text, attr=attr) if data['saved']: text, attr = '[saved]', Color.GREEN self.term.add_line(win, text, attr=attr) for row, text in enumerate(split_body, start=offset+1): if row in valid_rows: self.term.add_line(win, text, row, 1) # Unfortunately vline() doesn't support custom color so we have to # build it one segment at a time. attr = Color.get_level(data['level']) x = 0 for y in range(n_rows): self.term.addch(win, y, x, self.term.vline, attr) return attr | self.term.vline def _draw_more_comments(self, win, data): n_rows, n_cols = win.getmaxyx() n_cols -= 1 self.term.add_line(win, '{body}'.format(**data), 0, 1) self.term.add_line( win, ' [{count}]'.format(**data), attr=curses.A_BOLD) attr = Color.get_level(data['level']) self.term.addch(win, 0, 0, self.term.vline, attr) return attr | self.term.vline def _draw_submission(self, win, data): n_rows, n_cols = win.getmaxyx() n_cols -= 3 # one for each side of the border + one for offset for row, text in enumerate(data['split_title'], start=1): self.term.add_line(win, text, row, 1, curses.A_BOLD) row = len(data['split_title']) + 1 attr = curses.A_BOLD | Color.GREEN self.term.add_line(win, '{author}'.format(**data), row, 1, attr) attr = curses.A_BOLD | Color.YELLOW if data['flair']: self.term.add_line(win, ' {flair}'.format(**data), attr=attr) self.term.add_line(win, ' {created} {subreddit}'.format(**data)) row = len(data['split_title']) + 2 attr = curses.A_UNDERLINE | Color.BLUE self.term.add_line(win, '{url}'.format(**data), row, 1, attr) offset = len(data['split_title']) + 3 # Cut off text if there is not enough room to display the whole post split_text = data['split_text'] if data['n_rows'] > n_rows: cutoff = data['n_rows'] - n_rows + 1 split_text = split_text[:-cutoff] split_text.append('(Not enough space to display)') for row, text in enumerate(split_text, start=offset): self.term.add_line(win, text, row, 1) row = len(data['split_title']) + len(split_text) + 3 self.term.add_line(win, '{score} '.format(**data), row, 1) text, attr = self.term.get_arrow(data['likes']) self.term.add_line(win, text, attr=attr) self.term.add_line(win, ' {comments} '.format(**data)) if data['gold']: text, attr = self.term.guilded self.term.add_line(win, text, attr=attr) if data['nsfw']: text, attr = 'NSFW', (curses.A_BOLD | Color.RED) self.term.add_line(win, text, attr=attr) if data['saved']: text, attr = '[saved]', Color.GREEN self.term.add_line(win, text, attr=attr) win.border()
shaggytwodope/rtv
rtv/submission_page.py
Python
mit
11,574
35.859873
79
0.576464
false
#include <zombye/core/game.hpp> #include <zombye/gameplay/camera_follow_component.hpp> #include <zombye/gameplay/game_states.hpp> #include <zombye/gameplay/gameplay_system.hpp> #include <zombye/gameplay/states/menu_state.hpp> #include <zombye/gameplay/states/play_state.hpp> #include <zombye/gameplay/state_component.hpp> #include <zombye/scripting/scripting_system.hpp> #include <zombye/utils/state_machine.hpp> #include <zombye/utils/component_helper.hpp> zombye::gameplay_system::gameplay_system(zombye::game *game) { sm_ = std::unique_ptr<zombye::state_machine>(new zombye::state_machine(game)); init_game_states(); } void zombye::gameplay_system::init_game_states() { sm_->add<zombye::menu_state>(GAME_STATE_MENU); sm_->add<zombye::play_state>(GAME_STATE_PLAY); } void zombye::gameplay_system::use(std::string name) { sm_->use(name); } void zombye::gameplay_system::dispose_current() { sm_->dispose_current(); } void zombye::gameplay_system::update(float delta_time) { sm_->update(delta_time); for (auto& c : camera_follow_components_) { c->update(delta_time); } for (auto& s : state_components_) { s->update(delta_time); } } void zombye::gameplay_system::register_component(camera_follow_component* component) { camera_follow_components_.emplace_back(component); } void zombye::gameplay_system::unregister_component(camera_follow_component* component) { remove(camera_follow_components_, component); } void zombye::gameplay_system::register_component(state_component* component) { state_components_.emplace_back(component); } void zombye::gameplay_system::unregister_component(state_component* component) { remove(state_components_, component); }
kasoki/project-zombye
src/source/zombye/gameplay/gameplay_system.cpp
C++
mit
1,741
29.54386
88
0.721424
false
'use strict'; const Schemas = require('../server/schemas'); const Code = require('code'); const Lab = require('lab'); const expect = Code.expect; const lab = exports.lab = Lab.script(); const describe = lab.describe; const it = lab.it; describe('server/schemas.todoSchema', () => { it('validates object', (done) => { expect(Schemas.todoSchema.validate({ test: 'val' }).error).to.exist(); return done(); }); it('allows id as string, done as boolean, and content as string', (done) => { expect(Schemas.todoSchema.validate({ id: 1 }).error).to.exist(); expect(Schemas.todoSchema.validate({ id: 'id' }).error).to.not.exist(); expect(Schemas.todoSchema.validate({ done: false}).error).to.not.exist(); expect(Schemas.todoSchema.validate({ done: 'somtest'}).error).to.exist(); expect(Schemas.todoSchema.validate({ done: 'false'}).error).to.not.exist(); expect(Schemas.todoSchema.validate({ content: 1234567 }).error).to.exist(); expect(Schemas.todoSchema.validate({ content: 'test' }).error).to.not.exist(); return done(); }); it('exposes a todoObject', (done) => { expect(Schemas.todoObject).to.be.an.object(); return done(); }); });
genediazjr/hapitodo
test/schemasTest.js
JavaScript
mit
1,261
29.756098
86
0.61935
false
package mil.nga.geopackage.extension.rtree; import org.junit.Test; import java.sql.SQLException; import mil.nga.geopackage.CreateGeoPackageTestCase; /** * Test RTree Extension from a created database * * @author osbornb */ public class RTreeIndexExtensionCreateTest extends CreateGeoPackageTestCase { /** * Constructor */ public RTreeIndexExtensionCreateTest() { } /** * Test RTree * * @throws SQLException upon error */ @Test public void testRTree() throws SQLException { RTreeIndexExtensionUtils.testRTree(geoPackage); } @Override public boolean allowEmptyFeatures() { return false; } }
ngageoint/geopackage-android
geopackage-sdk/src/androidTest/java/mil/nga/geopackage/extension/rtree/RTreeIndexExtensionCreateTest.java
Java
mit
690
16.25
77
0.672464
false
#ifndef MESSAGEFILE_H #define MESSAGEFILE_H #include "xmlserializable.h" #include <QList> #include <QByteArray> #include <QImage> #include "messagekey.h" #include "messagetypemix.h" namespace Velasquez { class DrawingElement; } namespace MoodBox { #define MESSAGE_FILE_EXTENSION ".mbm" #define MESSAGE_TIMESTAMP "dd.MM.yyyy hh-mm-ss-zzz" #define MESSAGE_FILE_XML_TAGNAME "Message" #define MESSAGE_FILE_ID_ATTRIBUTE "Id" #define MESSAGE_TYPE_XML_ATTRIBUTE "Type" #define MESSAGE_SENTDATE_XML_ATTRIBUTE "SentDate" #define MESSAGE_RECIPIENT_XML_ATTRIBUTE "Recipient" #define MESSAGE_AUTHOR_XML_ATTRIBUTE "Author" #define MESSAGE_AUTHORLOGIN_XML_ATTRIBUTE "AuthorLogin" #define MESSAGE_SENT_XML_ATTRIBUTE "Sent" #define MESSAGE_ISPUBLIC_XML_ATTRIBUTE "IsPublic" #define MESSAGE_ONBEHALF_XML_TAGNAME "OnBehalf" #define MESSAGE_TYPE_PRIVATE_VALUE "Private" #define MESSAGE_TYPE_FRIENDS_VALUE "Friends" #define MESSAGE_TYPE_CHANNEL_VALUE "Channel" #define MESSAGE_YES_VALUE "Yes" #define MESSAGE_NO_VALUE "No" #define METAINFO_IMAGEFORMAT_TITLE "Image" #define METAINFO_IMAGEFORMAT_TAGNAME "Type" #define METAINFO_IMAGEFORMAT_VALUEPREFIX "image/" // Drawing Message file base info class MessageFileBase : public MessageTypeMix, protected XmlSerializable { public: MessageFileBase(); MessageFileBase(MessageType::MessageTypeEnum type, qint32 authorId); MessageFileBase(qint32 recipientId, qint32 authorId); inline void setId(qint32 id) { key.setId(id); }; inline qint32 getId() const { return key.getId(); }; inline void setSentDate(const QDateTime &date) { key.setDate(date); }; inline QDateTime getSentDate() const { return key.getDate(); }; inline void setAuthor(qint32 authorId) { this->authorId = authorId; }; inline qint32 getAuthor() const { return authorId; }; inline void setAuthorLogin(const QString &authorLogin) { this->authorLogin = authorLogin; }; inline QString getAuthorLogin() const { return authorLogin; }; inline void setSent(bool sent) { this->sent = sent; }; inline bool getSent() const { return sent; }; inline void setPublic(bool isPublic) { this->isPublic = isPublic; }; inline bool getPublic() const { return isPublic; }; inline void setFileName(const QString &fileName) { this->fileName = fileName; }; inline QString getFileName() const { return this->fileName; }; inline MessageKey getMessageKey() const { return key; }; SerializationResult save(); SerializationResult load(); static QString messageTypeToString(MessageType::MessageTypeEnum type); static MessageType::MessageTypeEnum messageTypeFromString(const QString &string, bool *ok = NULL); static QString messageBoolToString(bool value); static bool messageBoolFromString(const QString &string); protected: virtual SerializationResult saveToXml(QXmlStreamWriter* writer) const; virtual SerializationResult loadFromXml(QXmlStreamReader* reader); virtual SerializationResult saveContentToXml(QXmlStreamWriter* writer) const; virtual SerializationResult loadContentFromXml(QXmlStreamReader* reader); private: MessageKey key; qint32 authorId; QString authorLogin; bool sent; bool isPublic; QString fileName; }; // Drawing Message file with elements buffer class MessageFile : public MessageFileBase { public: MessageFile(); MessageFile(MessageType::MessageTypeEnum type, qint32 authorId); MessageFile(qint32 recipientId, qint32 authorId); // Information inline void setInfo(const QString &info) { this->info = info; }; QString getInfo() const { return info; }; // Image format info QString getImageFormatFromInfo() const; // Preview works void setPreview(const QImage &preview); void setPreview(const QByteArray &previewBytes); inline QImage getPreview() const { return preview; }; inline QByteArray getPreviewBytes() const { return previewBytes; }; protected: virtual SerializationResult saveContentToXml(QXmlStreamWriter* writer) const; virtual SerializationResult loadContentFromXml(QXmlStreamReader* reader); private: QString info; QImage preview; QByteArray previewBytes; void updateBytesFromPreview(); void updatePreviewFromBytes(); }; } #endif // MESSAGEFILE_H
vorushin/moodbox_aka_risovaska
client/messagefile.h
C
mit
4,309
28.574468
99
0.745417
false
# Feathers-Vue > A Vue 2 and FeathersJS 2 fullstack app with authentication, email verification, and email support.&#34; ## About This project uses [Feathers](http://feathersjs.com). An open source web framework for building modern real-time applications and Vue 2 with Server Side Rendering. This project is not finished but if you are can be ready to use if you are content with what it offers. Features - SASS - Stylus - Pug - ES6, ES7, and ES8 - Webpack - Vue Stash - For Redux Store - Bootstrap - Lodash - jQuery - FontAwesome - Validate client side data with mongoose schemas ## Getting Started Getting up and running is as easy as 1, 2, 3, 4. There are multiple ways to start/develop the app. ### Develop with docker Don't install node_modules locally 1. Create a `environment-dev.env` and `environment.env` file to hold your environment variables. These files are ignored by git. You'll want a DATABASE_URL and you gmail info for email verification ``` DATABASE_URL=mongodb://db/feathersvuedevelopment COMPLAINT_EMAIL=your_email@gmail.com GMAIL=your_email@gmail.com GMAIL_PASSWORD=your_pass_password ``` _See [How to set an app password](https://support.google.com/accounts/answer/185833)_ 2. Run npm start ``` npm start ``` 2. To see production build locally ``` npm run build-qa npm run qa ``` 3. To switch back to development use ``` npm run build-dev npm start ``` Switching contexts between production and development requires a full docker build with no cache. ### Develop without docker 1. Make sure you have [NodeJS](https://nodejs.org/) and [npm](https://www.npmjs.com/) installed. 2. Install your dependencies ``` cd path/to/Feathers-Vue; npm install ``` 3. Start your app locally ``` mongod ``` ``` npm run dev ``` 4. In production run ``` npm run build npm run production ``` If you want emails to work using gmail add the following environment variables ``` export GMAIL=yourgmailaccount@gmail.com export GMAIL_PASS=yourpassword or app-password ``` _See [How to set an app password](https://support.google.com/accounts/answer/185833)_ ## Testing Simply run `npm test` and all your tests in the `test/` directory to run server side unit test or run `npm run integration` to run client side side tests. ## Scaffolding Feathers has a powerful command line interface. Here are a few things it can do: ``` $ npm install -g feathers-cli # Install Feathers CLI $ feathers generate service # Generate a new Service $ feathers generate hook # Generate a new Hook $ feathers generate model # Generate a new Model $ feathers help # Show all commands ``` ## Help For more information on all the things you can do with Feathers visit [docs.feathersjs.com](http://docs.feathersjs.com). ## Looking for mobile? I'm working on a cordova starter with feathers 2, Vue 2, and Framework 7. Visit the `cordova` branch of this repo. [Cordova Branch](https://github.com/codingfriend1/Feathers-Vue/tree/cordova) ## Gitlab Auto Deployment 1. Create a digitalocean instance from using the one-click docker instance. 2. ssh into the instance and run ``` sudo apt-get update sudo apt-get upgrade sudo apt-get -y install python-pip sudo pip install docker-compose ``` 3. Edit `sshd_config` ``` nano /etc/ssh/sshd_config ``` 4. At the bottom of the file change `PasswordAuthentication` ``` PasswordAuthentication yes ``` 5. Run `reload ssh` 6. Set the secret environment variables in gitlab ``` DATABASE_URL=mongodb://db/feathersvue DEPLOYMENT_SERVER_IP=your_ip_address DEPLOYMENT_SERVER_PASS=your_user_password DEPLOYMENT_SERVER_USER=your_server_user ``` 7. Update `docker-compose.autodeploy.yml` web image to point to your hosted image. 8. Update `gitlab-ci.yml` in the `only` sections to only run on the branches you want to deploy from. 9. Push changes in git to gitlab. ## Breaking Changes - Removed mongoose validation from client side and replaced with Yup. - Reconstructed server-side rendering to use updated instructions in vuejs. - Moved server-entry file into app. ## License Copyright (c) 2016 Licensed under the [MIT license](LICENSE).
codingfriend1/Feathers-Vue
README.md
Markdown
mit
4,364
24.97619
197
0.703254
false
/** * @module popoff/overlay * * Because overlay-component is hopelessly out of date. * This is modern rewrite. */ const Emitter = require('events').EventEmitter; const inherits = require('inherits'); const extend = require('xtend/mutable'); module.exports = Overlay; /** * Initialize a new `Overlay`. * * @param {Object} options * @api public */ function Overlay(options) { if (!(this instanceof Overlay)) return new Overlay(options); Emitter.call(this); extend(this, options); if (!this.container) { this.container = document.body || document.documentElement; } //create overlay element this.element = document.createElement('div'); this.element.classList.add('popoff-overlay'); if (this.closable) { this.element.addEventListener('click', e => { this.hide(); }); this.element.classList.add('popoff-closable'); } } inherits(Overlay, Emitter); //close overlay by click Overlay.prototype.closable = true; /** * Show the overlay. * * Emits "show" event. * * @return {Overlay} * @api public */ Overlay.prototype.show = function () { this.emit('show'); this.container.appendChild(this.element); //class removed in a timeout to save animation setTimeout( () => { this.element.classList.add('popoff-visible'); this.emit('afterShow'); }, 10); return this; }; /** * Hide the overlay. * * Emits "hide" event. * * @return {Overlay} * @api public */ Overlay.prototype.hide = function () { this.emit('hide'); this.element.classList.remove('popoff-visible'); this.element.addEventListener('transitionend', end); this.element.addEventListener('webkitTransitionEnd', end); this.element.addEventListener('otransitionend', end); this.element.addEventListener('oTransitionEnd', end); this.element.addEventListener('msTransitionEnd', end); var to = setTimeout(end, 1000); var that = this; function end () { that.element.removeEventListener('transitionend', end); that.element.removeEventListener('webkitTransitionEnd', end); that.element.removeEventListener('otransitionend', end); that.element.removeEventListener('oTransitionEnd', end); that.element.removeEventListener('msTransitionEnd', end); clearInterval(to); that.container.removeChild(that.element); that.emit('afterHide'); } return this; };
dfcreative/popoff
overlay.js
JavaScript
mit
2,294
19.300885
63
0.702703
false
#!/usr/bin/env python import os import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Test label reading from an MNI tag file # # The current directory must be writeable. # try: fname = "mni-tagtest.tag" channel = open(fname, "wb") channel.close() # create some random points in a sphere # sphere1 = vtk.vtkPointSource() sphere1.SetNumberOfPoints(13) xform = vtk.vtkTransform() xform.RotateWXYZ(20, 1, 0, 0) xformFilter = vtk.vtkTransformFilter() xformFilter.SetTransform(xform) xformFilter.SetInputConnection(sphere1.GetOutputPort()) labels = vtk.vtkStringArray() labels.InsertNextValue("0") labels.InsertNextValue("1") labels.InsertNextValue("2") labels.InsertNextValue("3") labels.InsertNextValue("Halifax") labels.InsertNextValue("Toronto") labels.InsertNextValue("Vancouver") labels.InsertNextValue("Larry") labels.InsertNextValue("Bob") labels.InsertNextValue("Jackie") labels.InsertNextValue("10") labels.InsertNextValue("11") labels.InsertNextValue("12") weights = vtk.vtkDoubleArray() weights.InsertNextValue(1.0) weights.InsertNextValue(1.1) weights.InsertNextValue(1.2) weights.InsertNextValue(1.3) weights.InsertNextValue(1.4) weights.InsertNextValue(1.5) weights.InsertNextValue(1.6) weights.InsertNextValue(1.7) weights.InsertNextValue(1.8) weights.InsertNextValue(1.9) weights.InsertNextValue(0.9) weights.InsertNextValue(0.8) weights.InsertNextValue(0.7) writer = vtk.vtkMNITagPointWriter() writer.SetFileName(fname) writer.SetInputConnection(sphere1.GetOutputPort()) writer.SetInputConnection(1, xformFilter.GetOutputPort()) writer.SetLabelText(labels) writer.SetWeights(weights) writer.SetComments("Volume 1: sphere points\nVolume 2: transformed points") writer.Write() reader = vtk.vtkMNITagPointReader() reader.CanReadFile(fname) reader.SetFileName(fname) textProp = vtk.vtkTextProperty() textProp.SetFontSize(12) textProp.SetColor(1.0, 1.0, 0.5) labelHier = vtk.vtkPointSetToLabelHierarchy() labelHier.SetInputConnection(reader.GetOutputPort()) labelHier.SetTextProperty(textProp) labelHier.SetLabelArrayName("LabelText") labelHier.SetMaximumDepth(15) labelHier.SetTargetLabelCount(12) labelMapper = vtk.vtkLabelPlacementMapper() labelMapper.SetInputConnection(labelHier.GetOutputPort()) labelMapper.UseDepthBufferOff() labelMapper.SetShapeToRect() labelMapper.SetStyleToOutline() labelActor = vtk.vtkActor2D() labelActor.SetMapper(labelMapper) glyphSource = vtk.vtkSphereSource() glyphSource.SetRadius(0.01) glyph = vtk.vtkGlyph3D() glyph.SetSourceConnection(glyphSource.GetOutputPort()) glyph.SetInputConnection(reader.GetOutputPort()) mapper = vtk.vtkDataSetMapper() mapper.SetInputConnection(glyph.GetOutputPort()) actor = vtk.vtkActor() actor.SetMapper(mapper) # Create rendering stuff ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.SetMultiSamples(0) renWin.AddRenderer(ren1) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # Add the actors to the renderer, set the background and size # ren1.AddViewProp(actor) ren1.AddViewProp(labelActor) ren1.SetBackground(0, 0, 0) renWin.SetSize(300, 300) renWin.Render() try: os.remove(fname) except OSError: pass # render the image # # iren.Start() except IOError: print "Unable to test the writer/reader."
timkrentz/SunTracker
IMU/VTK-6.2.0/IO/MINC/Testing/Python/TestMNITagPoints.py
Python
mit
3,826
26.984848
79
0.691845
false
// The MIT License (MIT) // // Copyright (c) 2015 Rasmus Mikkelsen // https://github.com/rasmus/EventFlow // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. using EventFlow.Core; using EventFlow.Jobs; using EventFlow.Logs; using Hangfire; using System; using System.Threading; using System.Threading.Tasks; namespace EventFlow.Hangfire.Integration { public class HangfireJobScheduler : IJobScheduler { private readonly IBackgroundJobClient _backgroundJobClient; private readonly IJobDefinitionService _jobDefinitionService; private readonly IJsonSerializer _jsonSerializer; private readonly ILog _log; public HangfireJobScheduler( ILog log, IJsonSerializer jsonSerializer, IBackgroundJobClient backgroundJobClient, IJobDefinitionService jobDefinitionService) { _log = log; _jsonSerializer = jsonSerializer; _backgroundJobClient = backgroundJobClient; _jobDefinitionService = jobDefinitionService; } public Task<IJobId> ScheduleNowAsync(IJob job, CancellationToken cancellationToken) { return ScheduleAsync(job, (c, d, j) => _backgroundJobClient.Enqueue<IJobRunner>(r => r.Execute(d.Name, d.Version, j))); } public Task<IJobId> ScheduleAsync(IJob job, DateTimeOffset runAt, CancellationToken cancellationToken) { return ScheduleAsync(job, (c, d, j) => _backgroundJobClient.Schedule<IJobRunner>(r => r.Execute(d.Name, d.Version, j), runAt)); } public Task<IJobId> ScheduleAsync(IJob job, TimeSpan delay, CancellationToken cancellationToken) { return ScheduleAsync(job, (c, d, j) => _backgroundJobClient.Schedule<IJobRunner>(r => r.Execute(d.Name, d.Version, j), delay)); } private Task<IJobId> ScheduleAsync(IJob job, Func<IBackgroundJobClient, JobDefinition, string, string> schedule) { var jobDefinition = _jobDefinitionService.GetJobDefinition(job.GetType()); var json = _jsonSerializer.Serialize(job); var id = schedule(_backgroundJobClient, jobDefinition, json); _log.Verbose($"Scheduled job '{id}' in Hangfire"); return Task.FromResult<IJobId>(new HangfireJobId(id)); } } }
liemqv/EventFlow
Source/EventFlow.Hangfire/Integration/HangfireJobScheduler.cs
C#
mit
3,367
41.607595
139
0.70104
false
if (isset($_POST['upload'])) { $target = "../img".basename($_FILES['image']['name']); $image = $_FILES['image']['name']; $msg = ""; $sql = "UPDATE user SET avatar='$image' WHERE id='$id'"; mysqli_query($conn, $sql); if (move_uploaded_file($_FILES['image']['tmp_name'], $target)) { $msg = "Uploaded file."; } else { $msg = "there was a problem uploading image"; } } if (isset($_POST['upload'])) { $imageName = mysqli_real_escape_string($conn, $_FILES['image']['name']); $imageData = mysqli_real_escape_string($conn,file_get_contents($_FILES['image']['tmp_name'])); $imageType = mysqli_real_escape_string($conn, $_FILES['image']['type']); if (substr($imageType, 0, 5) == "image") { $sql = "UPDATE user SET avatar='$imageData' WHERE id='$id'"; mysqli_query($conn, $sql); echo "Image uploaded!"; } else { echo "only images are allowed"; } } $sql = "SELECT * FROM user"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $id = $row['id']; $sqlImg = "SELECT * FROM profileimg WHERE userid='$id'"; $resultImg = mysqli_query($conn, $sqlImg); while ($rowImg = mysqli_fetch_assoc($resultImg)) { echo "<div class='user-container'>"; if ($rowImg['status'] == 0) { echo "<img src='img/profile".$id.".jpg?'".mt_rand().">"; } else { echo "<img src='img/profiledefault.jpg'>"; } echo "<p>".$row['uid']."</p>"; echo "</div>"; } } } else { echo "There are no users yet!"; } // if ($userRow['image'] == "") { echo "<form action='".upload($conn)."' method='POST' enctype='multipart/form-data'> <input type='file' name='file'> <button type='submit' name='submit'>UPLOAD</button> </form>"; if (isset($_POST['upload'])) { } else { } // } // function upload($conn) { // $id = $_SESSION['id']; // // // if (isset($_POST['submit'])) { // $file = $_FILES['file']; // $fileName = $file['name']; // $fileTmpName = $file['tmp_name']; // $fileSize = $file['size']; // $fileError = $file['error']; // $fileType = $file['type']; // // $fileExt = explode('.', $fileName); // $fileActualExt = strtolower(end($fileExt)); // // $allowed = array('jpg', 'jpeg', 'png', 'pdf'); // // if (in_array($fileActualExt, $allowed)) { // if ($fileError === 0) { // if ($fileSize < 1000000) { // $fileNameNew = "profile".$id.".".$fileActualExt; // $fileDestination = 'uploads/'.$fileNameNew; // move_uploaded_file($fileTmpName, $fileDestination); // $sql = "UPDATE profileimg SET status =0 WHERE userid='$id'"; // $result = mysqli_query($conn, $sql); // header("Location: index.php?uploadsuccess"); // } else { // echo "Your file is too big!"; // } // } else { // echo "There was an error uploading your file!"; // } // } else { // echo "You cannot upload files of this type!"; // } // } // }
vicols92/linkify
resources/includes/TRASH/KANSKESPARA.php
PHP
mit
3,055
28.375
96
0.534534
false
module Twitter class JSONStream protected def reconnect_after timeout @reconnect_callback.call(timeout, @reconnect_retries) if @reconnect_callback if timeout == 0 reconnect @options[:host], @options[:port] start_tls if @options[:ssl] else EventMachine.add_timer(timeout) do reconnect @options[:host], @options[:port] start_tls if @options[:ssl] end end end end end module TwitterOAuth class Client private def consumer @consumer ||= OAuth::Consumer.new( @consumer_key, @consumer_secret, { :site => 'https://api.twitter.com', :proxy => @proxy } ) end end end class String def c(*codes) return self if Earthquake.config[:lolize] codes = codes.flatten.map { |code| case code when String, Symbol Earthquake.config[:color][code.to_sym] rescue nil else code end }.compact.unshift(0) "\e[#{codes.join(';')}m#{self}\e[0m" end def coloring(pattern, color = nil, &block) return self if Earthquake.config[:lolize] self.gsub(pattern) do |i| applied_colors = $`.scan(/\e\[[\d;]+m/) c = color || block.call(i) "#{i.c(c)}#{applied_colors.join}" end end t = { ?& => "&amp;", ?< => "&lt;", ?> => "&gt;", ?' => "&apos;", ?" => "&quot;", } define_method(:u) do gsub(/(#{Regexp.union(t.values)})/o, t.invert) end define_method(:e) do gsub(/[#{t.keys.join}]/o, t) end end
neurodrone/earthquake
lib/earthquake/ext.rb
Ruby
mit
1,538
20.068493
82
0.555267
false
namespace Jello.Nodes { public abstract class TerminalNode<T> : Node<T> where T : class { public override INode GetSingleChild() { return null; } } }
jordanwallwork/jello
src/Jello/Nodes/TerminalNode.cs
C#
mit
197
18.8
67
0.558376
false
module Dotify class Version # The Checkup class is responsible for # reaching out to Rubygems.org and retrieving # the latest gem version. class Checker class << self attr_reader :result, :resp end def self.check_latest_release! @result = (latest == Version.build.level) end def self.latest fetch.map { |v| v['number'] }.max end private def self.fetch require 'multi_json' @resp = Net::HTTP.get('rubygems.org', '/api/v1/versions/dotify.json') MultiJson.load(@resp) end end end end
mattdbridges/dotify
lib/dotify/version/checker.rb
Ruby
mit
622
19.766667
79
0.57717
false
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2011-2012 Litecoin Developers // Copyright (c) 2013 Fastcoin Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "irc.h" #include "net.h" #include "strlcpy.h" #include "base58.h" using namespace std; using namespace boost; int nGotIRCAddresses = 0; void ThreadIRCSeed2(void* parg); #pragma pack(push, 1) struct ircaddr { struct in_addr ip; short port; }; #pragma pack(pop) string EncodeAddress(const CService& addr) { struct ircaddr tmp; if (addr.GetInAddr(&tmp.ip)) { tmp.port = htons(addr.GetPort()); vector<unsigned char> vch(UBEGIN(tmp), UEND(tmp)); return string("u") + EncodeBase58Check(vch); } return ""; } bool DecodeAddress(string str, CService& addr) { vector<unsigned char> vch; if (!DecodeBase58Check(str.substr(1), vch)) return false; struct ircaddr tmp; if (vch.size() != sizeof(tmp)) return false; memcpy(&tmp, &vch[0], sizeof(tmp)); addr = CService(tmp.ip, ntohs(tmp.port)); return true; } static bool Send(SOCKET hSocket, const char* pszSend) { if (strstr(pszSend, "PONG") != pszSend) printf("IRC SENDING: %s\n", pszSend); const char* psz = pszSend; const char* pszEnd = psz + strlen(psz); while (psz < pszEnd) { int ret = send(hSocket, psz, pszEnd - psz, MSG_NOSIGNAL); if (ret < 0) return false; psz += ret; } return true; } bool RecvLineIRC(SOCKET hSocket, string& strLine) { loop { bool fRet = RecvLine(hSocket, strLine); if (fRet) { if (fShutdown) return false; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() >= 1 && vWords[0] == "PING") { strLine[1] = 'O'; strLine += '\r'; Send(hSocket, strLine.c_str()); continue; } } return fRet; } } int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL, const char* psz4=NULL) { loop { string strLine; strLine.reserve(10000); if (!RecvLineIRC(hSocket, strLine)) return 0; printf("IRC %s\n", strLine.c_str()); if (psz1 && strLine.find(psz1) != string::npos) return 1; if (psz2 && strLine.find(psz2) != string::npos) return 2; if (psz3 && strLine.find(psz3) != string::npos) return 3; if (psz4 && strLine.find(psz4) != string::npos) return 4; } } bool Wait(int nSeconds) { if (fShutdown) return false; printf("IRC waiting %d seconds to reconnect\n", nSeconds); for (int i = 0; i < nSeconds; i++) { if (fShutdown) return false; Sleep(1000); } return true; } bool RecvCodeLine(SOCKET hSocket, const char* psz1, string& strRet) { strRet.clear(); loop { string strLine; if (!RecvLineIRC(hSocket, strLine)) return false; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() < 2) continue; if (vWords[1] == psz1) { printf("IRC %s\n", strLine.c_str()); strRet = strLine; return true; } } } bool GetIPFromIRC(SOCKET hSocket, string strMyName, CNetAddr& ipRet) { Send(hSocket, strprintf("USERHOST %s\r", strMyName.c_str()).c_str()); string strLine; if (!RecvCodeLine(hSocket, "302", strLine)) return false; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() < 4) return false; string str = vWords[3]; if (str.rfind("@") == string::npos) return false; string strHost = str.substr(str.rfind("@")+1); // Hybrid IRC used by lfnet always returns IP when you userhost yourself, // but in case another IRC is ever used this should work. printf("GetIPFromIRC() got userhost %s\n", strHost.c_str()); CNetAddr addr(strHost, true); if (!addr.IsValid()) return false; ipRet = addr; return true; } void ThreadIRCSeed(void* parg) { IMPLEMENT_RANDOMIZE_STACK(ThreadIRCSeed(parg)); // Make this thread recognisable as the IRC seeding thread RenameThread("bitcoin-ircseed"); try { ThreadIRCSeed2(parg); } catch (std::exception& e) { PrintExceptionContinue(&e, "ThreadIRCSeed()"); } catch (...) { PrintExceptionContinue(NULL, "ThreadIRCSeed()"); } printf("ThreadIRCSeed exited\n"); } void ThreadIRCSeed2(void* parg) { /* Dont advertise on IRC if we don't allow incoming connections */ if (mapArgs.count("-connect") || fNoListen) return; if (!GetBoolArg("-irc", false)) return; printf("ThreadIRCSeed started\n"); int nErrorWait = 10; int nRetryWait = 10; while (!fShutdown) { CService addrConnect("92.243.23.21", 6667); // irc.lfnet.org CService addrIRC("irc.lfnet.org", 6667, true); if (addrIRC.IsValid()) addrConnect = addrIRC; SOCKET hSocket; if (!ConnectSocket(addrConnect, hSocket)) { printf("IRC connect failed\n"); nErrorWait = nErrorWait * 11 / 10; if (Wait(nErrorWait += 60)) continue; else return; } if (!RecvUntil(hSocket, "Found your hostname", "using your IP address instead", "Couldn't look up your hostname", "ignoring hostname")) { closesocket(hSocket); hSocket = INVALID_SOCKET; nErrorWait = nErrorWait * 11 / 10; if (Wait(nErrorWait += 60)) continue; else return; } CNetAddr addrIPv4("1.2.3.4"); // arbitrary IPv4 address to make GetLocal prefer IPv4 addresses CService addrLocal; string strMyName; if (GetLocal(addrLocal, &addrIPv4)) strMyName = EncodeAddress(GetLocalAddress(&addrConnect)); if (strMyName == "") strMyName = strprintf("x%u", GetRand(1000000000)); Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str()); Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str()); int nRet = RecvUntil(hSocket, " 004 ", " 433 "); if (nRet != 1) { closesocket(hSocket); hSocket = INVALID_SOCKET; if (nRet == 2) { printf("IRC name already in use\n"); Wait(10); continue; } nErrorWait = nErrorWait * 11 / 10; if (Wait(nErrorWait += 60)) continue; else return; } Sleep(500); // Get our external IP from the IRC server and re-nick before joining the channel CNetAddr addrFromIRC; if (GetIPFromIRC(hSocket, strMyName, addrFromIRC)) { printf("GetIPFromIRC() returned %s\n", addrFromIRC.ToString().c_str()); if (addrFromIRC.IsRoutable()) { // IRC lets you to re-nick AddLocal(addrFromIRC, LOCAL_IRC); strMyName = EncodeAddress(GetLocalAddress(&addrConnect)); Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str()); } } if (fTestNet) { Send(hSocket, "JOIN #fastcoinTEST3\r"); Send(hSocket, "WHO #fastcoinTEST3\r"); } else { // randomly join #fastcoin00-#fastcoin99 int channel_number = GetRandInt(100); channel_number = 0; // Fastcoin: for now, just use one channel Send(hSocket, strprintf("JOIN #fastcoin%02d\r", channel_number).c_str()); Send(hSocket, strprintf("WHO #fastcoin%02d\r", channel_number).c_str()); } int64 nStart = GetTime(); string strLine; strLine.reserve(10000); while (!fShutdown && RecvLineIRC(hSocket, strLine)) { if (strLine.empty() || strLine.size() > 900 || strLine[0] != ':') continue; vector<string> vWords; ParseString(strLine, ' ', vWords); if (vWords.size() < 2) continue; char pszName[10000]; pszName[0] = '\0'; if (vWords[1] == "352" && vWords.size() >= 8) { // index 7 is limited to 16 characters // could get full length name at index 10, but would be different from join messages strlcpy(pszName, vWords[7].c_str(), sizeof(pszName)); printf("IRC got who\n"); } if (vWords[1] == "JOIN" && vWords[0].size() > 1) { // :username!username@50000007.F000000B.90000002.IP JOIN :#channelname strlcpy(pszName, vWords[0].c_str() + 1, sizeof(pszName)); if (strchr(pszName, '!')) *strchr(pszName, '!') = '\0'; printf("IRC got join\n"); } if (pszName[0] == 'u') { CAddress addr; if (DecodeAddress(pszName, addr)) { addr.nTime = GetAdjustedTime(); if (addrman.Add(addr, addrConnect, 51 * 60)) printf("IRC got new address: %s\n", addr.ToString().c_str()); nGotIRCAddresses++; } else { printf("IRC decode failed\n"); } } } closesocket(hSocket); hSocket = INVALID_SOCKET; if (GetTime() - nStart > 20 * 60) { nErrorWait /= 3; nRetryWait /= 3; } nRetryWait = nRetryWait * 11 / 10; if (!Wait(nRetryWait += 60)) return; } } #ifdef TEST int main(int argc, char *argv[]) { WSADATA wsadata; if (WSAStartup(MAKEWORD(2,2), &wsadata) != NO_ERROR) { printf("Error at WSAStartup()\n"); return false; } ThreadIRCSeed(NULL); WSACleanup(); return 0; } #endif
RandCoin/randcoin
src/irc.cpp
C++
mit
10,568
25.686869
143
0.530185
false
package fyskam.fyskamssngbok; import android.app.Activity; import android.app.ActionBar; import android.app.Fragment; import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast; /** * Fragment used for managing interactions for and presentation of a navigation drawer. * See the <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction"> * design guidelines</a> for a complete explanation of the behaviors implemented here. */ public class NavigationDrawerFragment extends Fragment { /** * Remember the position of the selected item. */ private static final String STATE_SELECTED_POSITION = "selected_navigation_drawer_position"; /** * Per the design guidelines, you should show the drawer on launch until the user manually * expands it. This shared preference tracks this. */ private static final String PREF_USER_LEARNED_DRAWER = "navigation_drawer_learned"; /** * A pointer to the current callbacks instance (the Activity). */ private NavigationDrawerCallbacks mCallbacks; /** * Helper component that ties the action bar to the navigation drawer. */ private ActionBarDrawerToggle mDrawerToggle; private DrawerLayout mDrawerLayout; private ListView mDrawerListView; private View mFragmentContainerView; private int mCurrentSelectedPosition = 0; private boolean mFromSavedInstanceState; private boolean mUserLearnedDrawer; public NavigationDrawerFragment() { } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Read in the flag indicating whether or not the user has demonstrated awareness of the // drawer. See PREF_USER_LEARNED_DRAWER for details. SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity()); mUserLearnedDrawer = sp.getBoolean(PREF_USER_LEARNED_DRAWER, false); if (savedInstanceState != null) { mCurrentSelectedPosition = savedInstanceState.getInt(STATE_SELECTED_POSITION); mFromSavedInstanceState = true; } // Select either the default item (0) or the last selected item. selectItem(mCurrentSelectedPosition); } @Override public void onActivityCreated (Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // Indicate that this fragment would like to influence the set of actions in the action bar. setHasOptionsMenu(true); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mDrawerListView = (ListView) inflater.inflate( R.layout.fragment_navigation_drawer, container, false); mDrawerListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { selectItem(position); } }); mDrawerListView.setAdapter(new ArrayAdapter<String>( getActionBar().getThemedContext(), android.R.layout.simple_list_item_activated_1, android.R.id.text1, new String[]{ getString(R.string.title_section1), getString(R.string.title_section2), getString(R.string.title_section3), })); mDrawerListView.setItemChecked(mCurrentSelectedPosition, true); return mDrawerListView; } public boolean isDrawerOpen() { return mDrawerLayout != null && mDrawerLayout.isDrawerOpen(mFragmentContainerView); } /** * Users of this fragment must call this method to set up the navigation drawer interactions. * * @param fragmentId The android:id of this fragment in its activity's layout. * @param drawerLayout The DrawerLayout containing this fragment's UI. */ public void setUp(int fragmentId, DrawerLayout drawerLayout) { mFragmentContainerView = getActivity().findViewById(fragmentId); mDrawerLayout = drawerLayout; // set a custom shadow that overlays the main content when the drawer opens mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START); // set up the drawer's list view with items and click listener ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setHomeButtonEnabled(true); // ActionBarDrawerToggle ties together the the proper interactions // between the navigation drawer and the action bar app icon. mDrawerToggle = new ActionBarDrawerToggle( getActivity(), /* host Activity */ mDrawerLayout, /* DrawerLayout object */ R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */ R.string.navigation_drawer_open, /* "open drawer" description for accessibility */ R.string.navigation_drawer_close /* "close drawer" description for accessibility */ ) { @Override public void onDrawerClosed(View drawerView) { super.onDrawerClosed(drawerView); if (!isAdded()) { return; } getActivity().invalidateOptionsMenu(); // calls onPrepareOptionsMenu() } @Override public void onDrawerOpened(View drawerView) { super.onDrawerOpened(drawerView); if (!isAdded()) { return; } if (!mUserLearnedDrawer) { // The user manually opened the drawer; store this flag to prevent auto-showing // the navigation drawer automatically in the future. mUserLearnedDrawer = true; SharedPreferences sp = PreferenceManager .getDefaultSharedPreferences(getActivity()); sp.edit().putBoolean(PREF_USER_LEARNED_DRAWER, true).apply(); } getActivity().invalidateOptionsMenu(); // calls onPrepareOptionsMenu() } }; // If the user hasn't 'learned' about the drawer, open it to introduce them to the drawer, // per the navigation drawer design guidelines. if (!mUserLearnedDrawer && !mFromSavedInstanceState) { mDrawerLayout.openDrawer(mFragmentContainerView); } // Defer code dependent on restoration of previous instance state. mDrawerLayout.post(new Runnable() { @Override public void run() { mDrawerToggle.syncState(); } }); mDrawerLayout.setDrawerListener(mDrawerToggle); } private void selectItem(int position) { mCurrentSelectedPosition = position; if (mDrawerListView != null) { mDrawerListView.setItemChecked(position, true); } if (mDrawerLayout != null) { mDrawerLayout.closeDrawer(mFragmentContainerView); } if (mCallbacks != null) { mCallbacks.onNavigationDrawerItemSelected(position); } } @Override public void onAttach(Activity activity) { super.onAttach(activity); try { mCallbacks = (NavigationDrawerCallbacks) activity; } catch (ClassCastException e) { throw new ClassCastException("Activity must implement NavigationDrawerCallbacks."); } } @Override public void onDetach() { super.onDetach(); mCallbacks = null; } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(STATE_SELECTED_POSITION, mCurrentSelectedPosition); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); // Forward the new configuration the drawer toggle component. mDrawerToggle.onConfigurationChanged(newConfig); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { // If the drawer is open, show the global app actions in the action bar. See also // showGlobalContextActionBar, which controls the top-left area of the action bar. if (mDrawerLayout != null && isDrawerOpen()) { inflater.inflate(R.menu.global, menu); showGlobalContextActionBar(); } super.onCreateOptionsMenu(menu, inflater); } @Override public boolean onOptionsItemSelected(MenuItem item) { if (mDrawerToggle.onOptionsItemSelected(item)) { return true; } if (item.getItemId() == R.id.action_example) { Toast.makeText(getActivity(), "Example action.", Toast.LENGTH_SHORT).show(); return true; } return super.onOptionsItemSelected(item); } /** * Per the navigation drawer design guidelines, updates the action bar to show the global app * 'context', rather than just what's in the current screen. */ private void showGlobalContextActionBar() { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setTitle(R.string.app_name); } private ActionBar getActionBar() { return getActivity().getActionBar(); } /** * Callbacks interface that all activities using this fragment must implement. */ public static interface NavigationDrawerCallbacks { /** * Called when an item in the navigation drawer is selected. */ void onNavigationDrawerItemSelected(int position); } }
fyskam/FysKams-sangbok
FysKamsSangbok/app/src/main/java/fyskam/fyskamssngbok/NavigationDrawerFragment.java
Java
mit
10,600
36.588652
102
0.653019
false
/*************************************************************************/ /* surface_tool.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #ifndef SURFACE_TOOL_H #define SURFACE_TOOL_H #include "scene/resources/mesh.h" #include "thirdparty/misc/mikktspace.h" class SurfaceTool : public Reference { GDCLASS(SurfaceTool, Reference); public: struct Vertex { Vector3 vertex; Color color; Vector3 normal; // normal, binormal, tangent Vector3 binormal; Vector3 tangent; Vector2 uv; Vector2 uv2; Vector<int> bones; Vector<float> weights; bool operator==(const Vertex &p_vertex) const; Vertex() {} }; private: struct VertexHasher { static _FORCE_INLINE_ uint32_t hash(const Vertex &p_vtx); }; bool begun; bool first; Mesh::PrimitiveType primitive; int format; Ref<Material> material; //arrays List<Vertex> vertex_array; List<int> index_array; Map<int, bool> smooth_groups; //memory Color last_color; Vector3 last_normal; Vector2 last_uv; Vector2 last_uv2; Vector<int> last_bones; Vector<float> last_weights; Plane last_tangent; void _create_list_from_arrays(Array arr, List<Vertex> *r_vertex, List<int> *r_index, int &lformat); void _create_list(const Ref<Mesh> &p_existing, int p_surface, List<Vertex> *r_vertex, List<int> *r_index, int &lformat); //mikktspace callbacks static int mikktGetNumFaces(const SMikkTSpaceContext *pContext); static int mikktGetNumVerticesOfFace(const SMikkTSpaceContext *pContext, const int iFace); static void mikktGetPosition(const SMikkTSpaceContext *pContext, float fvPosOut[], const int iFace, const int iVert); static void mikktGetNormal(const SMikkTSpaceContext *pContext, float fvNormOut[], const int iFace, const int iVert); static void mikktGetTexCoord(const SMikkTSpaceContext *pContext, float fvTexcOut[], const int iFace, const int iVert); static void mikktSetTSpaceBasic(const SMikkTSpaceContext *pContext, const float fvTangent[], const float fSign, const int iFace, const int iVert); protected: static void _bind_methods(); public: void begin(Mesh::PrimitiveType p_primitive); void add_vertex(const Vector3 &p_vertex); void add_color(Color p_color); void add_normal(const Vector3 &p_normal); void add_tangent(const Plane &p_tangent); void add_uv(const Vector2 &p_uv); void add_uv2(const Vector2 &p_uv); void add_bones(const Vector<int> &p_indices); void add_weights(const Vector<float> &p_weights); void add_smooth_group(bool p_smooth); void add_triangle_fan(const Vector<Vector3> &p_vertexes, const Vector<Vector2> &p_uvs = Vector<Vector2>(), const Vector<Color> &p_colors = Vector<Color>(), const Vector<Vector2> &p_uv2s = Vector<Vector2>(), const Vector<Vector3> &p_normals = Vector<Vector3>(), const Vector<Plane> &p_tangents = Vector<Plane>()); void add_index(int p_index); void index(); void deindex(); void generate_normals(); void generate_tangents(); void add_to_format(int p_flags) { format |= p_flags; } void set_material(const Ref<Material> &p_material); void clear(); List<Vertex> &get_vertex_array() { return vertex_array; } void create_from_triangle_arrays(const Array &p_arrays); Array commit_to_arrays(); void create_from(const Ref<Mesh> &p_existing, int p_surface); void append_from(const Ref<Mesh> &p_existing, int p_surface, const Transform &p_xform); Ref<ArrayMesh> commit(const Ref<ArrayMesh> &p_existing = Ref<ArrayMesh>()); SurfaceTool(); }; #endif
tomreyn/godot
scene/resources/surface_tool.h
C
mit
5,483
39.316176
313
0.618822
false
#pragma once class Menu : public QWidget { private: QGridLayout layout; QPushButton play_single; QPushButton play_2v2; QPushButton play_multi; public: Menu(Window *window, Game *game); };
dawidd6/qtictactoe
include/Menu.h
C
mit
201
15.75
35
0.721393
false
import uuid from uqbar.objects import new from supriya.patterns.Pattern import Pattern class EventPattern(Pattern): ### CLASS VARIABLES ### __slots__ = () ### SPECIAL METHODS ### def _coerce_iterator_output(self, expr, state=None): import supriya.patterns if not isinstance(expr, supriya.patterns.Event): expr = supriya.patterns.NoteEvent(**expr) if expr.get("uuid") is None: expr = new(expr, uuid=uuid.uuid4()) return expr ### PUBLIC METHODS ### def play(self, clock=None, server=None): import supriya.patterns import supriya.realtime event_player = supriya.patterns.RealtimeEventPlayer( self, clock=clock, server=server or supriya.realtime.Server.default() ) event_player.start() return event_player def with_bus(self, calculation_rate="audio", channel_count=None, release_time=0.25): import supriya.patterns return supriya.patterns.Pbus( self, calculation_rate=calculation_rate, channel_count=channel_count, release_time=release_time, ) def with_effect(self, synthdef, release_time=0.25, **settings): import supriya.patterns return supriya.patterns.Pfx( self, synthdef=synthdef, release_time=release_time, **settings ) def with_group(self, release_time=0.25): import supriya.patterns return supriya.patterns.Pgroup(self, release_time=release_time)
Pulgama/supriya
supriya/patterns/EventPattern.py
Python
mit
1,545
26.105263
88
0.628479
false
/* Copyright (c) 2011 Andrei Mackenzie Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // Compute the edit distance between the two given strings exports.getEditDistance = function(a, b){ if(a.length == 0) return b.length; if(b.length == 0) return a.length; var matrix = []; // increment along the first column of each row var i; for(i = 0; i <= b.length; i++){ matrix[i] = [i]; } // increment each column in the first row var j; for(j = 0; j <= a.length; j++){ matrix[0][j] = j; } // Fill in the rest of the matrix for(i = 1; i <= b.length; i++){ for(j = 1; j <= a.length; j++){ if(b.charAt(i-1) == a.charAt(j-1)){ matrix[i][j] = matrix[i-1][j-1]; } else { matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, // substitution Math.min(matrix[i][j-1] + 1, // insertion matrix[i-1][j] + 1)); // deletion } } } return matrix[b.length][a.length]; };
crazyfacka/text2meo
data/lib/levenshtein.js
JavaScript
mit
1,980
44
460
0.663131
false
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Pervasive_Heart_Monitor { class Program { static bool checknum(string s) { return (s.Contains("1") || s.Contains("2") || s.Contains("3") || s.Contains("4") || s.Contains("5") || s.Contains("6") || s.Contains("7") || s.Contains("8") || s.Contains("9") || s.Contains(".")); } static void Main(string[] args) { string s = Console.ReadLine(); while (!string.IsNullOrEmpty(s)) { float total=0; int n=0; string name = ""; string[] ssplit = s.Split(); for(int i = 0; i < ssplit.Length; i++) { if (!checknum(ssplit[i])) { name += (ssplit[i] + " "); } else { total += float.Parse(ssplit[i]); n++; } } Console.WriteLine("{0:F6} {1}", (float)(total / n), name); s = Console.ReadLine(); } } } }
SurgicalSteel/Competitive-Programming
Kattis-Solutions/Pervasive Heart Monitor.cs
C#
mit
1,202
30.631579
208
0.424293
false
//! \file ArcSG.cs //! \date 2018 Feb 01 //! \brief 'fSGX' multi-frame image container. // // Copyright (C) 2018 by morkt // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. // using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; namespace GameRes.Formats.Ivory { [Export(typeof(ArchiveFormat))] public class SgOpener : ArchiveFormat { public override string Tag { get { return "SG/cOBJ"; } } public override string Description { get { return "Ivory multi-frame image"; } } public override uint Signature { get { return 0x58475366; } } // 'fSGX' public override bool IsHierarchic { get { return false; } } public override bool CanWrite { get { return false; } } public override ArcFile TryOpen (ArcView file) { long offset = 8; var base_name = Path.GetFileNameWithoutExtension (file.Name); var dir = new List<Entry>(); while (offset < file.MaxOffset && file.View.AsciiEqual (offset, "cOBJ")) { uint obj_size = file.View.ReadUInt32 (offset+4); if (0 == obj_size) break; if (file.View.AsciiEqual (offset+0x10, "fSG ")) { var entry = new Entry { Name = string.Format ("{0}#{1}", base_name, dir.Count), Type = "image", Offset = offset+0x10, Size = file.View.ReadUInt32 (offset+0x14), }; dir.Add (entry); } offset += obj_size; } if (0 == dir.Count) return null; return new ArcFile (file, this, dir); } } }
morkt/GARbro
ArcFormats/Ivory/ArcSG.cs
C#
mit
2,865
41.132353
88
0.604538
false
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace track_downloader { class Program { static void Main(string[] args) { string[] blacklisted = Console.ReadLine().Split(); List<string> filenames = ReadFilenames(); filenames = filenames .Where(a => ContainsBlackListed(a, blacklisted)) .OrderBy(a => a) .ToList(); Console.WriteLine(string.Join("\r\n", filenames)); } private static bool ContainsBlackListed(string a, string[] blacklisted) { for (int i = 0; i < blacklisted.Length; i++) { if (a.Contains(blacklisted[i])) { return false; } } return true; } private static List<string> ReadFilenames() { List<string> output = new List<string>(); string filename = Console.ReadLine(); while (filename != "end") { output.Add(filename); filename = Console.ReadLine(); } return output; } } }
Avarea/Programming-Fundamentals
Lists/02TrackDownloader/Program.cs
C#
mit
1,263
26.434783
79
0.494845
false
import React, { PropTypes } from 'react'; import { connect } from 'react-redux'; import GroupPage from './GroupPage.js'; import GroupNotFoundPage from './GroupNotFoundPage.js'; const Group = ({ isValid, groupId }) => (isValid ? <GroupPage groupId={groupId} /> : <GroupNotFoundPage groupId={groupId} />); Group.propTypes = { groupId: PropTypes.string, isValid: PropTypes.bool.isRequired }; export default connect(state => ({ groupId: state.router.params.groupId, isValid: !!state.groups.data[state.router.params.groupId] }))(Group);
logger-app/logger-app
src/containers/Group/Group.js
JavaScript
mit
545
29.277778
126
0.715596
false
using System; using System.Data.Entity; using System.Data.Entity.Migrations; using SimplePersistence.Example.Console.Models.Logging; using SimplePersistence.Example.Console.UoW.EF.Mapping; namespace SimplePersistence.Example.Console.UoW.EF.Migrations { public sealed class Configuration : DropCreateDatabaseIfModelChanges<ConsoleDbContext>//DbMigrationsConfiguration<ConsoleDbContext> { //public Configuration() //{ // AutomaticMigrationsEnabled = false; //} protected override void Seed(ConsoleDbContext context) { context.Applications.AddOrUpdate( e => e.Id, new Application { Id = "SimplePersistence.Example.Console", Description = "The SimplePersistence.Example.Console application", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }); context.Levels.AddOrUpdate( e => e.Id, new Level { Id = "DEBUG", Description = "Debug", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }, new Level { Id = "Info", Description = "Information", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }, new Level { Id = "WARN", Description = "Warning", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }, new Level { Id = "ERROR", Description = "Error", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }, new Level { Id = "FATAL", Description = "Fatal", CreatedOn = DateTime.Now, CreatedBy = "seed.migration" }); } } }
gravity00/SimplePersistence
Examples/SimplePersistence.Example.Console/SimplePersistence.Example.Console.UoW.EF/Migrations/Configuration.cs
C#
mit
2,232
32.313433
135
0.452509
false
class CreateItineraries < ActiveRecord::Migration def change create_table :itineraries do |t| t.references :user t.timestamps null: false end end end
nyc-fiddler-crabs-2015/Velox
db/migrate/20150328200056_create_itineraries.rb
Ruby
mit
176
18.555556
49
0.6875
false
// node-vcdiff // https://github.com/baranov1ch/node-vcdiff // // Copyright 2014 Alexey Baranov <me@kotiki.cc> // Released under the MIT license #ifndef VCDIFF_H_ #define VCDIFF_H_ #include <memory> #include <string> #include <node.h> #include <node_object_wrap.h> #include <uv.h> #include <v8.h> namespace open_vcdiff { class OutputStringInterface; } class VcdCtx : public node::ObjectWrap { public: enum class Mode { ENCODE, DECODE, }; enum class Error { OK, INIT_ERROR, ENCODE_ERROR, DECODE_ERROR, }; class Coder { public: virtual Error Start(open_vcdiff::OutputStringInterface* out) = 0; virtual Error Process(const char* data, size_t len, open_vcdiff::OutputStringInterface* out) = 0; virtual Error Finish(open_vcdiff::OutputStringInterface* out) = 0; virtual ~Coder() {} }; VcdCtx(std::unique_ptr<Coder> coder); virtual ~VcdCtx(); static void Init(v8::Handle<v8::Object> exports); static v8::Persistent<v8::Function> constructor; static void New(const v8::FunctionCallbackInfo<v8::Value>& args); static void WriteAsync(const v8::FunctionCallbackInfo<v8::Value>& args); static void WriteSync(const v8::FunctionCallbackInfo<v8::Value>& args); static void Close(const v8::FunctionCallbackInfo<v8::Value>& args); private: enum class State { IDLE, PROCESSING, FINALIZING, DONE, }; struct WorkData { VcdCtx* ctx; v8::Isolate* isolate; const char* data; size_t len; bool is_last; }; static void WriteInternal( const v8::FunctionCallbackInfo<v8::Value>& args, bool async); v8::Local<v8::Object> Write( v8::Local<v8::Object> buffer, bool is_last, bool async); v8::Local<v8::Array> FinishWrite(v8::Isolate* isolate); void Process(const char* data, size_t len, bool is_last); bool CheckError(v8::Isolate* isolate); void SendError(v8::Isolate* isolate); void Close(); void Reset(); bool HasError() const; v8::Local<v8::Object> GetOutputBuffer(v8::Isolate* isolate); static const char* GetErrorString(Error err); static void ProcessShim(uv_work_t* work_req); static void AfterShim(uv_work_t* work_req, int status); std::unique_ptr<Coder> coder_; v8::Persistent<v8::Object> in_buffer_; // hold reference when async uv_work_t work_req_; bool write_in_progress_ = false; bool pending_close_ = false; State state_ = State::IDLE; Error err_ = Error::OK; std::string output_buffer_; VcdCtx(const VcdCtx& other) = delete; VcdCtx& operator=(const VcdCtx& other) = delete; }; #endif // VCDIFF_H_
baranov1ch/node-vcdiff
src/vcdiff.h
C
mit
2,632
23.830189
74
0.667933
false
import assert from 'assert' import { THREAD_COUNT, CURSOR_BUFFER_SIZE, THREAD_COUNTER_BYTE_LENGTH, } from './constants' import { InputCursor, StoredEventBatchPointer, StoredEventPointer, } from './types' const checkThreadArrayLength = (threadArray: Array<number>): void => { assert.strictEqual( threadArray.length, THREAD_COUNT, 'Cursor must be represented by array of 256 numbers' ) } export const initThreadArray = (): Array<number> => { const threadCounters = new Array<number>(THREAD_COUNT) threadCounters.fill(0) return threadCounters } export const threadArrayToCursor = (threadArray: Array<number>): string => { checkThreadArrayLength(threadArray) const cursorBuffer: Buffer = Buffer.alloc(CURSOR_BUFFER_SIZE) for (let i = 0; i < threadArray.length; ++i) { cursorBuffer.writeUIntBE( threadArray[i], i * THREAD_COUNTER_BYTE_LENGTH, THREAD_COUNTER_BYTE_LENGTH ) } return cursorBuffer.toString('base64') } export const cursorToThreadArray = (cursor: InputCursor): Array<number> => { if (cursor == null) return initThreadArray() const cursorBuffer = Buffer.from(cursor, 'base64') assert.strictEqual( cursorBuffer.length, CURSOR_BUFFER_SIZE, 'Wrong size of cursor buffer' ) const threadCounters = new Array<number>(THREAD_COUNT) for (let i = 0; i < cursorBuffer.length / THREAD_COUNTER_BYTE_LENGTH; i++) { threadCounters[i] = cursorBuffer.readUIntBE( i * THREAD_COUNTER_BYTE_LENGTH, THREAD_COUNTER_BYTE_LENGTH ) } return threadCounters } export const emptyLoadEventsResult = ( cursor: InputCursor ): StoredEventBatchPointer => { return { cursor: cursor == null ? threadArrayToCursor(initThreadArray()) : cursor, events: [], } } const calculateMaxThreadArray = ( threadArrays: Array<Array<number>> ): Array<number> => { const maxThreadArray = initThreadArray() for (const threadArray of threadArrays) { checkThreadArrayLength(threadArray) for (let i = 0; i < THREAD_COUNT; ++i) { maxThreadArray[i] = Math.max(maxThreadArray[i], threadArray[i]) } } return maxThreadArray } export const checkEventsContinuity = ( startingCursor: InputCursor, eventCursorPairs: StoredEventPointer[] ): boolean => { const startingThreadArray = cursorToThreadArray(startingCursor) const tuples = eventCursorPairs.map(({ event, cursor }) => { return { event, cursor, threadArray: cursorToThreadArray(cursor), } }) for (let i = 0; i < tuples.length; ++i) { assert.strictEqual( tuples[i].event.threadCounter, tuples[i].threadArray[tuples[i].event.threadId] - 1 ) if ( startingThreadArray[tuples[i].event.threadId] > tuples[i].event.threadCounter ) { return false } } const maxThreadArray = calculateMaxThreadArray( tuples.map((t) => t.threadArray) ) for (const t of tuples) { startingThreadArray[t.event.threadId]++ } for (let i = 0; i < THREAD_COUNT; ++i) { if (maxThreadArray[i] !== startingThreadArray[i]) { return false } } return true }
reimagined/resolve
packages/runtime/adapters/eventstore-adapters/eventstore-base/src/cursor-operations.ts
TypeScript
mit
3,122
23.582677
78
0.679693
false
--- layout: post title: Week 1 Review --- ## Weekly Review (8/30/15) It's Sunday afternoon on the 30th of August, and I've finally managed to set this Jekyll thing up, which means I can now talk about my time in the class this past week! Hooray! Besides being the only class I have on Mondays, Wednesdays, and Fridays, Object Oriented Programming is great so far. Professor Downing structures the course so that the incoming student has a background in programming, but not necessarily in C++. This is great because myself (as well as many other students in the course, I'd assume), have made it through Data Structures (CS 314, a prerequisite to the prerequisite of this class, CS 429), but have no background in the language of C++. While I'm not the biggest fan of the teaching method Prof. Downing uses (the calling out of students at random to answerom questions), the lectures he has given thus far are very interesting and in-depth, taking time to explain even the most minute things. I feel like this course will give students more than just knowledge in a new language at the end of the day; I think it'll give them a much more in-depth idea of how to approach programming problems as well as a set of tools to use during the development process that they didn't even know they had. ## Tip of the Week http://gitref.org/ Familiarizing yourself with Git and the commands associated with it will prove to be invaluable to you as you progress in your programming career. The above website is a bare-bones, to-the-point reference site that helps this process.
ibruton/ibruton.github.io
_posts/2015-8-30-Week-1-Review.md
Markdown
mit
1,577
86.611111
556
0.776791
false
'use strict' let ugly = require('gulp-uglify') ,gulp = require('gulp') ,watch = require('gulp-watch') ,plumber = require('gulp-plumber') ,newer = require('gulp-newer') ,stylus = require('gulp-stylus') ,jade = require('gulp-jade') ,concat = require('gulp-concat') ,rename = require('gulp-rename') ,runSequence = require('run-sequence') ,_ = require('lodash') ,path = require('path') ,fs = require('fs') ,spawn = require('cross-spawn') let cssFolder = __dirname + '/public/css' ,jsFolder = __dirname + '/public/js' ,views = __dirname + '/views' ,stylusOptions = { compress: true } ,uglyOptions = { } gulp.task('stylus', function() { gulp.src(cssFolder + '/*.styl') /* .pipe(newer({ dest: cssFolder ,map: function(path) { return path.replace(/\.styl$/, '.css') } })) */ .pipe(plumber()) .pipe(stylus(stylusOptions)) .pipe(gulp.dest(cssFolder)) }) gulp.task('ugly', function() { gulp.src(jsFolder + '/*.js') .pipe(newer({ dest: jsFolder ,map: function(path) { return path.replace(/\.dev.js$/, '.min.js') } })) .pipe(plumber()) .pipe(rename(function (path) { path.basename = path.basename.replace('.dev', '.min') })) .pipe(gulp.dest(jsFolder)) .pipe(ugly(uglyOptions)) .pipe(gulp.dest(jsFolder)) }) let config = require('./config') let pack = require('./package.json') let packj = require('./node_modules/jade-press/package.json') config.version = pack.version config.siteDesc = packj.description gulp.task('jade', function() { gulp.src(views + '/*.jade') .pipe(plumber()) .pipe(jade({ locals: config })) .pipe(gulp.dest(__dirname)) }) gulp.task('server', function (cb) { var runner = spawn( 'node' ,['server'] ,{ stdio: 'inherit' } ) runner.on('exit', function (code) { process.exit(code) }) runner.on('error', function (err) { cb(err) }) }) gulp.task('watch', function () { runSequence('server') watch([cssFolder + '/*.styl', cssFolder + '/parts/*.styl'], function() { runSequence('stylus') }) watch(jsFolder, function() { runSequence('ugly') }) watch([ views + '/*.jade' ,views + '/parts/*.jade' ], function() { runSequence('jade') } ) }) gulp.task('default', ['watch']) gulp.task('dist', function() { runSequence('stylus', 'ugly', 'jade') })
jade-press/jade-press.org
gulpfile.js
JavaScript
mit
2,290
16.48855
73
0.609607
false
<section class="user-job-wrapper"> <user-job-header></user-job-header> <div class="main-title primary" ng-show="!ctrl.hasInvoice && ctrl.showStatus"> <div class="job-owner-header"> <!-- Choose candidate --> <div ng-show="!ctrl.accepted && !ctrl.will_perform"> <h2>{{'common.you_have' | translate}} {{job_user.data.length}} {{'company.assignments.applications' | translate}}</h2> </div> <div ng-show="!ctrl.accepted && !ctrl.will_perform && job_user.data.length > 0"> <a class="button" href="#{{routes.company.job_candidates.resolve(job_obj)}}">{{'company.assignments.candidates.select.title' | translate}}</a> </div> <!-- Wait user accepted --> <div ng-show="ctrl.accepted && !ctrl.will_perform" ng-click="ctrl.gotoAcceptedCandidate()"> <h2>{{ctrl.user_apply.attributes["first-name"]}} {{'common.have' | translate}} {{ctrl.remainHours}}{{'common.hour' | translate}} {{ctrl.remainMinutes}}{{'common.min' | translate}}<br/> {{'assignment.status.user_application.time_remaining' | translate}}</h2> </div> <!-- Job ongoing --> <div ng-show="ctrl.will_perform && !ctrl.canPerformed" ng-click="ctrl.gotoAcceptedCandidate()"> <h2>{{ctrl.user_apply.attributes["first-name"]}} {{'assignment.status.applicant_approved' | translate}}</h2> </div> <!-- Job performed confirmation --> <div ng-show="(ctrl.will_perform || ctrl.performed) && ctrl.canPerformed"> <h2>{{'assignment.is_approved' | translate}}</h2> </div> <div class="buttons" ng-show="(ctrl.will_perform || ctrl.performed) && ctrl.canPerformed"> <a class="button small" href="" ng-click="ctrl.ownerCancelPerformed()">{{'common.no' | translate}}</a> <a class="button small" href="" ng-click="modalPerformShow=true; isPerformed=false;">{{'common.yes' | translate}}</a> </div> </div> </div> <div class="main-content" ng-hide="userModalPerformShow"> <ul> <li class="select"> <a href="#{{routes.company.job_comments.resolve(job_obj)}}"> <span>{{'user.assignments.comments' | translate}}</span><br/> {{comments_amt}} {{'user.assignments.comment_count' | translate}} </a> </li> <li class="select" ng-repeat="chat in ctrl.userChats.data"> <a href="" ng-click="ctrl.gotoChat(chat['job-users'].id,chat.id);"><span>{{'user.assignments.chat' | translate}}</span><br>{{'user.assignments.conversation' | translate}} {{chat.users.attributes["first-name"]}} {{chat.users.attributes["last-name"]}}</a> </li> </ul> </div> <!-- OWNER modal form performed to create invoice --> <company-job-perform></company-job-perform> </section>
justarrived/just-match-frontend
src/app/common/templates/company-job.html
HTML
mit
3,011
50.931034
269
0.563268
false
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.13"/> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_3.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">載入中...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">搜尋中...</div> <div class="SRStatus" id="NoMatches">無符合項目</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
drm343/MyWorld
docs/search/all_3.html
HTML
mit
1,020
37.384615
121
0.701403
false
<?php require_once __DIR__.'/../../../vendor/autoload.php'; require 'templates/base.php'; session_start(); $client = new Google_Client(); $client->setApplicationName("Slide-Summarizer"); if ($credentials_file = getOAuthCredentialsFile()) { // set the location manually $client->setAuthConfig($credentials_file); $credentials_json = json_decode(file_get_contents($credentials_file)); } else { echo missingServiceAccountDetailsWarning(); return; } $client->setRedirectUri('https://' . $_SERVER['HTTP_HOST'] . '/oauth2callback'); $client->addScope(Google_Service_Drive::DRIVE_READONLY); if (! isset($_GET['code'])) { $auth_url = $client->createAuthUrl(); header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL)); } else { $client->authenticate($_GET['code']); $_SESSION['access_token'] = $client->getAccessToken(); $redirect_uri = 'https://' . $_SERVER['HTTP_HOST'] . '/'; header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL)); }
esimkowitz/Slide-Summarizer
web/public/views/oauth2callback.php
PHP
mit
998
34.678571
80
0.663327
false