text:
package io.spine.server.entity.storage;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.testing.EqualsTester;
import com.google.common.testing.NullPointerTester;
import com.google.protobuf.Any;
import io.spine.base.Identifier;
import io.spine.client.ArchivedColumn;
import io.spine.client.DeletedColumn;
import io.spine.query.ColumnName;
import io.spine.query.RecordColumn;
import io.spine.server.entity.EntityRecord;
import io.spine.server.entity.storage.given.EntityWithoutCustomColumns;
import io.spine.server.entity.storage.given.TestEntity;
import io.spine.server.storage.given.TestColumnMapping;
import io.spine.test.storage.StgProject;
import io.spine.test.storage.StgProjectId;
import io.spine.test.storage.StgTaskId;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;

import java.util.HashMap;
import java.util.Map;

import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static com.google.common.truth.Truth.assertThat;
import static java.util.Collections.singletonMap;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

@DisplayName("`EntityRecordWithColumns` should")
class EntityRecordWithColumnsTest {

    private static final StgTaskId TASK_ID =
            StgTaskId.newBuilder()
                     .setId(42)
                     .build();

    private static final StgProjectId PROJECT_ID =
            StgProjectId.newBuilder()
                        .setId("42")
                        .build();

    private static final Any PACKED_TASK_ID = Identifier.pack(TASK_ID);

    private static EntityRecordWithColumns<?> sampleRecordWithEmptyColumns() {
        return EntityRecordWithColumns.of(sampleEntityRecord());
    }

    private static EntityRecordWithColumns<?> randomRecordWithEmptyColumns() {
        return EntityRecordWithColumns.of(randomEntityRecord());
    }

    private static EntityRecord sampleEntityRecord() {
        return EntityRecord.newBuilder()
                           .setEntityId(PACKED_TASK_ID)
                           .build();
    }

    private static EntityRecord randomEntityRecord() {
        return EntityRecord.newBuilder()
                           .setEntityId(Identifier.pack(Identifier.newUuid()))
                           .build();
    }

    @Test
    @DisplayName("not accept `null`s in constructor")
    void rejectNullInCtor() {
        new NullPointerTester()
                .setDefault(EntityRecord.class, sampleEntityRecord())
                .testAllPublicConstructors(EntityRecordWithColumns.class);
    }

    @Test
    @DisplayName("support equality")
    void supportEquality() {
        var columnName = ArchivedColumn.instance().name();
        Object value = false;
        EntityRecordWithColumns<?> emptyFieldsEnvelope =
                EntityRecordWithColumns.of(sampleEntityRecord());
        EntityRecordWithColumns<?> notEmptyFieldsEnvelope =
                EntityRecordWithColumns.of(sampleEntityRecord(), singletonMap(columnName, value));
        new EqualsTester()
                .addEqualityGroup(emptyFieldsEnvelope)
                .addEqualityGroup(notEmptyFieldsEnvelope)
                .addEqualityGroup(randomRecordWithEmptyColumns())
                .addEqualityGroup(
                        randomRecordWithEmptyColumns()  // Each one has a different `EntityRecord`.
                )
                .testEquals();
    }

    @Test
    @DisplayName("return empty names collection if no storage fields are set")
    void returnEmptyColumns() {
        var record = sampleRecordWithEmptyColumns();
        assertFalse(record.hasColumns());
        var names = record.columnNames();
        assertTrue(names.isEmpty());
    }

    @Test
    @DisplayName("throw `ISE` on attempt to get value by non-existent name")
    void throwOnNonExistentColumn() {
        var record = sampleRecordWithEmptyColumns();
        var nonExistentName = ColumnName.of("non-existent-column");
        assertThrows(IllegalStateException.class, () -> record.columnValue(nonExistentName));
    }

    @Test
    @DisplayName("have `Entity` lifecycle columns even if the entity does not define custom ones")
    void supportEmptyColumns() {
        var entity = new EntityWithoutCustomColumns(TASK_ID);

        var columns = EntityRecordSpec.of(entity);
        var storageFields = columns.valuesIn(entity);

        var record = EntityRecordWithColumns.of(sampleEntityRecord(), storageFields);
        assertThat(record.columnNames())
                .containsExactlyElementsIn(EntityRecordColumn.names());
    }

    @Test
    @DisplayName("return column value by column name")
    void returnColumnValue() {
        var columnName = ColumnName.of("some-boolean-column");
        var columnValue = false;
        ImmutableMap<ColumnName, Object> storageFields = ImmutableMap.of(columnName, columnValue);
        var record = EntityRecordWithColumns.of(sampleEntityRecord(), storageFields);
        var value = record.columnValue(columnName);

        assertThat(value).isEqualTo(columnValue);
    }

    @Test
    @DisplayName("return a column value with the column mapping applied")
    void returnValueWithColumnMapping() {
        var columnName = ColumnName.of("some-int-column");
        var columnValue = 42;

        ImmutableMap<ColumnName, Object> storageFields = ImmutableMap.of(columnName, columnValue);
        var record = EntityRecordWithColumns.of(sampleEntityRecord(), storageFields);
        var value = record.columnValue(columnName, new TestColumnMapping());

        assertThat(value).isEqualTo(String.valueOf(columnValue));
    }

    @Test
    @DisplayName("return `null` column value")
    void returnNullValue() {
        var columnName = ColumnName.of("the-null-column");
        Map<ColumnName, Object> storageFields = new HashMap<>();
        storageFields.put(columnName, null);
        var record = EntityRecordWithColumns.of(sampleEntityRecord(), storageFields);
        var value = record.columnValue(columnName);

        assertThat(value).isNull();
    }

    @Nested
    @DisplayName("support being initialized with")
    class BeInitializedWith {

        @Test
        @DisplayName("an `Entity` identifier and a record")
        void idAndRecord() {
            var rawRecord = sampleEntityRecord();
            Long id = 199L;
            var result = EntityRecordWithColumns.create(id, rawRecord);
            assertThat(result).isNotNull();
            assertThat(result.id()).isEqualTo(id);
            assertThat(result.record()).isEqualTo(rawRecord);
        }

        @Test
        @DisplayName("an `Entity` and a record")
        void entityAndRecord() {
            var entity = new TestEntity(PROJECT_ID);
            var rawRecord = sampleEntityRecord();
            var result = EntityRecordWithColumns.create(entity, rawRecord);
            assertThat(result).isNotNull();
            assertThat(result.id()).isEqualTo(PROJECT_ID);
            assertThat(result.record()).isEqualTo(rawRecord);
            var names = result.columnNames();
            var expectedNames =
                    StgProject.Column.definitions()
                                     .stream()
                                     .map(RecordColumn::name)
                                     .collect(toImmutableSet());
            assertThat(names).containsAtLeastElementsIn(expectedNames);
            assertThat(names).containsAtLeastElementsIn(
                    ImmutableSet.of(ArchivedColumn.instance().name(),
                                    DeletedColumn.instance().name()));
        }
    }

    @Nested
    @DisplayName("store")
    class Store {

        @Test
        @DisplayName("record")
        void record() {
            var recordWithFields = sampleRecordWithEmptyColumns();
            var record = recordWithFields.record();
            assertNotNull(record);
        }

        @Test
        @DisplayName("column values")
        void columnValues() {
            var columnName = DeletedColumn.instance()
                                          .name();
            Object value = false;
            var columnsExpected = singletonMap(columnName, value);
            var record = EntityRecordWithColumns.of(sampleEntityRecord(), columnsExpected);
            var columnNames = record.columnNames();
            assertThat(columnNames).hasSize(1);
            assertTrue(columnNames.contains(columnName));
            assertThat(value).isEqualTo(record.columnValue(columnName));
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <title>KD at S.E.A.</title>
    <meta name="description" content="">

    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Merriweather:300,300italic,400,400italic,700italic,700">
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:300,400,700">
    <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Source+Code+Pro:300,400,700">
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

    <link rel="stylesheet" href="/assets/css/vendors/slidebars.min.css">
    <link rel="stylesheet" href="/assets/css/vendors/rrssb.css">
    <link rel="stylesheet" href="/assets/css/main.css">

    <link rel="icon" type="image/x-icon" href="/assets/images/favicon.ico">

    <link rel="apple-touch-icon-precomposed" href="/assets/images/apple-touch-icon.png" />
    <link rel="apple-touch-icon-precomposed" sizes="57x57" href="/assets/images/apple-touch-icon-57x57.png" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/assets/images/apple-touch-icon-72x72.png" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/assets/images/apple-touch-icon-114x114.png" />
    <link rel="apple-touch-icon-precomposed" sizes="120x120" href="/assets/images/apple-touch-icon-120x120.png" />
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/assets/images/apple-touch-icon-144x144.png" />
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="/assets/images/apple-touch-icon-152x152.png" />

    <link rel="canonical" href="http://kadie16.github.io/blogIndex/">
    <link rel="alternate" type="application/rss+xml" title="Kadie Jaffe" href="http://kadie16.github.io/feed.xml" />

    <svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px" height="32px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
        <filter id="dropshadow" height="130%">
            <feGaussianBlur in="SourceAlpha" stdDeviation="10"/>
            <feOffset dx="0" dy="0" result="offsetblur"/>
            <feMerge>
                <feMergeNode/>
                <feMergeNode in="SourceGraphic"/>
            </feMerge>
        </filter>
        <path d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.5s" repeatCount="indefinite"/>
        </path>
    </svg>

KD at S.E.A.

 A blog about my summer in South East Asia

    I spent last summer living and working in Singapore. During the week, I worked on a 3D viewer project at the A*STAR Institute of High Perfomance Computing. On the weekends, I traveled as much as I could!

   Photostream
 A couple of these posts are unfinished, but I decided to share them here anyway since it is unlikely I will get around to polishing them.

Looking Back

                    August 10, 2015

Work in Progress

                    August 1, 2015

LAOS

                    July 4, 2015

A day in the life

                    July 3, 2015

I'm working, I swear!

                    July 3, 2015

Phuket!

                    June 30, 2015

My Mother's Daughter

                    June 27, 2015

The Lion City

                    June 20, 2015

Hamilton Island

                    June 15, 2015

Down Under

                    June 10, 2015

Koh Phi Phi

                    June 7, 2015

Airports Forever

                    June 5, 2015

En Route

                    June 4, 2015

Backstory

                    June 1, 2015

    Menu

Menu

Kadie Jaffe

                    Projects

                    About Me

                    KD at S.E.A.

                By Kadie Jaffe

                 Download Resume

                 LinkedIn

                 GitHub

            Copyright © 2016

redpajama_set_name: RedPajamaGithub


text:
require 'rmodel'

DB = Sequel.connect(adapter: 'sqlite', database: 'rmodel_test.sqlite3')
source = Rmodel::Sequel::Source.new(DB, :things)

DB.drop_table? :things
DB.create_table :things do
  primary_key :id
  String :name
  Float :price
end

Thing = Struct.new(:id, :name, :price)
mapper = Rmodel::Sequel::Mapper.new(Thing)
                               .define_attributes(:name, :price)

class ThingRepository < Rmodel::Repository
  scope :worth_more_than do |amount|
    # use Sequel dataset filtering http://sequel.jeremyevans.net/rdoc/files/doc/dataset_filtering_rdoc.html
    where { price >= amount }
  end
end

repo = ThingRepository.new(source, mapper)
repo.insert Thing.new(nil, 'iPod', 200)
repo.insert Thing.new(nil, 'iPhone', 300)
repo.insert Thing.new(nil, 'iPad', 500)

p repo.fetch.count # 3
p repo.fetch.worth_more_than(400).count # 1


text:
#pragma once

namespace AnimatSim
{
        /**
         \brief Animatlab PID control system. This implements the CStdPid with extra AnimatBase functionality.

         \author    David Cofer
         \date  1/25/2014
         */
		class ANIMAT_PORT PidControl : public CStdPID, public AnimatBase
		{
		protected:
		    /// Keeps track of the enabled state at sim startup.
		    bool m_bInitEnabled;

            //Used for reporting of enabled state of this controller
            float m_fltEnabled;

		public:
			PidControl();
            PidControl(float fltSetpoint, float fltGain, float fltIntegralAct, float fltDerivativeAct,
                bool bComplexError, bool bAntiResetWindup, bool bRampLimit,
                float fltRangeMax, float fltRangeMin, float fltARWBound, float fltRampGradient);
			virtual ~PidControl();

			static PidControl *CastToDerived(AnimatBase *lpBase) {return static_cast<PidControl*>(lpBase);}

		    virtual bool Enabled();
		    virtual void Enabled(bool bValue);

			virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
			virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
			virtual float *GetDataPointer(const std::string &strDataType);
			virtual void ResetSimulation();
			virtual void Load(CStdXml &oXml);
		};

}				//AnimatSim


text:
            {{ app.title}}

          <button ng-click="savePreviewData()" class="btn btn-default pull-right" type="button"> Save Data in Browser</button>
          <button ng-click="removePreviewData()" class="btn btn-default btn-danger pull-right" type="button"></button>

                {{ model.title }}


text:
FAQ
====

- Does RedPen check LaTeX documents for common style errors?

 **No**. RedPen itself does not support LaTex format, but you can get RedPen to proofread LaTex documents by first converting them to
 Markdown format. `Pandoc <http://johnmacfarlane.net/pandoc>`_ supports the conversion from LaTex to Markdown format. The following will convert a LaTex document
  to Markdown format, and then run redpen over the converted document.

.. code-block:: bash

     $ pandoc content.tex -s -t  markdown_mmd -o content.md
     $ redpen -c conf/redpen-conf.xml content.md


text:
<!doctype html>

  <meta charset="utf-8">
  <title>AMP #0</title>
  <link rel="canonical" href="amps.html" >
  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
  <link href='https://fonts.googleapis.com/css?family=Questrial' rel='stylesheet' type='text/css'>

AMP #0

  <amp-accordion>

Section 1

        Google

Section 2

        Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus

Section 3

        <amp-img id="img1" srcset="https://lh4.googleusercontent.com/kDqWeHQ0Zt-UFeHAlc2ydE9AwK7W-kbMXBqyuNvPNy0mNSGAP7FOVB3_1iAOdbQSsbZByErbehvvSKtnTb1L5GoYreijfKwgYwpP1eLCHyl9Am7BSpwRuBABOAO12PtyPBTirdAadnxOmfq9dH_rsLSTaYGmNz1D5QIwXeWd8UeDNUQ3f-cMgvkq4ePqmKoe9t5ySqqLMZs-v3wTi2pd4jV_CurzcMB76k_b4lyD5w77NUowkSaQfscYVQpkDjo6OgG2nBiKJ2TITWVDu2rvt6NuEoOD9xaHgXuv81OnOjXCokxZd5K6TZiAH-Qm1jTKGMANklXiXt6hbwrN3QPA1mq2FardxGNLj1_oqOpXaqfUuj8LvejFRY6zJMGq0r6S_TEtPvbyulIg4PkKPIaVzi5nVdGrAWWoesWh-ORqmxZ4FIhdbd_Igsdh5AcMETBcZz3l5-IX0hmnyUeT5IOPSGw-p3Esgp_abwWB9-kElEiiHPD4QuQ_swsRu0NSFwfRi_QefnJQJ5UATng6iVP3K0g7uumHcwLtFId0vCeHp4A=w1024-h768-no" width=512 height=344></amp-img>

  </amp-accordion>
  <amp-accordion>

1) Click me first... two time - 2) Click me now ... two time

Bunch of awesome content

  </amp-accordion>


text:
<?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>

<meta charset="<?php bloginfo( 'charset' ); ?>" />
<?php if(get_option('header_favicon')) { ?>
<link rel="shortcut icon" href="<?php echo get_option('header_favicon'); ?>" />
<?php } ?>
<title><?php if(is_front_page()) { bloginfo('name'); } else { wp_title( '', true, 'right' ); }?></title>

<?php
/***************************************************************/
/*	Call Custom Page Variables							   	   */
/***************************************************************/

if (have_posts()) : while (have_posts()) : the_post();
    $data = maybe_unserialize(get_post_meta( $post->ID, 'pgopts', true )); // Call custom page attributes
endwhile; endif;

$show_slider = $data["gallery"];
$gallerycat=$data["gallerycat"];

require CWZ_FILES ."/inc/page-constants.php"; // Page Constants

/***************************************************************/
/*	Call Custom Page Variables *END*					   	   */
/***************************************************************/?>

<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php wp_head();

if(!$DYN_outskin) {if(DYN_OUTSKIN) {$DYN_outskin=DYN_OUTSKIN;} else {$DYN_outskin=$_SESSION['DYN_outskin'];}}
if(!$DYN_inskin) {if(DYN_INSKIN) {$DYN_inskin=DYN_INSKIN;} else {$DYN_inskin=$_SESSION['DYN_inskin'];}}

if($DYN_outskin=="two") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/darkblue.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="three") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/blue.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="four" ) { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/teal.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="five" ) { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/green.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="six") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/mustard.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="seven") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/orange.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="eight") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/red.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="nine") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/pink.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="ten") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/grey.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="eleven") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/urban.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="twelve") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/carbon.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="thirteen") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/wood.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="fourteen") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/grunge.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="fithteen") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/bokeh.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="sixteen") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/teal-dark.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="seventeen") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/green-dark.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="eighteen") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/pink-dark.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="nineteen") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/red-dark.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="twenty") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/brown-dark.css" type="text/css" media="screen" />
<?php } elseif($DYN_outskin=="custom") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/custom.css" type="text/css" media="screen" />
<?php }

// BUDDYPRESS

if(DYN_INSKIN!="one" && $DYN_inskin!="one") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/dark-content.css" type="text/css" media="screen" />
<?php wp_enqueue_style( 'buddypressdark', MY_THEME_URL . '/stylesheets/style-buddypress-dark.css', false, '0.1', 'screen' ); ?>
<?php } elseif($DYN_inskin=="two") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/dark-content.css" type="text/css" media="screen" />
<?php wp_enqueue_style( 'buddypressdark', MY_THEME_URL . '/stylesheets/style-buddypress-dark.css', false, '0.1', 'screen' ); ?>
<?php }

//**  IE / Opera Only Functions
$a_browser_data = browser_detection('full');
if ( $a_browser_data[0] == 'ie' || $a_browser_data[0] == 'op') {
if($a_browser_data[0] == 'op' && $a_browser_data[1]<"9.8" || $a_browser_data[0] == 'ie' && $a_browser_data[1]<"9" )   { // Opera 10.5 introduced CSS3
?>

<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/opera-ie-only.css" type="text/css" media="screen" />
<?php if(DYN_INSKIN!="one" && $DYN_inskin!="one") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/opera-ie-only-dark.css" type="text/css" media="screen" />
<?php } elseif($DYN_inskin=="two") { ?>
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/stylesheets/opera-ie-only-dark.css" type="text/css" media="screen" />
<?php } ?>
<?php } ?>
<?php } ?>

<?php if(get_option("cufon_font")) { // If a user defined font exists use it. ?>

<?php } else { ?>

<?php } ?>

<?php require CWZ_FILES ."/inc/cufon-replace.php"; // Cufon Font Replacement Script ?>

<?php if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPad')) { $i_device=true; } // detect iPhone / iPad ?>

<body <?php body_class(); ?>>

<?php if(get_option('droppanel')!="none") { // Check if drop panel is enabled ?>

<?php if(get_option('droppanel')!="disable") { // Check if drop panel is enabled ?>

	<div id="panel" style="<?php if(isset($_POST['TopFirstsubmitted']) || isset($_POST['TopSecondsubmitted']) || isset($_POST['TopThirdsubmitted']) || isset($_POST['TopFourthsubmitted'])) { ?>display:block;<?php if(isset($hasError) || isset($captchaError)) { ?>min-height:300px <?php } ?> <?php } ?>">

				<?php if(get_option('ftdrpwidget_enable')=="enable") { // Check to see if Droppanel / Footer widgets are enabled ?>

				<?php
				$get_droppanel_num 	=	(get_option('droppanel_columns_num')!="") 	? get_option('droppanel_columns_num') 	: '4'; // If not set, default to 4 columns

				$i=1;
				while($i<=$get_droppanel_num)
				{ ?>

				<div class="panel-wrap panel-columns-<?php echo $get_droppanel_num; ?> <?php if($i == $get_droppanel_num) { echo "last"; } ?>">

                            <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Drop Panel Column '.$i)) : endif; ?>

				<?php $i++;	} ?>

				<?php } else { ?>

					<?php

                    $thiscol="TopFirst";

						if(get_option($thiscol.'select')==$thiscol."-1" || get_option($thiscol.'select')=="") {  // ********* Default Option ?>
							<?php custom_html(get_option($thiscol.'htmltitle'),do_shortcode(get_option($thiscol.'content'))); ?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-2") { ?>
							<?php	contact_form($thiscol.'',get_option($thiscol.'contacttitle'),get_option($thiscol.'contactdesc'),get_option($thiscol.'contactemail'),get_option($thiscol.'contactmsg'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-3") { ?>
							<?php	pages_list(get_option($thiscol.'pagestitle'),get_option($thiscol.'pagesexc')); ?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-4") { ?>
							<?php	recent_posts(get_option($thiscol.'recenttitle'),get_option($thiscol.'recentcat'),get_option($thiscol.'recentnum'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-5") { ?>
							<?	categories(get_option($thiscol.'cattitle'),get_option($thiscol.'cat'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-6") { ?>
							<?	meta_information(get_option($thiscol.'metatitle'),get_option($thiscol.'meta1'),get_option($thiscol.'meta2'),get_option($thiscol.'meta3'),get_option($thiscol.'meta4'),get_option($thiscol.'meta5')); ?>
						<?php } ?>

					<?php

                    $thiscol="TopSecond";

						if(get_option($thiscol.'select')==$thiscol."-1") { ?>
							<?php custom_html(get_option($thiscol.'htmltitle'),do_shortcode(get_option($thiscol.'content'))); ?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-2") { ?>
							<?php	contact_form($thiscol.'',get_option($thiscol.'contacttitle'),get_option($thiscol.'contactdesc'),get_option($thiscol.'contactemail'),get_option($thiscol.'contactmsg'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-3") { ?>
							<?php	pages_list(get_option($thiscol.'pagestitle'),get_option($thiscol.'pagesexc')); ?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-4") { ?>
							<?	recent_posts(get_option($thiscol.'recenttitle'),get_option($thiscol.'recentcat'),get_option($thiscol.'recentnum'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-5") { ?>
							<?php	categories(get_option($thiscol.'cattitle'),get_option($thiscol.'cat'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-6") { ?>
							<?	meta_information(get_option($thiscol.'metatitle'),get_option($thiscol.'meta1'),get_option($thiscol.'meta2'),get_option($thiscol.'meta3'),get_option($thiscol.'meta4'),get_option($thiscol.'meta5')); ?>
						<?php } ?>

					<?php

                    $thiscol="TopThird";

						if(get_option($thiscol.'select')==$thiscol."-1") { ?>
							<?php custom_html(get_option($thiscol.'htmltitle'),do_shortcode(get_option($thiscol.'content'))); ?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-2") { ?>
							<?php	contact_form($thiscol.'',get_option($thiscol.'contacttitle'),get_option($thiscol.'contactdesc'),get_option($thiscol.'contactemail'),get_option($thiscol.'contactmsg'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-3") { ?>
							<?php	pages_list(get_option($thiscol.'pagestitle'),get_option($thiscol.'pagesexc')); ?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-4") { ?>
							<?	recent_posts(get_option($thiscol.'recenttitle'),get_option($thiscol.'recentcat'),get_option($thiscol.'recentnum'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-5" || get_option($thiscol.'select')=="") {  // ********* Default Option ?>
							<?	categories(get_option($thiscol.'cattitle'),get_option($thiscol.'cat')); ?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-6") { ?>
							<?	meta_information(get_option($thiscol.'metatitle'),get_option($thiscol.'meta1'),get_option($thiscol.'meta2'),get_option($thiscol.'meta3'),get_option($thiscol.'meta4'),get_option($thiscol.'meta5')); ?>
						<?php } ?>

					<?php

                    $thiscol="TopFourth";

						if(get_option($thiscol.'select')==$thiscol."-1") { ?>
							<?php custom_html(get_option($thiscol.'htmltitle'),do_shortcode(get_option($thiscol.'content'))); ?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-2") { ?>
							<?	contact_form($thiscol.'',get_option($thiscol.'contacttitle'),get_option($thiscol.'contactdesc'),get_option($thiscol.'contactemail'),get_option($thiscol.'contactmsg'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-3") { ?>
							<?	pages_list(get_option($thiscol.'pagestitle'),get_option($thiscol.'pagesexc')); ?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-4") { ?>
							<?php	recent_posts(get_option($thiscol.'recenttitle'),get_option($thiscol.'recentcat'),get_option($thiscol.'recentnum'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-5") { ?>
							<?	categories(get_option($thiscol.'cattitle'),get_option($thiscol.'cat'));	?>
						<?php } elseif(get_option($thiscol.'select')==$thiscol."-6") { ?>
							<?	meta_information(get_option($thiscol.'metatitle'),get_option($thiscol.'meta1'),get_option($thiscol.'meta2'),get_option($thiscol.'meta3'),get_option($thiscol.'meta4'),get_option($thiscol.'meta5')); ?>
						<?php } ?>

				<?php } ?>

<?php } ?>

			<li id="toggle" <?php if(get_option('droppanel')!="disable") { ?>style="width:227px;"<?php } ?>>

					<form method="get" id="panelsearchform" action="<?php bloginfo('url'); ?>">
						<fieldset>
                        <input type="text" value="<?php _e('Search', 'DynamiX' ); ?>" name="s" id="drops" onFocus="if(this.value == '<?php _e('Search', 'DynamiX' ); ?>') {this.value = '';}" onBlur="if (this.value == '') {this.value = '<?php _e('Search', 'DynamiX' ); ?>';}" />
						<input type="submit" id="panelsearchsubmit" value=" " />
        				</fieldset>
                    </form>

                <?php if(get_option('droppanel')!="disable") { ?>

					<?php if(isset($_POST['TopFirstsubmitted']) || isset($_POST['TopSecondsubmitted']) || isset($_POST['TopThirdsubmitted']) || isset($_POST['TopFourthsubmitted'])) { ?>
                    <img src="<?php bloginfo('template_url'); ?>/images/blank.gif" width="15" height="10" alt="open panel" />
                    <img src="<?php bloginfo('template_url'); ?>/images/blank.gif" width="15" height="10" alt="close panel" />
                    <?php } else { ?>
                    <img src="<?php bloginfo('template_url'); ?>/images/blank.gif" width="15" height="10" alt="open panel" />
                    <img src="<?php bloginfo('template_url'); ?>/images/blank.gif" width="15" height="10" alt="close panel" />
                    <?php } ?>

                <?php } ?>

<?php } ?>
<div id="wrapper" class="<?php if($show_slider=="stageslider" && is_page() || $show_slider=="gallery3d" && is_page() || $show_slider=="galleryaccordion" && is_page()) { ?>gallery <?php } ?>">
	<div id="page" class="<?php if($show_slider=="stageslider" && is_page() || $show_slider=="gallery3d" && is_page() || $show_slider=="galleryaccordion" && is_page()) { ?>gallery <?php } else { ?>pages <?php } ?>">
		<div id="header" class="<?php if($show_slider=="stageslider" && is_page() || $show_slider=="galleryaccordion" && is_page() || $show_slider=="gallery3d" && $i_device==true) { ?>gallery <?php } elseif($show_slider=="gallery3d" && is_page() && $i_device!=true) {?>gallery3d <?php } else { ?>pages <?php } ?>">
        	<?php if(get_option('header_html')) { echo do_shortcode(get_option('header_html')); } ?>

<?php if(get_option("branding_url")) { // Is Branding Image Set ?>
					<a href="<?php echo get_option('home'); ?>/"><img src="<?php echo get_option("branding_url"); ?>" alt="<?php bloginfo('name'); ?>" />
<?php } else { ?>

<?php bloginfo('description'); ?>

<a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?>

<?php } ?>

				<?php if(get_option('wpcustomm_enable')=="enable") { // WP3.0 Custom Menu Support

                $walker = new dyn_walker;
                wp_nav_menu(array('echo' => true,'container' => 'ul','menu_id' => 'dyndropmenu','theme_location' => 'mainnav','walker' => $walker	));?>
                <?php } else { ?>

                <?php echo DYN_menupages(); ?>

				<?php if(get_option('droppanel')!="disable") { ?>
                <?php if(get_option('droptriggername')) { ?>

<a href="#" class="droppaneltrigger" title="<?php echo get_option('droptriggername'); ?>"><?php echo get_option('droptriggername'); ?><?php echo get_option('droptriggerdesc'); ?>

                <?php } ?>
                <?php } ?>

				<?php } ?>

<?php

/***************************************************************/
/*	Stage Gallery        									   */
/***************************************************************/

if(is_page()) {
	if($DYN_show_slider=="stageslider") {

		require CWZ_FILES ."/inc/gallery-stage.php"; // Group Slider Gallery

	}
}
/***************************************************************/
/*	Stage Gallery *END*   									   */
/***************************************************************/

/***************************************************************/
/*	Piecemaker Gallery 		   								   */
/***************************************************************/

if($i_device && $DYN_show_slider=="gallery3d") { // if iPad or iPhone
	if(is_page()) {
		require CWZ_FILES ."/inc/gallery-stage.php"; // Group Slider Gallery
	}

} else {

	if(is_page()) {

		if($DYN_show_slider=="gallery3d") { ?>
			<?php require CWZ_FILES .'/inc/gallery-piecemaker.php'; //
		}
	}

}

/***************************************************************/
/*	Piecemaker Gallery *END*   								   */
/***************************************************************/

/***************************************************************/
/*	Accordion Gallery 		   								   */
/***************************************************************/

if(is_page()) {
	if($DYN_show_slider=="galleryaccordion") { ?>
		<?php require CWZ_FILES .'/inc/gallery-accordion.php';
	}
}

/***************************************************************/
/*	Accordion Gallery *END*   								   */
/***************************************************************/

/***************************************************************/
/*	Breadcrumbs			  									   */
/***************************************************************/

if(is_archive()) {
		if(get_option("archbreadcrumb")=="disable") {
		$DYN_hidebreadcrumbs="yes";
	}	else {
		$DYN_hidebreadcrumbs="";
	}
}

if (class_exists( 'BP_Core_User' ) ) {
if(!bp_is_blog_page()) {
	$DYN_hidebreadcrumbs="yes";
}
}

if(!$DYN_hidebreadcrumbs) {
?>

<?php if (function_exists('DYN_breadcrumbs')) DYN_breadcrumbs(); ?>

<?php

}

/***************************************************************/
/*	Breadcrumbs *END*	  									   */
/***************************************************************/
?>

	<div class="inner-page <?php if($DYN_show_slider=='stageslider' || $DYN_show_slider=='gallery3d') { ?>gallery<?php } ?>">
<?php

/***************************************************************/
/*	Grid Gallery										   	   */
/***************************************************************/

if(is_page()) {
if($DYN_show_slider=="gridgallery" && $DYN_groupsliderpos!="below") { ?>

	<?php require CWZ_FILES ."/inc/gallery-grid.php"; // Group Slider Gallery ?>

<?php }
}

/***************************************************************/
/*	Grid Gallery *END*										   */
/***************************************************************/

/***************************************************************/
/*	Group Slider Gallery									   */
/***************************************************************/

if(is_page()) {
if($DYN_show_slider=="groupslider" && $DYN_groupsliderpos!="below") { ?>

	<?php require CWZ_FILES ."/inc/gallery-groupslider.php"; // Group Slider Gallery ?>

<?php }
}

/***************************************************************/
/*	Group Slider Gallery *END*   							   */
/***************************************************************/

/***************************************************************/
/*	Call Twiiter         									   */
/***************************************************************/

if($DYN_twitter=="pagetop") { ?>

	<?php require CWZ_FILES .'/inc/twitter.php'; // Call Twitter Template ?>

<?php }

/***************************************************************/
/*	Call Twiiter *END*    									   */
/***************************************************************/

?>

<?php if($DYN_hidecontent!="yes") { ?>
<?php
if(is_archive()) {
		if(get_option("archcontentborder")=="disable") {
		$DYN_contentborder="yes";
	} else {
		$DYN_contentborder="no";
	}
}

if (class_exists( 'BP_Core_User' ) ) {
if(!bp_is_blog_page()) {
		if(get_option("buddycontentborder")=="disable") {
		$DYN_contentborder="yes";
	} else {
		$DYN_contentborder="no";
	}
}
}
?>
<div <?php if($DYN_contentborder!="yes") { ?>class="content-wrapper"<?php } ?>>

<?php } ?>


text: FROM python:3.6-onbuild


text:
/*global module,__dirname,__filename */
module.exports = function( grunt ) {
   'use strict';

   var serverPort = 8002;
   var testPort = 1000 + serverPort;
   var liveReloadPort = 30000 + serverPort;

   grunt.initConfig( {
      pkg: grunt.file.readJSON( 'package.json' ),
      cfg: grunt.file.readJSON( 'config.json' ),

      'laxar-configure': {
         options: {
            flows: [
               { target: 'main', src: 'application/flow/flow.json' }
            ],
            ports: {
               develop: serverPort,
               test: testPort,
               livereload: liveReloadPort
            },
            userTasks: {
               'build-flow': [ 'laxar-sass' ]
            }
         }
      },
      connect: {
         'laxar-develop': {
            options: {
               middleware: function( connect, options, middlewares ) {
                  var relay = require('ci-relay');
                  var config = grunt.config.get('cfg');

                  return [ relay.config(config) ].concat( middlewares );
               }
            }
         }
      },
      sass: {
         options: {
            sourceMap: true
         },
         main: {
            files: [ {
               expand: true,
               src: [
                  'includes/themes/*.theme/scss/*.scss',
                  'includes/widgets/**/*.theme/scss/*.scss'
               ],
               rename: function (dest, src) {
                  return src.replace(/\/scss\/(.*)\.scss$/, '/css/$1.css');
               }
            } ]
         }
      },
      autoprefixer: {
         options: {
            map: {
               inline: false
            }
         },
         main: {
            files: [ {
               expand: true,
               src: [
                  'includes/themes/*.theme/css/*.css',
                  'includes/widgets/**/*.theme/css/*.css'
               ],
               rename: function (dest, src) {
                  return src;
               }
            } ]
         }
      },
      watch: {
         sass: {
            files: [
               'includes/themes/*.theme/scss/*.scss',
               'includes/widgets/**/*.theme/scss/*.scss'
            ],
            tasks: [ 'sass', 'autoprefixer' ],
            options: {
               livereload: false
            }
         }
      }
   } );

   ///////////////////////////////////////////////////////////////////////////////////////////////////////////

   /**
    * Unfortunately, grunt-laxar hijacks the files setting, effectively overriding anything configured
    * with grunt.initConfig(), so we can't call sass directly. Instead, we hook up this intermediate step
    * that does nothing except calling sass with the users configuration.
    */
   grunt.registerMultiTask( 'laxar-sass', 'Because grunt-laxar is annoying', function () {
      this.files;
      grunt.task.run( 'sass:' + this.target );
      grunt.task.run( 'autoprefixer:' + this.target );
   } );

   ///////////////////////////////////////////////////////////////////////////////////////////////////////////

   grunt.loadNpmTasks( 'grunt-laxar' );
   grunt.loadNpmTasks( 'grunt-sass' );
   grunt.loadNpmTasks( 'grunt-autoprefixer' );

   // basic aliases
   grunt.registerTask( 'test', [ 'laxar-test' ] );
   grunt.registerTask( 'build', [ 'laxar-build' ] );
   grunt.registerTask( 'dist', [ 'laxar-dist' ] );
   grunt.registerTask( 'develop', [ 'laxar-develop' ] );
   grunt.registerTask( 'info', [ 'laxar-info' ] );

   // additional (possibly) more intuitive aliases
   grunt.registerTask( 'optimize', [ 'laxar-dist' ] );
   grunt.registerTask( 'start', [ 'laxar-develop' ] );
   grunt.registerTask( 'start-no-watch', [ 'laxar-develop-no-watch' ] );

   grunt.registerTask( 'default', [ 'build', 'test' ] );
};


text:
package ca

import (
	cryptorand "crypto/rand"
	"crypto/tls"
	"crypto/x509"
	"encoding/pem"
	"errors"
	"fmt"
	"io/ioutil"
	"math/big"
	"math/rand"
	"path/filepath"
	"strings"
	"sync"
	"time"

	log "github.com/Sirupsen/logrus"
	cfconfig "github.com/cloudflare/cfssl/config"
	"github.com/docker/distribution/digest"
	"github.com/docker/swarmkit/api"
	"github.com/docker/swarmkit/identity"
	"github.com/docker/swarmkit/picker"

	"golang.org/x/net/context"
)

const (
	rootCACertFilename  = "swarm-root-ca.crt"
	rootCAKeyFilename   = "swarm-root-ca.key"
	nodeTLSCertFilename = "swarm-node.crt"
	nodeTLSKeyFilename  = "swarm-node.key"
	nodeCSRFilename     = "swarm-node.csr"

	rootCN = "swarm-ca"
	// ManagerRole represents the Manager node type, and is used for authorization to endpoints
	ManagerRole = "swarm-manager"
	// AgentRole represents the Agent node type, and is used for authorization to endpoints
	AgentRole = "swarm-worker"
	// CARole represents the CA node type, and is used for clients attempting to get new certificates issued
	CARole = "swarm-ca"

	generatedSecretEntropyBytes = 16
	joinTokenBase               = 36
	// ceil(log(2^128-1, 36))
	maxGeneratedSecretLength = 25
	// ceil(log(2^256-1, 36))
	base36DigestLen = 50
)

// SecurityConfig is used to represent a node's security configuration. It includes information about
// the RootCA and ServerTLSCreds/ClientTLSCreds transport authenticators to be used for MTLS
type SecurityConfig struct {
	mu sync.Mutex

	rootCA     *RootCA
	externalCA *ExternalCA

	ServerTLSCreds *MutableTLSCreds
	ClientTLSCreds *MutableTLSCreds
}

// CertificateUpdate represents a change in the underlying TLS configuration being returned by
// a certificate renewal event.
type CertificateUpdate struct {
	Role string
	Err  error
}

// NewSecurityConfig initializes and returns a new SecurityConfig.
func NewSecurityConfig(rootCA *RootCA, clientTLSCreds, serverTLSCreds *MutableTLSCreds) *SecurityConfig {
	// Make a new TLS config for the external CA client without a
	// ServerName value set.
	clientTLSConfig := clientTLSCreds.Config()

	externalCATLSConfig := &tls.Config{
		Certificates: clientTLSConfig.Certificates,
		RootCAs:      clientTLSConfig.RootCAs,
		MinVersion:   tls.VersionTLS12,
	}

	return &SecurityConfig{
		rootCA:         rootCA,
		externalCA:     NewExternalCA(rootCA, externalCATLSConfig),
		ClientTLSCreds: clientTLSCreds,
		ServerTLSCreds: serverTLSCreds,
	}
}

// RootCA returns the root CA.
func (s *SecurityConfig) RootCA() *RootCA {
	s.mu.Lock()
	defer s.mu.Unlock()

	return s.rootCA
}

// UpdateRootCA replaces the root CA with a new root CA based on the specified
// certificate, key, and the number of hours the certificates issue should last.
func (s *SecurityConfig) UpdateRootCA(cert, key []byte, certExpiry time.Duration) error {
	s.mu.Lock()
	defer s.mu.Unlock()

	rootCA, err := NewRootCA(cert, key, certExpiry)
	if err == nil {
		s.rootCA = &rootCA
	}

	return err
}

// SigningPolicy creates a policy used by the signer to ensure that the only fields
// from the remote CSRs we trust are: PublicKey, PublicKeyAlgorithm and SignatureAlgorithm.
// It receives the duration a certificate will be valid for
func SigningPolicy(certExpiry time.Duration) *cfconfig.Signing {
	// Force the minimum Certificate expiration to be fifteen minutes
	if certExpiry < MinNodeCertExpiration {
		certExpiry = DefaultNodeCertExpiration
	}

	// Add the backdate
	certExpiry = certExpiry + CertBackdate

	return &cfconfig.Signing{
		Default: &cfconfig.SigningProfile{
			Usage:    []string{"signing", "key encipherment", "server auth", "client auth"},
			Expiry:   certExpiry,
			Backdate: CertBackdate,
			// Only trust the key components from the CSR. Everything else should
			// come directly from API call params.
			CSRWhitelist: &cfconfig.CSRWhitelist{
				PublicKey:          true,
				PublicKeyAlgorithm: true,
				SignatureAlgorithm: true,
			},
		},
	}
}

// SecurityConfigPaths is used as a helper to hold all the paths of security relevant files
type SecurityConfigPaths struct {
	Node, RootCA CertPaths
}

// NewConfigPaths returns the absolute paths to all of the different types of files
func NewConfigPaths(baseCertDir string) *SecurityConfigPaths {
	return &SecurityConfigPaths{
		Node: CertPaths{
			Cert: filepath.Join(baseCertDir, nodeTLSCertFilename),
			Key:  filepath.Join(baseCertDir, nodeTLSKeyFilename)},
		RootCA: CertPaths{
			Cert: filepath.Join(baseCertDir, rootCACertFilename),
			Key:  filepath.Join(baseCertDir, rootCAKeyFilename)},
	}
}

// GenerateJoinToken creates a new join token.
func GenerateJoinToken(rootCA *RootCA) string {
	var secretBytes [generatedSecretEntropyBytes]byte

	if _, err := cryptorand.Read(secretBytes[:]); err != nil {
		panic(fmt.Errorf("failed to read random bytes: %v", err))
	}

	var nn, digest big.Int
	nn.SetBytes(secretBytes[:])
	digest.SetString(rootCA.Digest.Hex(), 16)
	return fmt.Sprintf("SWMTKN-1-%0[1]*s-%0[3]*s", base36DigestLen, digest.Text(joinTokenBase), maxGeneratedSecretLength, nn.Text(joinTokenBase))
}

func getCAHashFromToken(token string) (digest.Digest, error) {
	split := strings.Split(token, "-")
	if len(split) != 4 || split[0] != "SWMTKN" || split[1] != "1" {
		return "", errors.New("invalid join token")
	}

	var digestInt big.Int
	digestInt.SetString(split[2], joinTokenBase)

	return digest.ParseDigest(fmt.Sprintf("sha256:%0[1]*s", 64, digestInt.Text(16)))
}

// LoadOrCreateSecurityConfig encapsulates the security logic behind joining a cluster.
// Every node requires at least a set of TLS certificates with which to join the cluster with.
// In the case of a manager, these certificates will be used both for client and server credentials.
func LoadOrCreateSecurityConfig(ctx context.Context, baseCertDir, token, proposedRole string, picker *picker.Picker, nodeInfo chan<- api.IssueNodeCertificateResponse) (*SecurityConfig, error) {
	paths := NewConfigPaths(baseCertDir)

	var (
		rootCA                         RootCA
		serverTLSCreds, clientTLSCreds *MutableTLSCreds
		err                            error
	)

	// Check if we already have a CA certificate on disk. We need a CA to have a valid SecurityConfig
	rootCA, err = GetLocalRootCA(baseCertDir)
	switch err {
	case nil:
		log.Debugf("loaded local CA certificate: %s.", paths.RootCA.Cert)
	case ErrNoLocalRootCA:
		log.Debugf("no valid local CA certificate found: %v", err)

		// Get a digest for the optional CA hash string that we've been provided
		// If we were provided a non-empty string, and it is an invalid hash, return
		// otherwise, allow the invalid digest through.
		var d digest.Digest
		if token != "" {
			d, err = getCAHashFromToken(token)
			if err != nil {
				return nil, err
			}
		}

		// Get the remote CA certificate, verify integrity with the
		// hash provided. Retry up to 5 times, in case the manager we
		// first try to contact is not responding properly (it may have
		// just been demoted, for example).

		for i := 0; i != 5; i++ {
			rootCA, err = GetRemoteCA(ctx, d, picker)
			if err == nil {
				break
			}
			log.Warningf("failed to retrieve remote root CA certificate: %v", err)
		}
		if err != nil {
			return nil, err
		}

		// Save root CA certificate to disk
		if err = saveRootCA(rootCA, paths.RootCA); err != nil {
			return nil, err
		}

		log.Debugf("downloaded remote CA certificate.")
	default:
		return nil, err
	}

	// At this point we've successfully loaded the CA details from disk, or
	// successfully downloaded them remotely. The next step is to try to
	// load our certificates.
	clientTLSCreds, serverTLSCreds, err = LoadTLSCreds(rootCA, paths.Node)
	if err != nil {
		log.Debugf("no valid local TLS credentials found: %v", err)

		var (
			tlsKeyPair *tls.Certificate
			err        error
		)

		if rootCA.CanSign() {
			// Create a new random ID for this certificate
			cn := identity.NewID()
			org := identity.NewID()

			if nodeInfo != nil {
				nodeInfo <- api.IssueNodeCertificateResponse{
					NodeID:         cn,
					NodeMembership: api.NodeMembershipAccepted,
				}
			}
			tlsKeyPair, err = rootCA.IssueAndSaveNewCertificates(paths.Node, cn, proposedRole, org)
			if err != nil {
				return nil, err
			}
		} else {
			// There was an error loading our Credentials, let's get a new certificate issued
			// Last argument is nil because at this point we don't have any valid TLS creds
			tlsKeyPair, err = rootCA.RequestAndSaveNewCertificates(ctx, paths.Node, token, picker, nil, nodeInfo)
			if err != nil {
				return nil, err
			}
		}
		// Create the Server TLS Credentials for this node. These will not be used by agents.
		serverTLSCreds, err = rootCA.NewServerTLSCredentials(tlsKeyPair)
		if err != nil {
			return nil, err
		}

		// Create a TLSConfig to be used when this node connects as a client to another remote node.
		// We're using ManagerRole as remote serverName for TLS host verification
		clientTLSCreds, err = rootCA.NewClientTLSCredentials(tlsKeyPair, ManagerRole)
		if err != nil {
			return nil, err
		}
		log.Debugf("new TLS credentials generated: %s.", paths.Node.Cert)
	} else {
		if nodeInfo != nil {
			nodeInfo <- api.IssueNodeCertificateResponse{
				NodeID:         clientTLSCreds.NodeID(),
				NodeMembership: api.NodeMembershipAccepted,
			}
		}
		log.Debugf("loaded local TLS credentials: %s.", paths.Node.Cert)
	}

	return NewSecurityConfig(&rootCA, clientTLSCreds, serverTLSCreds), nil
}

// RenewTLSConfig will continuously monitor for the necessity of renewing the local certificates, either by
// issuing them locally if key-material is available, or requesting them from a remote CA.
func RenewTLSConfig(ctx context.Context, s *SecurityConfig, baseCertDir string, picker *picker.Picker, renew <-chan struct{}) <-chan CertificateUpdate {
	paths := NewConfigPaths(baseCertDir)
	updates := make(chan CertificateUpdate)

	go func() {
		var retry time.Duration
		defer close(updates)
		for {
			// Our starting default will be 5 minutes
			retry = 5 * time.Minute

			// Since the expiration of the certificate is managed remotely we should update our
			// retry timer on every iteration of this loop.
			// Retrieve the time until the certificate expires.
			expiresIn, err := readCertExpiration(paths.Node)
			if err != nil {
				// We failed to read the expiration, let's stick with the starting default
				log.Errorf("failed to read the expiration of the TLS certificate in: %s", paths.Node.Cert)
				updates <- CertificateUpdate{Err: fmt.Errorf("failed to read certificate expiration")}
			} else {
				// If we have an expired certificate, we let's stick with the starting default in
				// the hope that this is a temporary clock skew.
				if expiresIn.Minutes() < 0 {
					log.Debugf("failed to create a new client TLS config: %v", err)
					updates <- CertificateUpdate{Err: fmt.Errorf("TLS Certificate is expired")}
				} else {
					// Random retry time between 50% and 80% of the total time to expiration
					retry = calculateRandomExpiry(expiresIn)
				}
			}

			select {
			case <-time.After(retry):
			case <-renew:
			case <-ctx.Done():
				return
			}
			log.Infof("Renewing TLS Certificate.")

			// Let's request new certs. Renewals don't require a token.
			rootCA := s.RootCA()
			tlsKeyPair, err := rootCA.RequestAndSaveNewCertificates(ctx,
				paths.Node,
				"",
				picker,
				s.ClientTLSCreds,
				nil)
			if err != nil {
				log.Debugf("failed to renew the TLS Certificate: %v", err)
				updates <- CertificateUpdate{Err: err}
				continue
			}

			clientTLSConfig, err := NewClientTLSConfig(tlsKeyPair, rootCA.Pool, CARole)
			if err != nil {
				log.Debugf("failed to create a new client TLS config: %v", err)
				updates <- CertificateUpdate{Err: err}
			}
			serverTLSConfig, err := NewServerTLSConfig(tlsKeyPair, rootCA.Pool)
			if err != nil {
				log.Debugf("failed to create a new server TLS config: %v", err)
				updates <- CertificateUpdate{Err: err}
			}

			err = s.ClientTLSCreds.LoadNewTLSConfig(clientTLSConfig)
			if err != nil {
				log.Debugf("failed to update the client TLS credentials: %v", err)
				updates <- CertificateUpdate{Err: err}
			}

			// Update the external CA to use the new client TLS
			// config using a copy without a serverName specified.
			s.externalCA.UpdateTLSConfig(&tls.Config{
				Certificates: clientTLSConfig.Certificates,
				RootCAs:      clientTLSConfig.RootCAs,
				MinVersion:   tls.VersionTLS12,
			})

			err = s.ServerTLSCreds.LoadNewTLSConfig(serverTLSConfig)
			if err != nil {
				log.Debugf("failed to update the server TLS credentials: %v", err)
				updates <- CertificateUpdate{Err: err}
			}

			updates <- CertificateUpdate{Role: s.ClientTLSCreds.Role()}
		}
	}()

	return updates
}

// calculateRandomExpiry returns a random duration between 50% and 80% of the original
// duration
func calculateRandomExpiry(expiresIn time.Duration) time.Duration {
	if expiresIn.Minutes() <= 1 {
		return time.Second
	}

	var randomExpiry int
	// Our lower bound of renewal will be half of the total expiration time
	minValidity := int(expiresIn.Minutes() * CertLowerRotationRange)
	// Our upper bound of renewal will be 80% of the total expiration time
	maxValidity := int(expiresIn.Minutes() * CertUpperRotationRange)
	// Let's select a random number of minutes between min and max, and set our retry for that
	// Using randomly selected rotation allows us to avoid certificate thundering herds.
	if maxValidity-minValidity < 1 {
		randomExpiry = minValidity
	} else {
		randomExpiry = rand.Intn(maxValidity-minValidity) + int(minValidity)
	}

	return time.Duration(randomExpiry) * time.Minute
}

// LoadTLSCreds loads tls credentials from the specified path and verifies that
// thay are valid for the RootCA.
func LoadTLSCreds(rootCA RootCA, paths CertPaths) (*MutableTLSCreds, *MutableTLSCreds, error) {
	// Read both the Cert and Key from disk
	cert, err := ioutil.ReadFile(paths.Cert)
	if err != nil {
		return nil, nil, err
	}
	key, err := ioutil.ReadFile(paths.Key)
	if err != nil {
		return nil, nil, err
	}

	// Create an x509 certificate out of the contents on disk
	certBlock, _ := pem.Decode([]byte(cert))
	if certBlock == nil {
		return nil, nil, fmt.Errorf("failed to parse certificate PEM")
	}

	// Create an X509Cert so we can .Verify()
	X509Cert, err := x509.ParseCertificate(certBlock.Bytes)
	if err != nil {
		return nil, nil, err
	}

	// Include our root pool
	opts := x509.VerifyOptions{
		Roots: rootCA.Pool,
	}

	// Check to see if this certificate was signed by our CA, and isn't expired
	if _, err := X509Cert.Verify(opts); err != nil {
		return nil, nil, err
	}

	// Now that we know this certificate is valid, create a TLS Certificate for our
	// credentials
	var (
		keyPair tls.Certificate
		newErr  error
	)
	keyPair, err = tls.X509KeyPair(cert, key)
	if err != nil {
		// This current keypair isn't valid. It's possible we crashed before we
		// overwrote the current key. Let's try loading it from disk.
		tempPaths := genTempPaths(paths)
		key, newErr = ioutil.ReadFile(tempPaths.Key)
		if newErr != nil {
			return nil, nil, err
		}

		keyPair, newErr = tls.X509KeyPair(cert, key)
		if newErr != nil {
			return nil, nil, err
		}
	}

	// Load the Certificates as server credentials
	serverTLSCreds, err := rootCA.NewServerTLSCredentials(&keyPair)
	if err != nil {
		return nil, nil, err
	}

	// Load the Certificates also as client credentials.
	// Both Agents and Managers always connect to remote Managers,
	// so ServerName is always set to ManagerRole here.
	clientTLSCreds, err := rootCA.NewClientTLSCredentials(&keyPair, ManagerRole)
	if err != nil {
		return nil, nil, err
	}

	return clientTLSCreds, serverTLSCreds, nil
}

func genTempPaths(path CertPaths) CertPaths {
	return CertPaths{
		Key:  filepath.Join(filepath.Dir(path.Key), "."+filepath.Base(path.Key)),
		Cert: filepath.Join(filepath.Dir(path.Cert), "."+filepath.Base(path.Cert)),
	}
}

// NewServerTLSConfig returns a tls.Config configured for a TLS Server, given a tls.Certificate
// and the PEM-encoded root CA Certificate
func NewServerTLSConfig(cert *tls.Certificate, rootCAPool *x509.CertPool) (*tls.Config, error) {
	if rootCAPool == nil {
		return nil, fmt.Errorf("valid root CA pool required")
	}

	return &tls.Config{
		Certificates: []tls.Certificate{*cert},
		// Since we're using the same CA server to issue Certificates to new nodes, we can't
		// use tls.RequireAndVerifyClientCert
		ClientAuth:               tls.VerifyClientCertIfGiven,
		RootCAs:                  rootCAPool,
		ClientCAs:                rootCAPool,
		PreferServerCipherSuites: true,
		MinVersion:               tls.VersionTLS12,
	}, nil
}

// NewClientTLSConfig returns a tls.Config configured for a TLS Client, given a tls.Certificate
// the PEM-encoded root CA Certificate, and the name of the remote server the client wants to connect to.
func NewClientTLSConfig(cert *tls.Certificate, rootCAPool *x509.CertPool, serverName string) (*tls.Config, error) {
	if rootCAPool == nil {
		return nil, fmt.Errorf("valid root CA pool required")
	}

	return &tls.Config{
		ServerName:   serverName,
		Certificates: []tls.Certificate{*cert},
		RootCAs:      rootCAPool,
		MinVersion:   tls.VersionTLS12,
	}, nil
}

// NewClientTLSCredentials returns GRPC credentials for a TLS GRPC client, given a tls.Certificate
// a PEM-Encoded root CA Certificate, and the name of the remote server the client wants to connect to.
func (rca *RootCA) NewClientTLSCredentials(cert *tls.Certificate, serverName string) (*MutableTLSCreds, error) {
	tlsConfig, err := NewClientTLSConfig(cert, rca.Pool, serverName)
	if err != nil {
		return nil, err
	}

	mtls, err := NewMutableTLS(tlsConfig)

	return mtls, err
}

// NewServerTLSCredentials returns GRPC credentials for a TLS GRPC client, given a tls.Certificate
// a PEM-Encoded root CA Certificate, and the name of the remote server the client wants to connect to.
func (rca *RootCA) NewServerTLSCredentials(cert *tls.Certificate) (*MutableTLSCreds, error) {
	tlsConfig, err := NewServerTLSConfig(cert, rca.Pool)
	if err != nil {
		return nil, err
	}

	mtls, err := NewMutableTLS(tlsConfig)

	return mtls, err
}

// ParseRole parses an apiRole into an internal role string
func ParseRole(apiRole api.NodeRole) (string, error) {
	switch apiRole {
	case api.NodeRoleManager:
		return ManagerRole, nil
	case api.NodeRoleWorker:
		return AgentRole, nil
	default:
		return "", fmt.Errorf("failed to parse api role: %v", apiRole)
	}
}

// FormatRole parses an internal role string into an apiRole
func FormatRole(role string) (api.NodeRole, error) {
	switch strings.ToLower(role) {
	case strings.ToLower(ManagerRole):
		return api.NodeRoleManager, nil
	case strings.ToLower(AgentRole):
		return api.NodeRoleWorker, nil
	default:
		return 0, fmt.Errorf("failed to parse role: %s", role)
	}
}


text:
function [optN, C, N] = sshist(x,N)
% [optN, C, N] = sshist(x,N)
%
% Function `sshist' returns the optimal number of bins in a histogram
% used for density estimation.
% Optimization principle is to minimize expected L2 loss function between
% the histogram and an unknown underlying density function.
% An assumption made is merely that samples are drawn from the density
% independently each other.
%
% The optimal binwidth D* is obtained as a minimizer of the formula,
% (2K-V) / D^2,
% where K and V are mean and variance of sample counts across bins with width D.
% Optimal number of bins is given as (max(x) - min(x)) / D*.
%
% For more information, visit
% http://2000.jukuin.keio.ac.jp/shimazaki/res/histogram.html
%
% Original paper:
% Hideaki Shimazaki and Shigeru Shinomoto
% A method for selecting the bin size of a time histogram
% Neural Computation 19(6), 1503-1527, 2007
% http://dx.doi.org/10.1162/neco.2007.19.6.1503
%
% Example usage:
% optN = sshist(x); hist(x,optN);
%
% Input argument
% x:    Sample data vector.
% N (optinal):
%       A vector that specifies the number of bins to be examined.
%       The optimal number of bins is selected from the elements of N.
%       Default value is N = 2:50.
%       * Do not search binwidths smaller than a sampling resolution of data.
%
% Output argument
% optN: Optimal number of bins.
% N:    Bin numbers examined.
% C:    Cost function of N.
%
% See also SSKERNEL
%
% Copyright (c) 2009 2010, Hideaki Shimazaki All rights reserved.
% http://2000.jukuin.keio.ac.jp/shimazaki

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Parameters Setting
x = reshape(x,1,numel(x));
x_min = min(x);
x_max = max(x);

if nargin < 2
    buf = abs(diff(sort(x)));
    dx = min(buf(logical(buf ~= 0)));
    N_MIN = 2;              % Minimum number of bins (integer)
                            % N_MIN must be more than 1 (N_MIN > 1).
    N_MAX = min(floor((x_max - x_min)/(2*dx)),50);
                            % Maximum number of bins (integer)
    N = N_MIN:N_MAX;        % # of Bins
end

SN = 30;                    % # of partitioning positions for shift average
D = (x_max - x_min) ./ N;   % Bin Size Vector

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Computation of the Cost Function
Cs = zeros(length(N),SN);
for i = 1: length(N)

       shift = linspace(0,D(i),SN);
       for p = 1 : SN
               edges = linspace(x_min+shift(p)-D(i)/2,...
                        x_max+shift(p)-D(i)/2,N(i)+1);   % Bin edges

               ki = histc(x,edges);               % Count # of events in bins
               ki = ki(1:end-1);

               k = mean(ki);                      % Mean of event count
               v = sum( (ki-k).^2 )/N(i);         % Variance of event count

               Cs(i,p) = ( 2*k - v ) / D(i)^2;    % The Cost Function
       end

end
C = mean(Cs,2);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Optimal Bin Size Selectioin
[Cmin idx] = min(C);
optN = N(idx);                         % Optimal number of bins
%optD = D(idx);                         % *Optimal binwidth
%edges = linspace(x_min,x_max,N(idx));  % Optimal segmentation


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <TextView
        android:id="@+id/tvCaption"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="12dp"
        android:layout_marginTop="12dp"
        android:layout_marginEnd="12dp"
        android:labelFor="@+id/etInput"
        tools:ignore="LabelFor" />

    <EditText
        android:id="@+id/etInput"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="12dp"
        android:layout_marginEnd="12dp"
        android:imeOptions="actionDone"
        android:importantForAutofill="no"
        android:inputType="text" />

    <LinearLayout
        style="?android:attr/buttonBarStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <Button
            android:id="@+id/btnCancel"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/cancel" />

        <Button
            android:id="@+id/btnOk"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/ok" />
    </LinearLayout>
</LinearLayout>


text:
using System.Collections.Generic;

namespace Rest4Net.BitLy.Responses.Implementation
{
    internal class InfoImpl : IInfo
    {
#pragma warning disable 649
        private readonly List<InfoItemImpl> _info;
#pragma warning restore 649

        public IEnumerable<IInfoItem> Info
        {
            get
            {
                foreach (var impl in _info)
                    yield return impl;
            }
        }
    }

    internal class InfoItemImpl : IInfoItem
    {
#pragma warning disable 649
        private string _globalHash;
        private string _shortUrl;
        private string _hash;
        private string _userHash;
        private string _error;
        private string _title;
        private string _createdBy;
#pragma warning restore 649

        public string GlobalHash
        {
            get { return _globalHash; }
        }

        public string ShortUrl
        {
            get { return _shortUrl; }
        }

        public string Hash
        {
            get { return _hash; }
        }

        public string UserHash
        {
            get { return _userHash; }
        }

        public string Error
        {
            get { return _error; }
        }

        public string Title
        {
            get { return _title; }
        }

        public string CreatedBy
        {
            get { return _createdBy; }
        }
    }
}


text:
// Copyright (c) 2015-present, Parse, LLC.  All rights reserved.  This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.  An additional grant of patent rights can be found in the PATENTS file in the same directory.

using System;
using System.Threading;
using System.Threading.Tasks;

namespace Parse.Internal {
  interface IParseCurrentUserController : IParseObjectCurrentController<ParseUser> {
    Task<string> GetCurrentSessionTokenAsync(CancellationToken cancellationToken);

    Task LogOutAsync(CancellationToken cancellationToken);
  }
}


text:
{-# LANGUAGE OverloadedStrings #-}

module Network.Syncthing.Types.Error
    ( Error(..)
    , Errors(..)
    ) where

import           Control.Applicative              ((<$>), (<*>))
import           Control.Monad                    (MonadPlus (mzero))
import           Data.Aeson                       (FromJSON, Value (..), parseJSON, (.:))
import           Data.Text                        (Text)
import           Data.Time.Clock                  (UTCTime)

import           Network.Syncthing.Internal.Utils (toUTC)

-- | An error message and its timestamp.
data Error = Error {
      getTime :: Maybe UTCTime
    , getMsg  :: Text
    } deriving (Eq, Show)

newtype Errors = Errors { getErrors :: [Error] }
                 deriving (Eq, Show)

instance FromJSON Error where
    parseJSON (Object v) =
        Error <$> (toUTC <$> (v .:  "time"))
              <*> (v .:  "error")
    parseJSON _          = mzero

instance FromJSON Errors where
    parseJSON (Object v) = Errors <$> (v .: "errors")
    parseJSON _          = mzero


text:
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.sensors;

import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.EventChannel;

/** SensorsPlugin */
public class SensorsPlugin implements FlutterPlugin {
  private static final String ACCELEROMETER_CHANNEL_NAME =
      "plugins.flutter.io/sensors/accelerometer";
  private static final String GYROSCOPE_CHANNEL_NAME = "plugins.flutter.io/sensors/gyroscope";
  private static final String USER_ACCELEROMETER_CHANNEL_NAME =
      "plugins.flutter.io/sensors/user_accel";

  private EventChannel accelerometerChannel;
  private EventChannel userAccelChannel;
  private EventChannel gyroscopeChannel;

  /** Plugin registration. */
  @SuppressWarnings("deprecation")
  public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registrar registrar) {
    SensorsPlugin plugin = new SensorsPlugin();
    plugin.setupEventChannels(registrar.context(), registrar.messenger());
  }

  @Override
  public void onAttachedToEngine(FlutterPluginBinding binding) {
    final Context context = binding.getApplicationContext();
    setupEventChannels(context, binding.getBinaryMessenger());
  }

  @Override
  public void onDetachedFromEngine(FlutterPluginBinding binding) {
    teardownEventChannels();
  }

  private void setupEventChannels(Context context, BinaryMessenger messenger) {
    accelerometerChannel = new EventChannel(messenger, ACCELEROMETER_CHANNEL_NAME);
    final StreamHandlerImpl accelerationStreamHandler =
        new StreamHandlerImpl(
            (SensorManager) context.getSystemService(context.SENSOR_SERVICE),
            Sensor.TYPE_ACCELEROMETER);
    accelerometerChannel.setStreamHandler(accelerationStreamHandler);

    userAccelChannel = new EventChannel(messenger, USER_ACCELEROMETER_CHANNEL_NAME);
    final StreamHandlerImpl linearAccelerationStreamHandler =
        new StreamHandlerImpl(
            (SensorManager) context.getSystemService(context.SENSOR_SERVICE),
            Sensor.TYPE_LINEAR_ACCELERATION);
    userAccelChannel.setStreamHandler(linearAccelerationStreamHandler);

    gyroscopeChannel = new EventChannel(messenger, GYROSCOPE_CHANNEL_NAME);
    final StreamHandlerImpl gyroScopeStreamHandler =
        new StreamHandlerImpl(
            (SensorManager) context.getSystemService(context.SENSOR_SERVICE),
            Sensor.TYPE_GYROSCOPE);
    gyroscopeChannel.setStreamHandler(gyroScopeStreamHandler);
  }

  private void teardownEventChannels() {
    accelerometerChannel.setStreamHandler(null);
    userAccelChannel.setStreamHandler(null);
    gyroscopeChannel.setStreamHandler(null);
  }
}


text:
This directory contains data used to do integration tests on Perf.

The `perf/integration/data` directory contains ingestion files in
[format.Format](https://pkg.go.dev/go.skia.org/infra/perf/go/ingest/format?tab=doc#Format)
that can be used with an ingester of type 'dir'. See `/perf/configs/local.json`.

The data files were written by `generate_data.go` which is preserved in case the
data needs to be changed/expanded.

The generated files are to be used with the
https://github.com/skia-dev/perf-demo-repo.git repo.

The integration data set has 9 good files, 1 file with a bad commit, and 1
malformed JSON file.


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>wCMF 4.0: application/views/plugins/block.repeat.php Source File</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="A MDSD framework for building reliable, maintainable and extendable web applications with PHP">
  <meta name="keywords" content="PHP, web application framework, model driven development">
  <meta name="author" content="wemove digital solutions">
  <link rel="shortcut icon" href="theme/images/favicon.ico">

  <link href="theme/css/doxstyles.css" rel="stylesheet">

  <link href="theme/bootstrap3/css/bootstrap.min.css" rel="stylesheet">
  <link href="theme/bootstrap3/css/font-awesome.min.css" rel="stylesheet">

  <link href="theme/js/tocify/jquery.tocify.css" rel="stylesheet">

  <link href="theme/css/syntax.css" rel="stylesheet">
  <link href="theme/css/style.css" rel="stylesheet">

          <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".menu-navbar-collapse">
            Toggle navigation
          </button>
          wCMF 4.0

 Guides

Getting started

Architecture

Model

Persistence

Presentation

Configuration

Security

I18n & l10n

Tests

 API

 Code

 Support

                <input id="MSearchField" type="text" class="form-control" placeholder="Search API" name="query" onkeyup="searchBox.OnSearchFieldChange(event)">

wcmf_older

wcmf

src

wcmf

application

views

plugins

block.repeat.php

    1 <?php

    2

   11

   12 /*

   13 * Smarty plugin

   14 * -------------------------------------------------------------

   15 * File:     block.repeat.php

   16 * Type:     block

   17 * Name:     repeat

   18 * Purpose:  repeat a template block a given number of times and replace

   19 *           {literal}{$index}{/literal} by the current index

   20 *           (NOTE: $index has to be enclosed by literal)

   21 * Parameters: count (required)  - number of times to repeat

   22 *             assign (optional) - variable to collect output

   23 *             startindex (optional) - index value to start from

   24 *             strformat (optional) - format string to apply on index

   25 *             separator (optional) - separator to be added inbetween

   26 * Usage:    {repeat count=$content->getValue("numPages") startindex="1" strformat="%02s" separator=" | "}

   27 *               ... text to repeat {literal}{$index}{/literal} ...

   28 *           {/repeat}

   29 *

   30 * Author:   Scott Matthewman <scott@matthewman.net>

   31 *           Ingo Herwig <ingo@wemove.com> (index, separator enhancement)

   32 * -------------------------------------------------------------

   33 */

   34 function smarty_block_repeat($params, $content, \Smarty_Internal_Template $template, &$repeat) {

   35   if (!empty($content)) {

   36     $intCount = intval($params['count']);

   37     if($intCount < 0) {

   38       $template->trigger_error("block: negative 'count' parameter");

   39       return;

   40     }

   41

   42     $strRepeat = '';

   43     for ($i=0; $i<$intCount; $i++) {

   44       $index = $i + intval($params['startindex']);

   45       if (isset($params['strformat'])) {

   46         $indexStr = sprintf($params['strformat'], $index);

   47       }

   48       else {

   49         $indexStr = $index;

   50       }

   51       $strRepeat .= str_replace('{$index}', $indexStr, $content);

   52

   53       if (isset($params['separator']) && $i<$intCount-1) {

   54         $strRepeat .= $params['separator'];

   55       }

   56     }

   57

   58     if (!empty($params['assign'])) {

   59       $template->assign($params['assign'], $strRepeat);

   60     }

   61     else {

   62       echo $strRepeat;

   63     }

   64   }

   65 }

   66 ?>

        © 2016 wemove digital solutions

          Generated on Fri Jul 15 2016 22:20:37 for wCMF by  doxygen 1.8.10


text:
package ru.yandex.qatools.allure.data.utils;

import ru.yandex.qatools.allure.model.Description;
import ru.yandex.qatools.allure.model.DescriptionType;
import ru.yandex.qatools.allure.model.TestCaseResult;
import ru.yandex.qatools.allure.model.TestSuiteResult;

import static java.lang.System.lineSeparator;
import static org.jvnet.jaxb2_commons.lang.StringUtils.isEmpty;

/**
 * eroshenkoam
 * 11/03/15
 */
public final class DescriptionUtils {

    DescriptionUtils() {
    }

    public static Description mergeDescriptions(TestSuiteResult testSuiteResult, TestCaseResult testCaseResult) {
        return mergeDescriptions(testSuiteResult.getDescription(), testCaseResult.getDescription());
    }

    public static Description mergeDescriptions(Description testSuiteDescription, Description testCaseDescription) {
        if (testSuiteDescription == null) {
            return testCaseDescription;
        }

        if (testCaseDescription == null) {
            return testSuiteDescription;
        }

        Description description = new Description();
        if (!isEmpty(testSuiteDescription.getValue())) {

            DescriptionType descriptionType = getDescriptionType(
                    testSuiteDescription.getType(),
                    testCaseDescription.getType()
            );

            String descriptionValue = String.format("%s%s%s", testSuiteDescription.getValue(),
                    getSeparator(descriptionType), testCaseDescription.getValue());

            description.setValue(descriptionValue);
            description.setType(descriptionType);
        }
        return description;
    }

    private static String getSeparator(DescriptionType descriptionType) {
        return descriptionType.equals(DescriptionType.MARKDOWN) ?
                lineSeparator() + lineSeparator() : lineSeparator();
    }

    private static DescriptionType getDescriptionType(DescriptionType suiteType, DescriptionType testCaseType) {
        return suiteType.equals(DescriptionType.MARKDOWN) ?
                DescriptionType.MARKDOWN : testCaseType;
    }

}


text:
namespace PrtgSensorSharp
{
    public static class PrtgUnit
    {
        public static PrtgOptionalChannelProperty BytesBandwidth => Unit("BytesBandwidth");
        public static PrtgOptionalChannelProperty BytesMemory => Unit("BytesMemory");
        public static PrtgOptionalChannelProperty BytesDisk => Unit("BytesDisk");
        public static PrtgOptionalChannelProperty Temperature => Unit("Temperature");
        public static PrtgOptionalChannelProperty Percent => Unit("Percent");
        public static PrtgOptionalChannelProperty TimeResponse => Unit("TimeResponse");
        public static PrtgOptionalChannelProperty TimeSeconds => Unit("TimeSeconds");
        public static PrtgOptionalChannelProperty Custom => Unit("Custom");
        public static PrtgOptionalChannelProperty Count => Unit("Count");
        public static PrtgOptionalChannelProperty CPU => Unit("CPU");
        public static PrtgOptionalChannelProperty BytesFile => Unit("BytesFile");
        public static PrtgOptionalChannelProperty SpeedDisk => Unit("SpeedDisk");
        public static PrtgOptionalChannelProperty SpeedNet => Unit("SpeedNet");
        public static PrtgOptionalChannelProperty TimeHours => Unit("TimeHours");

        private static PrtgOptionalChannelProperty Unit(string value) =>
            new PrtgOptionalChannelProperty("Unit", value);
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.camelinaction</groupId>
    <artifactId>chapter15</artifactId>
    <version>2.0.0</version>
    <relativePath>..</relativePath>
  </parent>

  <artifactId>riderautoparts-standalone</artifactId>
  <name>Camel in Action 2 :: Chapter 15 :: Running Camel standalone</name>
  <packaging>jar</packaging>

  <dependencies>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-spring</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-cxf</artifactId>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </dependency>

    <!-- needed to run CXF standalone with Jetty as HTTP server -->
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http-jetty</artifactId>
      <version>${cxf-version}</version>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test-spring</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <!-- to generate wsdl to java -->
      <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-codegen-plugin</artifactId>
        <version>${cxf-version}</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>generate-sources</phase>
            <configuration>
              <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
              <wsdlOptions>
                <wsdlOption>
                  <wsdl>${basedir}/src/main/resources/wsdl/inventory.wsdl</wsdl>
                </wsdlOption>
              </wsdlOptions>
            </configuration>
            <goals>
              <goal>wsdl2java</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- to allow to run mvn camel:run -->
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-maven-plugin</artifactId>
      </plugin>

      <!-- Allows the example to be run via 'mvn compile exec:java' -->
      <!-- notice how we have define the mainClass -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <configuration>
          <mainClass>camelinaction.InventoryMain</mainClass>
          <includePluginDependencies>false</includePluginDependencies>
        </configuration>
      </plugin>

      <!-- to package the jar with a MANIFEST.MF with classpath and MainClass entry -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <mainClass>camelinaction.InventoryMain</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


text:
//
//  LFXLocalTransportManager.h
//  LIFX
//
//  Created by Nick Forge on 3/03/2014.
//  Copyright (c) 2014 LIFX Labs. All rights reserved.
//

#import "LFXTransportManager.h"
@class LFXGatewayConnection;

@interface LFXLocalTransportManager : LFXTransportManager

@property (nonatomic, readonly) LFXGatewayConnection *broadcastUDPConnection;
@property (nonatomic, readonly) LFXGatewayConnection *peerToPeerUDPConnection;

- (void)sendBroadcastUDPMessage:(LFXMessage *)message;

- (NSArray /* LFXGatewayConnection */ *)allGatewayConnections;

@end


text:
<style>
  sub > em {
    font-size: 12px;
    margin-right: 10px;
  }
</style>
## Polyline <sub>_extends_</sub> [Path](zh-cn/api/path)

The Polyline element draws a polyline or polygon.

### Attributes

| Attribute Name | Inherits | Type | Default | Instruction |
| --- | --- | --- | --- | --- |
| close | | boolean | false | Is the curve closed. |
| smooth | | boolean | false | Is the curve smooth. |
| points | | Array | [] | Vertices of the curve. |
| _readonly_ d | Path | string | '' | SVG Path |
| normalize | | boolean | false | If the `normalize` attribute of path is set to `true`, the center of the path graph will be drawn as the anchor of the element, otherwise, the coordinate will be drawn according to the actual path. |
| fillColor | | color | undefined | |
| strokeColor | | color | undefined | |
| lineWidth | | number | 1 | |
| lineJoin | | enum: {miter, bevel} | miter | |
| lineCap | | enum: {butt, square} | butt | |
| lineDash | | Array | undefined | |
| lineDashOffset | | number | 0 | |
| miterLimit | | number | 10 | |
| texture | | Image | undefined | |
| textureRect | | Array | undefined | |
| textureRepeat | | boolean | false | Not supported in 2D mode |
| sourceRect | | Array | undefined | |
| id | | string | '' | |
| name | | string | '' | |
| className | | string | '' | |
| x | | number | 0 | |
| y | | number | 0 | |
| pos | | Array | [0, 0] | Shorthand of [x, y] |
| transform | | string | '' | |
| transformOrigin | | Array | [0, 0] | |
| translate | | Array | [0, 0] | |
| rotate | | number | 0 | |
| scale | | Array | [1, 1] | |
| skew | | Array | [0, 0] | |
| opacity | | number | 1 | |
| zIndex | | number | 0 | |
| offsetPath | | string | undefined | |
| offsetDistance | | number | 0 | |
| offsetRotate | | string or number | auto | |
| pointerEvents | | string | visible | |
| filter | | string | none | |

### Properties

##### _readonly_ isVisible

Whether the element is visible.

#### _From Path_

##### _readonly_ mesh

Get the element's geometry mesh data.

##### _readonly_ originalClientCenter

Client center point before matrix transform.

##### _readonly_ originalClientRect

Content box area before matrix transform.

##### _readonly_ originalContentRect

Content box area before matrix transform.

##### d

The same as element.attributes.d。

#### _From Node_

##### _readonly_ ancestors

Get a list of ancestor elements for the current element.

##### _readonly_ animations

Get all animations in the execution of the current element.

##### _readonly_ filters

Get the filters on the current element.

##### _readonly_ layer

Get the layer object in the current paint context.

##### _readonly_ localMatrix

Get the transform matrix of the current element relative to the parent element.

##### _readonly_ parent

Get the parent of the current object.

##### _readonly_ renderer

Get the rendered object in the current paint context.

##### _readonly_ renderMatrix

Get the transform matrix of the current element relative to the canvas coordinate system.

##### _readonly_ zOrder

Returns the order in which the current object is added to the context tree.

##### attributes

Returns the attribute object of the current element.

##### className

The same as element.attributes.className

##### id

The same as element.attributes.id

##### name

The same as element.attributes.name

##### zIndex

The same as element.attributes.zIndex

### Methods

#### _From Path_

##### _override_ draw(meshes = [])

Get a list of element related geometric meshes for rendering.

##### getBoundingClientRect()

Get the actual drawing area information of the element.

##### getPathLength()

Get the total length of path.

##### getPointAtLength(len)

Get the original coordinates of the point where the specified length is located.

##### _override_ onPropertyChange(key, newValue, oldValue)

The action when an element attribute value is changed.

##### _override_ updateContours()

Update the geometric figure of the drawing.

#### _From Node_

##### activateAnimations() {

Activate all animations in progress on the element.

##### addEventListener(type, listener, options = {})

Register event listeners.

##### animate(frames, timing)

Perform the animations.

##### attr(...args)

Get or set attributes in batch.

##### cloneNode()

Copy the entire element.

##### connect(parent, zOrder)

When the element is added to the context tree, the function is called and `parent` and `zorder` are assigned to the element.

##### deactivateAnimations()

Stops all animations in progress on the element.

##### disconnect()

When the element is removed from the context tree, the function is called and the parent and zorder properties are removed.

##### dispatchEvent(event)

Dispatch a custom event.

##### dispatchPointerEvent(event)

Dispatch a mouse or touch event.

##### forceUpdate()

Force the canvas to be redrawn.

##### getAttribute(key)

Get element attribute values.

##### getListeners(type, {capture = false} = {})

Get the event listeners.

##### getOffsetPosition(x, y)

Transform the specified [x, y] coordinates relative to the layer to the coordinates of to the current element, with the anchor as the origin [0, 0].

##### getResolution()

Get the context resolution of the element.

##### isPointCollision(x, y)

Determine whether the event coordinates intersect the element.

##### setAttribute(key, value)

Set the element attribute value.

##### setMouseCapture()

Capture mouse pointer.

##### setResolution({width, height})

Set the context resolution of the element.

##### releaseMouseCapture()

Release mouse pointer.

##### remove()

Remove the element from its parent.

##### removeAttribute(key)

Remove the element attribute value and restore it to the default value.

##### removeEventListener(type, listener, options)

Remove the event listener.

##### transition(sec, easing = 'linear')

Create a transition animation.


text:
package org.itevents.model;

import java.util.Date;

public class VisitLog {

    private int id;
    private Event event;
    private Date date;
    private User user;

    public VisitLog() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Event getEvent() {
        return event;
    }

    public void setEvent(Event event) {
        this.event = event;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        VisitLog visitLog = (VisitLog) o;

        if (event != null ? !event.equals(visitLog.event) : visitLog.event != null) return false;
        if (date != null ? !date.equals(visitLog.date) : visitLog.date != null) return false;
        return !(user != null ? !user.equals(visitLog.user) : visitLog.user != null);

    }

    @Override
    public int hashCode() {
        int result = event != null ? event.hashCode() : 0;
        result = 31 * result + (date != null ? date.hashCode() : 0);
        result = 31 * result + (user != null ? user.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("VisitLog{");
        sb.append("id=").append(id);
        sb.append(", event=").append(event);
        sb.append(", date=").append(date);
        sb.append(", user=").append(user);
        sb.append('}');
        return sb.toString();
    }
}


text:
package com.google.refine.grel.ast;

import java.util.Properties;

import org.json.JSONObject;

import com.google.refine.expr.Evaluable;

/**
 * An abstract syntax tree node encapsulating a literal value.
 */
public class LiteralExpr implements Evaluable {
    final protected Object _value;

    public LiteralExpr(Object value) {
        _value = value;
    }

    @Override
    public Object evaluate(Properties bindings) {
        return _value;
    }

    @Override
    public String toString() {
        return _value instanceof String ? JSONObject.quote((String) _value) : _value.toString();
    }
}


text:
package org.apache.giraph.benchmark;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.PosixParser;
import org.apache.giraph.GiraphConfiguration;
import org.apache.giraph.examples.DoubleSumCombiner;
import org.apache.giraph.graph.GiraphJob;
import org.apache.giraph.io.PseudoRandomVertexInputFormat;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.apache.log4j.Logger;

/**
 * Default Pregel-style PageRank computation.
 */
public class PageRankBenchmark implements Tool {
  /** Class logger */
  private static final Logger LOG = Logger.getLogger(PageRankBenchmark.class);
  /** Configuration from Configurable */
  private Configuration conf;

  @Override
  public Configuration getConf() {
    return conf;
  }

  @Override
  public void setConf(Configuration conf) {
    this.conf = conf;
  }

  @Override
  public final int run(final String[] args) throws Exception {
    Options options = new Options();
    options.addOption("h", "help", false, "Help");
    options.addOption("v", "verbose", false, "Verbose");
    options.addOption("w",
        "workers",
        true,
        "Number of workers");
    options.addOption("s",
        "supersteps",
        true,
        "Supersteps to execute before finishing");
    options.addOption("V",
        "aggregateVertices",
        true,
        "Aggregate vertices");
    options.addOption("e",
        "edgesPerVertex",
        true,
        "Edges per vertex");
    options.addOption("c",
        "vertexClass",
        true,
        "Vertex class (0 for HashMapVertex, 1 for EdgeListVertex)");
    options.addOption("N",
        "name",
        true,
        "Name of the job");
    options.addOption("nc",
        "noCombiner",
        false,
        "Don't use a combiner");

    HelpFormatter formatter = new HelpFormatter();
    if (args.length == 0) {
      formatter.printHelp(getClass().getName(), options, true);
      return 0;
    }
    CommandLineParser parser = new PosixParser();
    CommandLine cmd = parser.parse(options, args);
    if (cmd.hasOption('h')) {
      formatter.printHelp(getClass().getName(), options, true);
      return 0;
    }
    if (!cmd.hasOption('w')) {
      LOG.info("Need to choose the number of workers (-w)");
      return -1;
    }
    if (!cmd.hasOption('s')) {
      LOG.info("Need to set the number of supersteps (-s)");
      return -1;
    }
    if (!cmd.hasOption('V')) {
      LOG.info("Need to set the aggregate vertices (-V)");
      return -1;
    }
    if (!cmd.hasOption('e')) {
      LOG.info("Need to set the number of edges " +
          "per vertex (-e)");
      return -1;
    }

    int workers = Integer.parseInt(cmd.getOptionValue('w'));
    String name = getClass().getName();
    if (cmd.hasOption("N")) {
      name = name + " " + cmd.getOptionValue("N");
    }

    GiraphJob job = new GiraphJob(getConf(), name);
    if (!cmd.hasOption('c') ||
        (Integer.parseInt(cmd.getOptionValue('c')) == 1)) {
      job.getConfiguration().setVertexClass(
          EdgeListVertexPageRankBenchmark.class);
    } else {
      job.getConfiguration().setVertexClass(
          HashMapVertexPageRankBenchmark.class);
    }
    LOG.info("Using class " +
        job.getConfiguration().get(GiraphConfiguration.VERTEX_CLASS));
    if (!cmd.hasOption("nc")) {
      job.getConfiguration().setVertexCombinerClass(DoubleSumCombiner.class);
    }
    job.getConfiguration().setVertexInputFormatClass(
        PseudoRandomVertexInputFormat.class);
    job.getConfiguration().setWorkerConfiguration(workers, workers, 100.0f);
    job.getConfiguration().setLong(
        PseudoRandomVertexInputFormat.AGGREGATE_VERTICES,
        Long.parseLong(cmd.getOptionValue('V')));
    job.getConfiguration().setLong(
        PseudoRandomVertexInputFormat.EDGES_PER_VERTEX,
        Long.parseLong(cmd.getOptionValue('e')));
    job.getConfiguration().setInt(
        PageRankComputation.SUPERSTEP_COUNT,
        Integer.parseInt(cmd.getOptionValue('s')));

    boolean isVerbose = false;
    if (cmd.hasOption('v')) {
      isVerbose = true;
    }
    if (cmd.hasOption('s')) {
      job.getConfiguration().setInt(
          PageRankComputation.SUPERSTEP_COUNT,
          Integer.parseInt(cmd.getOptionValue('s')));
    }
    if (job.run(isVerbose)) {
      return 0;
    } else {
      return -1;
    }
  }

  /**
   * Execute the benchmark.
   *
   * @param args Typically the command line arguments.
   * @throws Exception Any exception from the computation.
   */
  public static void main(final String[] args) throws Exception {
    System.exit(ToolRunner.run(new PageRankBenchmark(), args));
  }
}


text:
import * as React from "react";
import { CarbonIconProps } from "../../";
declare const Sleet24: React.ForwardRefExoticComponent<
  CarbonIconProps & React.RefAttributes<SVGSVGElement>
>;
export default Sleet24;


text:
/**
 * Created by mcgourtyalex on 4/14/15.
 */

var MainButtons = {

    // setup sets a callback for #breeder_find keyup
    setup: function() {
        $('.button-a').hover( function() {
            $('#tagline-text').html("Contribute information about your dog to our database");
        });

        $('.button-b').click( function() {
            $('.box-b').toggleClass("hidden");
        }).hover( function() {
            $('#tagline-text').html("Find the right breed for you");
        });

        $('#cancel-b').click( function() {
            $('.box-b').toggleClass("hidden");
        });

        $('.button-c').click( function() {
            $('.box-c').toggleClass("hidden");
        }).hover( function() {
            $('#tagline-text').html("Find a dog breeder with great reviews");
        });

        $('#cancel-c').click( function() {
            $('.box-c').toggleClass("hidden");
        });
    }
};

$(document).ready(function () {
    $(MainButtons.setup);
});


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

	<style name="Theme.GDCatalog" parent="@style/Theme.GreenDroid.NoTitleBar">

		<item name="gdActionBarTitleColor">@android:color/white</item>
		<item name="gdActionBarBackground">@drawable/action_bar_background</item>
		<item name="gdActionBarDividerDrawable">@drawable/action_bar_divider</item>
		<item name="gdActionBarDividerWidth">2px</item>

	</style>

    <style name="Theme.GDCatalog.TweakedItems" parent="@style/Theme.GDCatalog">

        <item name="gdItemViewPreferredHeight">45dp</item>

    </style>

</resources>