text:
package org.apache.camel.component.jetty;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.http.HttpOperationFailedException;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.processor.aggregate.AggregationStrategy;
import org.junit.Test;

/**
 * Based on end user on forum how to get the 404 error code in his enrich aggregator
 *
 * @version
 */
public class JettyHandle404Test extends BaseJettyTest {

    public String getProducerUrl() {
        return "http://localhost:{{port}}/myserver?user=Camel";
    }

    @Test
    public void testSimulate404() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Page not found");
        mock.expectedHeaderReceived(Exchange.HTTP_RESPONSE_CODE, 404);

        template.sendBody("direct:start", "Hello World");

        assertMockEndpointsSatisfied();
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                // disable error handling
                errorHandler(noErrorHandler());

                from("direct:start").enrich("direct:tohttp", new AggregationStrategy() {
                    public Exchange aggregate(Exchange original, Exchange resource) {
                        // get the response code
                        Integer code = resource.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class);
                        assertEquals(404, code.intValue());
                        return resource;
                    }
                }).to("mock:result");

                // use this sub route as indirection to handle the HttpOperationFailedException
                // and set the data back as data on the exchange to not cause the exception to be thrown
                from("direct:tohttp")
                        .doTry()
                            .to(getProducerUrl())
                        .doCatch(HttpOperationFailedException.class)
                            .process(new Processor() {
                                public void process(Exchange exchange) {
                                    // copy the caused exception values to the exchange as we want the response in the regular exchange
                                    // instead as an exception that will get thrown and thus the route breaks
                                    HttpOperationFailedException cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, HttpOperationFailedException.class);
                                    exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, cause.getStatusCode());
                                    exchange.getOut().setBody(cause.getResponseBody());
                                }
                            })
                        .end();

                // this is our jetty server where we simulate the 404
                from("jetty://http://localhost:{{port}}/myserver")
                        .process(new Processor() {
                            public void process(Exchange exchange) throws Exception {
                                exchange.getOut().setBody("Page not found");
                                exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 404);
                            }
                        });
            }
        };
    }
}


text:
#ifndef __XN_SERVER_SESSION_H__
#define __XN_SERVER_SESSION_H__

//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include "XnSensorsManager.h"
#include <XnOS.h>
#include <XnIONetworkStream.h>
#include "XnSensorClientServer.h"
#include "XnServerLogger.h"
#include <XnStringsHashT.h>

//---------------------------------------------------------------------------
// Types
//---------------------------------------------------------------------------

class XnServerSession
{
public:
	XnServerSession(XnSensorsManager* pSensorsManager, XnUInt32 nID, XN_SOCKET_HANDLE hSocket, XnServerLogger* pLogger);
	~XnServerSession() ;

	XnStatus Init();
	void Free();

	inline XnUInt32 ID() const { return m_nID; }
	inline XnBool HasEnded() const { return m_bHasEnded; }

private:
	// Types
	typedef struct
	{
		XnServerSession* pSession;
		XnChar strStreamName[XN_DEVICE_MAX_STRING_LENGTH];
		XnChar strClientStreamName[XN_DEVICE_MAX_STRING_LENGTH];
		XnBool bIsOpen;
		XnCallbackHandle hNewDataCallback;
	} SessionStream;

	typedef XnStringsHashT<SessionStream> SessionStreamsHash;

	// Functions
	XnStatus SendReply(XnSensorServerCustomMessages Type, XnStatus nRC, XnUInt32 nDataSize = 0, void* pAdditionalData = NULL);
	XnStatus SendInitialState();
	XnStatus FindStreamByServerName(const XnChar* strName, SessionStream** ppStream);

	XnStatus HandleOpenSensor();
	XnStatus OpenSensorImpl(const XnChar* strConnectionString);
	XnStatus CloseSensorImpl();
	XnStatus HandleSetIntProperty();
	XnStatus SetIntPropertyImpl(const XnChar* strModule, const XnChar* strProp, XnUInt64 nValue);
	XnStatus HandleSetRealProperty();
	XnStatus SetRealPropertyImpl(const XnChar* strModule, const XnChar* strProp, XnDouble dValue);
	XnStatus HandleSetStringProperty();
	XnStatus SetStringPropertyImpl(const XnChar* strModule, const XnChar* strProp, const XnChar* strValue);
	XnStatus HandleSetGeneralProperty();
	XnStatus SetGeneralPropertyImpl(const XnChar* strModule, const XnChar* strProp, const XnGeneralBuffer& gbValue);
	XnStatus HandleGetIntProperty();
	XnStatus GetIntPropertyImpl(const XnChar* strModule, const XnChar* strProp, XnUInt64* pnValue);
	XnStatus HandleGetRealProperty();
	XnStatus GetRealPropertyImpl(const XnChar* strModule, const XnChar* strProp, XnDouble* pdValue);
	XnStatus HandleGetStringProperty();
	XnStatus GetStringPropertyImpl(const XnChar* strModule, const XnChar* strProp, XnChar* strValue);
	XnStatus HandleGetGeneralProperty();
	XnStatus GetGeneralPropertyImpl(const XnChar* strModule, const XnChar* strProp, XnGeneralBuffer& gbValue);
	XnStatus HandleConfigFromINIFile();
	XnStatus ConfigFromINIFileImpl(const XnChar* strFileName, const XnChar* strSectionName);
	XnStatus HandleBatchConfig();
	XnStatus BatchConfigImpl(const XnPropertySet* pProps);
	XnStatus HandleNewStream();
	XnStatus NewStreamImpl(const XnChar* strType, const XnChar* strName, const XnPropertySet* pInitialValues);
	XnStatus HandleRemoveStream();
	XnStatus RemoveStreamImpl(const XnChar* strName);
	XnStatus HandleOpenStream();
	XnStatus OpenStreamImpl(const XnChar* strName);
	XnStatus HandleCloseStream();
	XnStatus CloseStreamImpl(const XnChar* strName);
	XnStatus HandleReadStream();
	XnStatus ReadStreamImpl(const XnChar* strName, XnSensorServerReadReply* pReply);
	XnStatus HandleCloseSession();
	XnStatus CloseSessionImpl();

	XnStatus HandleSingleRequest();

	XnStatus AddSessionModule(const XnChar* clientName, const XnChar* serverName);
	XnStatus RemoveSessionModule(const XnChar* clientName);

	XnStatus OnPropertyChanged(const XnProperty* pProp);
	XnStatus OnNewData(SessionStream* pStream, XnUInt64 nTimestamp, XnUInt32 nFrameID);

	XnStatus ServeThread();

	static void XN_CALLBACK_TYPE PropertyChangedCallback(const XnProperty* pProp, void* pCookie);
	static void XN_CALLBACK_TYPE StreamNewDataCallback(const XnServerSensorInvoker::NewStreamDataEventArgs& args, void* pCookie);
	static XN_THREAD_PROC ServeThreadCallback(XN_THREAD_PARAM pThreadParam);

	// Members
	XnSensorsManager* m_pSensorsManager;
	XnUInt32 m_nID;
	XN_SOCKET_HANDLE m_hSocket;
	XN_THREAD_HANDLE m_hThread;
	XN_CRITICAL_SECTION_HANDLE m_hCommLock;
	XN_CRITICAL_SECTION_HANDLE m_hStreamsLock;
	XnIONetworkStream m_ioStream;
	XnDataPacker m_privateIncomingPacker;
	XnDataPacker m_privateOutgoingPacker;
	XnStreamDataSet* m_pStreamDataSet;
	XnBool m_bShouldRun;
	XnBool m_bHasEnded;
	XnServerSensorInvoker* m_pSensor;
	SessionStreamsHash m_streamsHash;
	XnServerLogger* m_pLogger;
	XnCallbackHandle m_hProprtyChangeCallback;
};

#endif // __XN_SERVER_SESSION_H__

redpajama_set_name: RedPajamaGithub


text:
default['ontap_cloud']['ontap']['standalone']['name'] = nil
default['ontap_cloud']['ontap']['standalone']['ebs_type'] = 'gp2'
default['ontap_cloud']['ontap']['standalone']['size'] = '1TB'
default['ontap_cloud']['ontap']['standalone']['instance_type'] = 'm4.xlarge'
default['ontap_cloud']['ontap']['standalone']['license_type'] = 'cot-explore-paygo'
default['ontap_cloud']['ontap']['standalone']['write_speed'] = nil

default['ontap_cloud']['ontap']['standalone']['aggregate']['name'] = nil
default['ontap_cloud']['ontap']['standalone']['aggregate']['disk_count'] = nil
default['ontap_cloud']['ontap']['standalone']['aggregate']['size'] = node['ontap_cloud']['ontap']['standalone']['size']
default['ontap_cloud']['ontap']['standalone']['aggregate']['ebs_type'] = node['ontap_cloud']['ontap']['standalone']['ebs_type']

# AWS Options
default['ontap_cloud']['aws']['vpc_id'] = nil
default['ontap_cloud']['aws']['region'] = nil
default['ontap_cloud']['aws']['subnet_id'] = nil


text:
YUI.add('gallery-button', function(Y) {

/**
 *
 * @version 1.3.0
 */

var YL = Y.Lang,
  YCM = Y.ClassNameManager,
  EVENT_PRESS = 'press',
  CLASS_PRESSED  = '-pressed',
  CLASS_DEFAULT  = '-default',
  CLASS_DISABLED = '-disabled',
  CLASS_NO_LABEL = 'no-label',
  BOUNDING_BOX = 'boundingBox',
  CONTENT_BOX = 'contentBox',
  DEFAULT = 'default',
  ENABLED = 'enabled',
  DISABLED = 'disabled',
  HREF = 'href',
  TAB_INDEX = 'tabindex',
  ICON = 'icon',
  TITLE = 'title',
  INNER_HTML = 'innerHTML';

Y.Button = Y.Base.create('button',Y.Widget, [Y.WidgetChild], {

  BOUNDING_TEMPLATE : '<a />',

  CONTENT_TEMPLATE : '<span class="yui3-icon"/>',

  _className : '',

  _mouseIsDown : false,

  _mouseListener : null,

  _defaultCB : function() {
    return null;
  },

  initializer : function(config) {

    this._className = this.getClassName();
    this.publish(EVENT_PRESS, { defaultFn: this._defPressFn });
    this.after('defaultChange',this._afterDefaultChanged, this);
    this.after('enabledChange',this._afterEnabledChanged, this);
  },

  /**
   * Sets content to the content box
   * @method renderUI
   * @public
   * @since 1.0.0
   */
  renderUI : function(){
    var href = this.get(HREF);

    this.get(CONTENT_BOX).setContent(this.get('label'));

    if(href) {
        this.get(BOUNDING_BOX).setAttribute(HREF, href);
    } else {
        this.get(BOUNDING_BOX).set('tabIndex',0);
    }
  },

  /**
   * Binds internal `press` to default click event and mouse events for
   *   class changes
   * @method bindUI
   * @public
   * @since 1.0.0
   */
  bindUI : function(){
    var bb = this.get(BOUNDING_BOX);

    bb.on('click', this._defClickFn, this);
    bb.on('mouseup', this._mouseUp, this);
    bb.on('mousedown', this._mouseDown, this);
    bb.after('tabindexChange', this._afterTabindexChange, this);
  },

  /**
   * Updates default class and sets enabled
   * @method syncUI
   * @public
   * @since 1.0.0
   */
  syncUI : function() {
    this._updateDefault(this.get(DEFAULT));
    this._updateEnabled(this.get(ENABLED));
    this._updateTabindex(this.get(TAB_INDEX));
  },

  /**
   * Makes button diabled
   * @method disable
   * @public
   * @since 1.1.0
   * @chainable
   */
  disable : function() {
    this.set(ENABLED, false);
    return this;
  },

  /**
   * Makes button enabled
   * @method enable
   * @public
   * @since 1.1.0
   * @chainable
   */
  enable : function() {
    this.set(ENABLED, true);
    return this;
  },

  /**
   * Sets the title attribute to the bounding box
   * @method setTitle
   * @param title String
   * @public
   * @since 1.1.0
   * @chainable
   */
  setTitle : function(title) {
    this.get(BOUNDING_BOX).set(TITLE, title);
    return this;
  },

  //  P R O T E C T E D  //

  /**
   *
   */
  _defClickFn : function(e) {
    var href = this.get(HREF);

    if (!this.get(ENABLED)) {
        e.preventDefault();
        return;
    }

    if(!href || href === '#') {
        e.preventDefault();
    }
    this.fire(EVENT_PRESS, {click : e});
  },

  /**
   * Default press callback function
   * @method _defPressFn
   * @param e Event
   * @protected
   * @since 1.2.0
   */
  _defPressFn : function(e) {
    this._executeCallback(e);
  },

  /**
   * Removes the pressed class
   * @method _mouseUp
   * @protected
   * @since 1.0.0
   */
  _mouseUp : function() {
    this.get(BOUNDING_BOX).removeClass(this._className + CLASS_PRESSED);
    this._mouseIsDown = false;
    if(this._mouseListener !== null) {
      this._mouseListener.detach();
      this._mouseListener = null;
    }
  },

  /**
   * Adds the pressed class to bounding box
   * @method _mouseDown
   * @protected
   * @since 1.0.0
   */
  _mouseDown : function() {
    if(this.get(ENABLED)) {
      this.get(BOUNDING_BOX).addClass(this._className + CLASS_PRESSED);
      this._mouseIsDown = true;
      if(this._mouseListener === null) {
        this._mouseListener = Y.on('mouseup',Y.bind(this._listenForMouseUp,this));
      }
    }
  },

  /**
   * Callback for drag out mouse event
   * @method _listenForMouseUp
   * @protected
   * @since 1.0.0
   */
  _listenForMouseUp : function() {
    this._mouseUp();
  },

  /**
   * Updates the enabled state
   * @method _afterEnabledChanged
   * @protected
   * @since 1.0.0
   */
  _afterEnabledChanged : function(e) {
    this._updateEnabled(e.newVal);
  },

  /**
   * Adds or removes the disabled attribute to for the button and
   *   updates disabled class on bounding box
   * @method _updateEnabled
   * @protected
   * @since 1.0.0
   */
  _updateEnabled : function(status) {
    var bb = this.get(BOUNDING_BOX),
        disableClass = this._className + CLASS_DISABLED;

    if(status) {
      bb.removeClass(disableClass);
      bb.removeAttribute(DISABLED);
    }else{
      bb.addClass(disableClass);
      bb.removeClass(this._className + CLASS_PRESSED);
      bb.setAttribute(DISABLED,DISABLED);
    }

  },

  /**
   * Updates the default state
   * @method _afterDefaultChanged
   * @protected
   * @since 1.0.0
   */
  _afterDefaultChanged : function(e) {
    this._updateDefault(e.newVal);
  },

  /**
   * Updates the default class on the bounding box
   * @method _updateDefault
   * @param state boolean
   * @protected
   * @since 1.2.0
   * @return void
   */
  _updateDefault : function(state) {
    var bb = this.get(BOUNDING_BOX),
        defaultClass = this._className + CLASS_DEFAULT;
    if(state) {
      bb.addClass(defaultClass);
      bb.setAttribute(DEFAULT,DEFAULT);
    }else{
      bb.removeClass(defaultClass);
      bb.set(DEFAULT,'');
    }
  },

  /**
   * Used to fire the internal callback
   *
   * @method _executeCallback
   * @protected
   * @since 1.1.0
   */
  _executeCallback : function(e) {
    if(this.get('callback')) {
      (this.get('callback'))(e);
    }else{
        (this._callbackFromType())(e);
    }
  },

  /**
   * Sets the icon class for the bounding box
   *
   * @method _iconSetterFn
   * @protected
   * @since 1.3.0
   */
  _iconSetterFn : function(val) {
    this.get(BOUNDING_BOX).replaceClass(
      YCM.getClassName(ICON, this.get(ICON) || DEFAULT),
      YCM.getClassName(ICON, val || DEFAULT)
    );
    return val;
  },

  /**
   * Sets the icon class for the bounding box
   *
   * @method _labelSetterFn
   * @protected
   * @since 1.3.0
   */
  _labelSetterFn : function(val) {
    if (!val || val === '') {
      this.get(BOUNDING_BOX).addClass(this.getClassName(CLASS_NO_LABEL));
    } else {
      this.get(BOUNDING_BOX).removeClass(this.getClassName(CLASS_NO_LABEL));
    }
    this.get(CONTENT_BOX).setContent(val);
    this.set(TITLE, val);
    return val;
  },

  /**
   * Sets the title to the bounding box
   *
   * @method _titleSetterFn
   * @protected
   * @since 1.3.0
   */
  _titleSetterFn : function(val) {
    this.get(BOUNDING_BOX).set(TITLE, val);
    return val;
  },

  /**
   * Returns a function based on the type of button. Form buttons such
   *   as Submit and Reset are attached to their parent form if one is
   *   found. An empty function is return to prevent execution errors.
   *
   * @method _callbackFromType
   * @protected
   * @return Function
   * @since 1.3.0
   */
  _callbackFromType : function() {
    var bb = this.get(BOUNDING_BOX),
        frm = bb.ancestor('form');

    switch (this.get('type')) {
        case 'submit':
            if (frm) { return Y.bind(frm.submit, frm); }
            break;
        case 'reset':
            if (frm) { return Y.bind(frm.reset, frm); }
            break;
    }

    return function(){};
  },

  _afterTabindexChange : function(e) {
    this._updateTabindex(e.newVal);
  },

  _updateTabindex : function(val) {
    var bb = this.get(BOUNDING_BOX);

    if (val !== undefined && val !== null) {
        bb.setAttribute(TAB_INDEX, val);
    } else {
        bb.removeAttribute(TAB_INDEX);
    }
  }

}, {
  EVENTS : {
    PRESS : EVENT_PRESS
  },
  ATTRS : {
      label : {
          value : '',
          validator : YL.isString,
          setter : '_labelSetterFn',
          lazyAdd : false
      },
      callback : {
          validator : YL.isFunction
      },
      enabled : {
          value : true,
          validator : YL.isBoolean
      },
      DEFAULT : {
          value : false,
          validator : YL.isBoolean
      },
      icon : {
        value : DEFAULT,
        setter : '_iconSetterFn',
        lazyAdd : false
      },
      href : {
        value : null
      },
      title : {
          validator : YL.isString,
          setter : '_titleSetterFn'
      },
      tabindex : {
          value : 0
      },
      type : {
          value : 'push',
          validator : YL.isString,
          lazyAdd : false
      }
  },
  /**
   * HTML Parser assumes srcNode is either a <button> or
   *   <input type="submit|reset">
   * @since 1.2.0
   */
  HTML_PARSER : {

    enabled : function(srcNode) {
        return !srcNode.get(DISABLED);
    },

    label : function(srcNode) {
      if(srcNode.getAttribute('value')) {
        return srcNode.getAttribute('value');
      }
      if(srcNode.get(INNER_HTML)) {
        return srcNode.get(INNER_HTML);
      }

      // default form button labels based on type
      if(srcNode.get('tagName') === 'INPUT') {
        switch (srcNode.get('type')) {
          case 'reset' : return 'Reset';
          case 'submit' : return 'Submit';
        }
      }

      return null;
    },

    href : function(srcNode) {
        var href = srcNode.getAttribute(HREF);

        if(href) {
            return href;
        }

        return null;
    },

    type : function(srcNode) {
        var type = srcNode.getAttribute('type');

        if(type) {
            return type;
        }
        return null;
    },

    title : function(srcNode) {
      if(srcNode.getAttribute(TITLE)) {
        return srcNode.getAttribute(TITLE);
      }
      if(srcNode.getAttribute('value')) {
        return srcNode.getAttribute('value');
      }
      if(srcNode.get(INNER_HTML)) {
        return srcNode.get(INNER_HTML);
      }
      return null;
    }
  }
});

}, 'gallery-2011.02.02-21-07' ,{requires:['widget','event-mouseenter','widget-child']});


text:
<!DOCTYPE html>

	<meta charset="utf-8" />
  <meta name="viewport" content="width=device-width" />
  <title>Metabolisen oireyhtymän ehkäisy elämäntapaohjauksen avulla | Oulun Yliopisto</title>
  <link rel="stylesheet" href="stylesheets/normalize.css" />
  <link rel="stylesheet" href="stylesheets/app.css" />
  <link rel="stylesheet" href="stylesheets/general_foundicons.css" />
  <link rel="icon" type="image/png"  href="images/favicon.ico">

PrevMetSyn

Oulun Yliopisto

Esittely

Ohjausmalli

ICT-sovellus

Toteuttajat

Julkaisut

In English

Metabolisen oireyhtymän ehkäisy elämäntapaohjauksen avulla

Uusien ohjausmenetelmien soveltaminen perusterveydenhuoltoon

Tutkimus perustuu Suomen Akatemian SALVE-ohjelman kansainvälisessä arvioinnissa erinomaiset arviot saaneeseen elintapaohjauksen uuteen menetelmään, joka yhdistää syömiskäyttäytymisen muutosten ja terveystiedon ymmärtämisen huomioon ottamisen sekä modernin ICT-teknologian hyödyntämisen.

Esittely

Tausta

Lihavuus liitännäissairauksineen on merkittävä kansanterveysongelma. Vyötärölihavuus on myös keskeinen metabolisen oireyhtymän osatekijä. Lihavuuden ehkäisy ja hoito elintapamuutosten avulla on tärkeää. Pysyvien ruokailu- ja liikuntatottumusten muutoksien tekeminen on kuitenkin osoittautunut haasteelliseksi. Myös syömisen psykologisilla tekijöillä, eli syömiskäyttäytymisellä on havaittu olevan yhteyttä onnistuneeseen laihtumiseen. Lisäksi elintapaohjausta saavat henkilöt eivät kaikki pysty ymmärtämään annettua tietoa samalla tavalla, vaan ohjaus pitää räätälöidä eri henkilöille  tiedon vastaanottokyvyn mukaisesti. Tarvitaankin tietoa uusista vaikuttavista ohjausmenetelmistä, joilla voidaan vaikuttaa elintapamuutosten pysyvyyteen ja syömiskäyttäytymiseen.

Vakuuttava teknologia voidaan nähdä tutkimuskenttänä, jossa yksittäinen tutkimuskohde on käyttäytymismuutosta tukeva tietojärjestelmä, joka on suunniteltu muodostamaan, muuttamaan tai vahvistamaan ihmisen asenteita tai käytöstä käyttämättä pakottamista, vilppiä tai ulkoisia kannustimia. Näin ollen myös hankkeessa kehitettävä tietojärjestelmä perustuu osallistujan omaan aktiiviseen ja vapaaehtoiseen toimintaan, jota tuetaan suunnitelluilla ohjelmisto-ominaisuuksilla.

Tavoite

Tavoitteenamme on löytää uusia elintapaohjausmenetelmiä, joilla voidaan vaikuttaa aikaisempaa tehokkaammin elintapa- ja syömiskäyttäytymismuutoksiin. Lisäksi tutkimuksessa kehitetään ICT-sovellus, jolla voidaan tukea näiden muutosten tekemistä. Sekä ryhmäohjausmallien että ICT-sovelluksen vaikutusta elintapojen ja syömiskäyttäytymisen muutoksiin tutkitaan monitieteellisesti.

Toteutus, aikataulu ja rahoitus

Hanke toteutetaan kolmen ryhmän interventiona. Ryhmät eroavat toisistaan ohjauksen sisällön osalta. Kaikissa ryhmissä puolet kohdehenkilöistä käyttää tukena modernia tieto- ja viestintäteknologiaa. Tutkimuksen otoskoko on 600 henkilöä. Tutkimushenkilöt rekrytoidaan ja tutkimus aloitetaan vaiheittain n. 60 henkilön ryhmissä. Henkilöt satunnaistetaan kuuteen tutkimusryhmään, joihin jokaiseen on tavoitteena 100 henkilöä/ryhmä. Tutkimuksen kokonaiskesto on 2 vuotta. Hankkeen käytännön toimet ovat alkaneet vuoden 2012 alussa ja  potilaiden rekrytointi alkusyksystä 2012. Rahoituksen perustana ovat Suomen Akatemian SALVE-ohjelma ja Sosiaali-ja Terveysministeriön Terveyden edistämisen määräraha.

Hanke mediassa

Terveystiedon lukutaito kansalaistaidoksi (Suomen Kuvalehden blogi, 10.3.2013)
600 uuden Oulun asukasta saa kutsun elämäntapamuutokseen (Kaleva, 15.12.2012)

Ohjausmalli

Ohjausmalli 1

Ohjaus tapahtuu ryhmäohjauksena.

Yhdessä ryhmässä on noin 10 henkilöä ja ryhmätapaamisia on 8.

Tavoitteena on omaan painoon ja terveyteen liittyvien tekijöiden laaja-alainen jäsentäminen: elintavat, syömiskäyttäytyminen, ruokatottumukset, liikunta ja elämäntilanteeseen liittyvät tekijät.

Tavoitteena on myös syömiseen liittyvien ajatusten, tunteiden ja toiminnan vuorovaikutuksen tunnistaminen sekä syömiseen ja painonhallintaan liittyvien mahdollisten haitallisten ajatusten tunnistaminen ja käsittely.

Ohjausmenetelminä käytetään tehtäviä ja harjoituksia syömisen hallintaan liittyen, tietoisuustaitoharjoituksia, ohjauskeskusteluja, parikeskusteluja ja kotitehtäviä.

Ohjausmalli 2

Ohjaus tapahtuu ryhmäohjauksena.

Yhdessä ryhmässä on noin 10 henkilöä ja ryhmätapaamisia on 2.

Tavoitteena on tulla tietoiseksi metaboliseen oireyhtymään vaikuttavista tekijöistä, niiden hoidosta elämäntapamuutosten avulla ja saada tietoa elintapamuutoksessa onnistumiseen.

Tavoitteena on määrittää oma tärkein muutostavoite ja alkaa kokeilla toimintaa tavoitteen toteuttamiseksi.

Ohjausmenetelminä käytetään mm. oppimispeliä, parikeskustelua, ja tehtäviä  Painonhallitsija-kirjasta1, jossa on tietoa ja tehtäviä elintapamuutoksen tueksi.

               1 Laitinen J, Alahuhta M, Keränen A-M, Korkiakangas E, Nevanperä N. Painonhallitsija. Työterveyslaitos, 2012.

Onnikka-ohjaus

Onnikka-ohjaus toteutuu omalla tietokoneella esim. kotona (on internetpohjainen).

Onnikka-ohjelma lähettää kerran viikossa tehtäviä ja tietoa elintapamuutoksen tekemisen tueksi.

Onnikka-ohjaus kestää  52 viikkoa, eli yhden vuoden.

Tavoitteena on saada tietoa ja valmiuksia itsenäiseen elintapojen muuttamiseen, laihduttamiseen ja painonhallintaan.

Tavoitteena on tukea yksilöllistä muutosta  elintapojen ja syömiskäyttäytymisen osalta.

Verrokkiryhmä

Osa tutkimushenkiköistä arpoutuu verrokkiryhmään, jossa annetaan materiaalia ja kannustusta itsenäiseen elintapamuutosten tekemiseen.

ICT-sovellus

Onnikka-palvelu

Web-pohjainen ICT-sovellus Onnikka tarjoaa käyttäjilleen:

Viikottaisen tietopaketin, tehtävän ja vinkin

Vertaistuen muilta käyttäjiltä

Painon ja motivaation seurannan

Ruoka- ja liikuntapäiväkirjan

Työkaluja elämäntapamuutoksen avuksi

Mahdollisuuden kysymysten esittämiseen asiantuntijoille

Sähköpostimuistutukset

Sovellus on toteutettu vakuuttavan teknologian suunnittelumenetelmiä ja uusimpia web-teknologioita hyödyntäen.

Toteuttajat

Kliinisen lääketieteen laitos, sisätaudit

Markku Savolainen

LKT

Sisätautiopin professori

Anna-Maria Keränen

FT

Laillistettu ravitsemusterapeutti, tutkija

Tuire Salonurmi

FT

Projektikoordinaattori, tutkija

Terhi Jokelainen

KM, ETM

Laillistettu ravitsemusterapeutti, tutkija

Tietojenkäsittelytieteiden laitos

Harri Oinas-Kukkonen

FT

Tietojärjestelmien professori

Pasi Karppinen

FM

Tutkija

Tuomas Alahäivälä

FM

Tutkija

Informaatiotutkimus

Maija-Leena Huotari

FT

Informaatiotutkimuksen professori

Kreeta Askola

FM

Tutkija

Heidi Enwald

FM

Tutkija

Stefan Ek

FT

Tutkija

Raimo Niemelä

FT

Tutkija

Työterveyslaitos

Jaana Laitinen

FT

Dosentti

Laskennallisen lääketieteen tutkimusryhmä

Mika Ala-Korpela

FT

Professori

Julkaisut

          Näytä:

Tieteelliset artikkelit

Kongressijulkaisut

Väitöskirjat ja opinnäytteet

Muut julkaisut

2012

Oinas-Kukkonen, H. A foundation for the study of behavior change support systems. Personal and ubiquitous computing, Online First.
http://link.springer.com/content/pdf/10.1007%2Fs00779-012-0591-5.pdf

2011

Keränen A-M, Strengell K, Savolainen M, Laitinen J. Effect of weight loss intervention on the association between eating behaviour measured by TFEQ-18 and dietary intake in adults. Appetite (2011); (56)156-162.

Komulainen T., Keränen A-M, Rasinaho E, Hakko H, Savolainen M, Kujari M-L, Reponen A, Lindeman S. Quitting a weight loss program is associated with anhedonia: the Lifestyle Intervention Treatment Evaluation Study in Northern Finland. International Journal of Circumpolar Health 2011;70:72-78.

Lehto T. & Oinas-Kukkonen H. Persuasive Features in Web-Based Alcohol and Smoking Interventions: A Systematic Review of the Literature. Journal of Medical Internet Research, 13(3), e46.
http://www.jmir.org/2011/3/e46/

Segerståhl K. & Oinas-Kukkonen H. Designing for personal exercise monitoring employing multiple modes of delivery: Implications from a qualitative study on heart rate monitoring. International Journal of Medical Informatics, Vol. 80, Issue 12, pp. e203-e213, December 2011.
http://www.ncbi.nlm.nih.gov/pubmed/21963231

2010

Alahuhta M, Ukkola T, Korkiakangas E, Jokelainen T, Keränen A-M, Kyngäs H, Laitinen J. Elintapamuutosvaihe sekä painonhallinnan onnistumisen edellytykset ja riskitekijät tyypin 2 diabeteksen riskihenkilöillä. Tutkiva hoitotyö 2010; (2) 4-13.

Keränen A-M, Rasinaho E, Hakko H, Savolainen M, Lindeman S. Eating behavior in obese and overweight persons with and without anhedonia. Appetite 2010; (55) 726-729.

Laitinen J, Korkiakangas E, Alahuhta M, Keinänen-Kiukaanniemi S, Rajala U, Timonen O, Jokelainen T, Keränen A-M, Remes J, Ruokonen A, Hedberg P, Husman P, Olkkonen S. Feasibility of videoconferencing in lifestyle group counseling. International Journal of Circumpolar Health 2010; 69(5):500-511.

2009

Keränen A-M, Savolainen M J, Reponen A H, Kujari M, Bloigu R, Lindeman S, Laitinen J. The effect of eating behavior on weight loss and maintenance during a lifestyle intervention. Preventive Medicine 2009; (49) 32-38.

Oinas-Kukkonen H. & Harjumaa M. Persuasive Systems Design: Key Issues, Process Model, and System Features. Communications of the Association for Information Systems, Vol. 24, Article 28, pp. 485-500, March 2009.
http://aisel.aisnet.org/cais/vol24/iss1/28/

2013

Alahäivälä T., Oinas-Kukkonen H. & Jokelainen T. Software Architecture Design for Health BCSS: Case Onnikka. PERSUASIVE 2013, Lecture Notes In Computer Science, vol. 7822. Springer, Berlin
http://link.springer.com/content/pdf/10.1007%2F978-3-642-37157-8_3.pdf

Karppinen P. & Oinas-Kukkonen H. Three Approaches to Ethical Considerations in the Design of Behavior Change Support Systems. Lecture Notes in Computer Science, 2013, Volume 7822, Persuasive Technology, pp. 87-98.
http://link.springer.com/content/pdf/10.1007%2F978-3-642-37157-8_12.pdf

2012

Langrial S., Lehto T., Oinas-Kukkonen H., Harjumaa M. & Karppinen P. Native Mobile Applications for Personal Well-Being: A Persuasive Systems Design Evaluation. In: 16th Pacific-Asia Conference on Information Systems, PACIS 2012 Proceedings.
http://aisel.aisnet.org/pacis2012/93/

Lehto T., Oinas-Kukkonen H. & Drozd F. Factors Affecting Perceived Persuasiveness of a Behavior Change Support System. International Conference on Information Systems (ICIS 2012), Orlando, Florida, December 16-19.
http://aisel.aisnet.org/icis2012/proceedings/HumanBehavior/18/

Lehto T., Oinas-Kukkonen H., Pätiälä T. & Saarelma 0. Consumers' Perceptions of a Virtual Health Check: An Empirical Investigation. In: 20th European Conference on Information Systems, ECIS 2012 Proceedings, Paper 154.
http://aisel.aisnet.org/ecis2012/154

2009

Harjumaa M., Segerståhl K. & Oinas-Kukkonen H. Understanding Persuasive System Functionality in Practice: a Field Trial of Polar FT60. ACM International Conference Proceeding Series, Vol. 350, Proceedings of the Fourth International Conference on Persuasive Technology, Claremont, CA, USA, April 26-29, 2009.
http://dl.acm.org/citation.cfm?id=1541952

2013

Alahäivälä, T. Software Design of a Health BCSS: Case Onnikka. Pro Gradu -tutkielma, Oulun Yliopisto.

2011

Keränen, A-M. Lifestyle interventions in treatment of obese adults. Eating behaviour and other factors affecting weight loss and maintenance. Väitöskirja, Oulun Yliopisto

2013

Oinas-Kukkonen Harri & Oinas-Kukkonen Henry Humanizing the Web: Change and Social Innovation. Palgrave Macmillan, Basingstoke, UK.
http://us.macmillan.com/humanizingtheweb/HarriOinasKukkonen

            Tämän päivän Internet on ensisijaisesti sosiaalinen toimintaympäristö. Facebook, Twitter ja muut sosiaalisen median nettisovellukset ovat tulleet laajallekin yleisölle hyvin tutuiksi, mutta näiden taustalla oleva ilmiö on paljon pitkäikäisempi ja syvällisempi kuin pelkästään juuri nyt suosiossa olevat nettisovellukset. Tämä ilmiö on nimeltään sosiaalinen web.

            Oulun yliopiston tutkijaveljekset Harri ja Henry Oinas-Kukkonen ovat julkaisseet kirjan Humanizing the Web: Change and Social Innovation. Kirjassa kuvataan, miten sosiaalinen web muuttaa sitä, miten ihmisten odotetaan toimivan, mitä heidän odotetaan osaavan ja jopa millaisia heidän odotetaan olevan.

2012

Laitinen J, Alahuhta M, Keränen A-M, Korkiakangas E, Nevanperä N. Painonhallitsija. Työterveyslaitos


text:
FROM debian:wheezy
MAINTAINER Valentin Andries <valentin.andries@gmail.com>

# Install utils
RUN \
  apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get -y install wget curl build-essential autoconf git libreadline-dev

# Install PHP deps
RUN \
  echo "\ndeb-src http://http.debian.net/debian wheezy main" >> /etc/apt/sources.list && \
  apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get -y build-dep php5

# Install PHPenv
RUN \
  mkdir -p /home && \
  git clone git://github.com/phpenv/phpenv.git /home/.phpenv && \
  cd /home/.phpenv && \
  git reset --hard origin/master && \
  exec $SHELL && \
  ./bin/phpenv rehash

# Complete ENV
ENV PATH /home/.phpenv/bin:/home/.phpenv/shims:$PATH
ENV PHPENV_ROOT /home/.phpenv

# Define working directory
WORKDIR /data


text:
module Platform
  ##
  # This class merely handles event processing for the MarkerPresentationController
  #
  class FG_MarkerPresentationEventController
    attr_accessor :api

    def initialize(api)
      self.api = api
      api.uiEvents.registerForEvent("MarkerPresent:Add", self)
      api.uiEvents.registerForEvent("MarkerPresent:Remove", self)
    end

    def onBuspassEvent(event)
      puts "FG Marker Presentation Event Controller. got event #{event.eventName}"
      eventData = event.eventData
      case event.eventName
        when "MarkerPresent:Add"
          presentMarker(eventData)
        when "MarkerPresent:Remove"
          abandonMarker(eventData)
      end
    end

    def presentMarker(eventData)
      raise "NotImplemented"
    end

    def abandonMarker(eventData)
      raise "NotImplemented"
    end
  end

end


text:
#ifndef __ARCH_ARM_MACH_SPRD_DEVICES_H
#define __ARCH_ARM_MACH_SPRD_DEVICES_H

extern struct platform_device sprd_hwspinlock_device0;
extern struct platform_device sprd_hwspinlock_device1;
extern struct platform_device sprd_serial_device0;
extern struct platform_device sprd_serial_device1;
extern struct platform_device sprd_serial_device2;
extern struct platform_device sprd_serial_device3;
extern struct platform_device sprd_device_rtc;
#ifdef CONFIG_SEC_GPIO_DVS
extern struct platform_device secgpio_dvs_device;
#endif
extern struct platform_device sprd_eic_gpio_device;
extern struct platform_device sprd_nand_device;
extern struct platform_device sprd_lcd_device0;
extern struct platform_device sprd_lcd_device1;
#ifdef CONFIG_PSTORE_RAM
extern struct platform_device sprd_ramoops_device;
#endif
extern struct platform_device sprd_otg_device;
extern struct platform_device sprd_backlight_device;
extern struct platform_device sprd_i2c_device0;
extern struct platform_device sprd_i2c_device1;
extern struct platform_device sprd_i2c_device2;
extern struct platform_device sprd_i2c_device3;
extern struct platform_device sprd_spi0_device;
extern struct platform_device sprd_spi1_device;
extern struct platform_device sprd_spi2_device;
extern struct platform_device sprd_keypad_device;
extern struct platform_device sprd_thm_device;
extern struct platform_device sprd_thm_a_device;
extern struct platform_device sprd_battery_device;
extern struct platform_device sprd_headset_device;
#ifdef  CONFIG_RF_SHARK
extern struct platform_device trout_fm_device;
#endif
extern struct platform_device sprd_battery_device;
extern struct platform_device sprd_vsp_device;
extern struct platform_device sprd_jpg_device;
#ifdef CONFIG_ION
extern struct platform_device sprd_ion_dev;
#endif
extern struct platform_device sprd_iommu_gsp_device;
extern struct platform_device sprd_iommu_mm_device;
#ifdef CONFIG_MUX_SDIO_OPT1_HAL
extern struct platform_device ipc_sdio_device;
#endif
extern struct platform_device sprd_sdio0_device;
extern struct platform_device sprd_sdio1_device;
extern struct platform_device sprd_sdio2_device;
extern struct platform_device sprd_emmc_device;
extern struct platform_device sprd_dcam_device;
extern struct platform_device sprd_scale_device;
extern struct platform_device sprd_gsp_device;
extern struct platform_device sprd_rotation_device;
extern struct platform_device sprd_sensor_device;
extern struct platform_device sprd_isp_device;
extern struct platform_device sprd_dma_copy_device;
extern struct platform_device sprd_ahb_bm0_device;
extern struct platform_device sprd_ahb_bm1_device;
extern struct platform_device sprd_ahb_bm2_device;
extern struct platform_device sprd_ahb_bm3_device;
extern struct platform_device sprd_ahb_bm4_device;
extern struct platform_device sprd_axi_bm0_device;
extern struct platform_device sprd_axi_bm1_device;
extern struct platform_device sprd_axi_bm2_device;
#ifdef CONFIG_SIPC_TD
extern struct platform_device sprd_spipe_td_device;
extern struct platform_device sprd_slog_td_device;
extern struct platform_device sprd_stty_td_device;
extern struct platform_device sprd_spool_td_device;
extern struct platform_device sprd_cproc_td_device;
extern struct platform_device sprd_seth0_td_device;
extern struct platform_device sprd_seth1_td_device;
extern struct platform_device sprd_seth2_td_device;
extern struct platform_device sprd_saudio_td_device;
#endif
#ifdef CONFIG_SIPC_WCDMA
extern struct platform_device sprd_spipe_wcdma_device;
extern struct platform_device sprd_slog_wcdma_device;
extern struct platform_device sprd_stty_wcdma_device;
extern struct platform_device sprd_spool_wcdma_device;
extern struct platform_device sprd_cproc_wcdma_device;
extern struct platform_device sprd_seth0_wcdma_device;
extern struct platform_device sprd_seth1_wcdma_device;
extern struct platform_device sprd_seth2_wcdma_device;
extern struct platform_device sprd_saudio_wcdma_device;
#endif
#ifdef CONFIG_SIPC_WCN
extern struct platform_device sprd_spipe_wcn_device;
extern struct platform_device sprd_slog_wcn_device;
extern struct platform_device sprd_cproc_wcn_device;
extern struct platform_device sprd_sttybt_td_device;
#endif
extern struct platform_device sprd_saudio_voip_device;
extern struct platform_device sprd_a7_pmu_device;
extern struct platform_device sprd_memnand_system_device;
extern struct platform_device sprd_memnand_userdata_device;
extern struct platform_device sprd_memnand_cache_device;

extern struct platform_device sprd_audio_vbc_r2p0_sprd_codec_v3_device;
extern struct platform_device sprd_audio_i2s_null_codec_device;
extern struct platform_device sprd_audio_platform_pcm_device;
extern struct platform_device sprd_audio_vaudio_device;
extern struct platform_device sprd_audio_vbc_r2p0_device;
extern struct platform_device sprd_audio_i2s0_device;
extern struct platform_device sprd_audio_i2s1_device;
extern struct platform_device sprd_audio_i2s2_device;
extern struct platform_device sprd_audio_i2s3_device;
extern struct platform_device sprd_audio_sprd_codec_v3_device;
extern struct platform_device sprd_audio_null_codec_device;

#ifdef CONFIG_SPRD_VETH
#ifdef CONFIG_MUX_SPI_HAL
extern struct platform_device sprd_veth_spi0_device;
extern struct platform_device sprd_veth_spi1_device;
extern struct platform_device sprd_veth_spi2_device;
extern struct platform_device sprd_veth_spi3_device;
extern struct platform_device sprd_veth_spi4_device;
#endif
#ifdef CONFIG_MUX_SDIO_HAL
extern struct platform_device sprd_veth_sdio0_device;
extern struct platform_device sprd_veth_sdio1_device;
extern struct platform_device sprd_veth_sdio2_device;
extern struct platform_device sprd_veth_sdio3_device;
extern struct platform_device sprd_veth_sdio4_device;
#endif
#endif

extern struct platform_device modem_interface_device;
#endif


text:
<?php

namespace Syntax\SteamApi\Steam;

use Syntax\SteamApi\Client;
use Illuminate\Support\Collection;
use Syntax\SteamApi\Containers\Package as PackageContainer;

class Package extends Client
{
    public function __construct()
    {
        parent::__construct();
        $this->url = 'http://store.steampowered.com/';
        $this->interface = 'api';
    }

    public function packageDetails($packIds, $cc = null, $language = null)
    {
        // Set up the api details
        $this->method = 'packagedetails';
        $this->version = null;
        // Set up the arguments
        $arguments = [
            'packageids' => $packIds,
            'cc'         => $cc,
            'l'          => $language,
        ];
        // Get the client
        $client = $this->setUpClient($arguments);

        return $this->convertToObjects($client, $packIds);
    }

    protected function convertToObjects($package, $packIds)
    {
        $convertedPacks = $this->convertPacks($package, $packIds);
        $package = $this->sortObjects($convertedPacks);

        return $package;
    }

    /**
     * @param $packages
     * @param $packIds
     * @return Collection
     */
    protected function convertPacks($packages, $packIds)
    {
        $convertedPacks = new Collection();
        foreach ($packages as $package) {
            if (isset($package->data)) {
                $convertedPacks->add(new PackageContainer($package->data, $packIds));
            }
        }

        return $convertedPacks;
    }
}


text:
<!DOCTYPE IllegalNameStartChar [
<!ELEMENT IllegalNameStartChar ANY>
]>
<!-- IllegalNameStartChar #0xF1FF -->
<IllegalNameStartChar/>


text:
=====

Slides and code samples from my conference and user group presentations


text:
import pytest

from insights.core.dr import SkipComponent
from insights.combiners.httpd_conf import HttpdConfTree
from insights.combiners.nginx_conf import NginxConfTree
from insights.parsers.httpd_conf import HttpdConf
from insights.parsers.mssql_conf import MsSQLConf
from insights.parsers.nginx_conf import NginxConfPEG
from insights.specs.datasources.ssl_certificate import (
    httpd_ssl_certificate_files, nginx_ssl_certificate_files,
    mssql_tls_cert_file, httpd_certificate_info_in_nss
)
from insights.tests import context_wrap

HTTPD_CONF = """
listen 80
listen 443
IncludeOptional "/etc/httpd/conf.d/*.conf"
""".strip()

HTTPD_SSL_CONF = """
<VirtualHost *:443>
  ## SSL directives
  SSLEngine on
  SSLCertificateFile      "/etc/pki/katello/certs/katello-apache.crt"
  SSLCertificateKeyFile   "/etc/pki/katello/private/katello-apache.key"
  SSLCertificateChainFile "/etc/pki/katello/certs/katello-server-ca.crt"
  SSLVerifyClient         optional
  SSLCACertificateFile    "/etc/pki/katello/certs/katello-default-ca.crt"
  SSLVerifyDepth          3
  SSLOptions +StdEnvVars +ExportCertData
</VirtualHost>
""".strip()

HTTPD_SSL_CONF_2 = """
<VirtualHost *:443>
  ## SSL directives
  ServerName a.b.c.com
  SSLEngine on
  SSLCertificateFile      "/etc/pki/katello/certs/katello-apache.crt"
  SSLCertificateKeyFile   "/etc/pki/katello/private/katello-apache.key"
  SSLCertificateChainFile "/etc/pki/katello/certs/katello-server-ca.crt"
  SSLVerifyClient         optional
  SSLCACertificateFile    "/etc/pki/katello/certs/katello-default-ca.crt"
  SSLVerifyDepth          3
  SSLOptions +StdEnvVars +ExportCertData
</VirtualHost>
<VirtualHost *:443>
  ## SSL directives
  ServerName  d.c.e.com
  SSLEngine on
  SSLCertificateFile      "/etc/pki/katello/certs/katello-apache_d.crt"
  SSLCertificateKeyFile   "/etc/pki/katello/private/katello-apache_d.key"
  SSLCertificateChainFile "/etc/pki/katello/certs/katello-server-ca_d.crt"
  SSLVerifyClient         optional
  SSLCACertificateFile    "/etc/pki/katello/certs/katello-default-ca_d.crt"
  SSLVerifyDepth          3
  SSLOptions +StdEnvVars +ExportCertData
</VirtualHost>
<VirtualHost *:443>
  ## SSL directives
  ServerName  f.g.e.com
  SSLEngine off
  SSLCertificateFile      "/etc/pki/katello/certs/katello-apache_e.crt"
  SSLCertificateKeyFile   "/etc/pki/katello/private/katello-apache_e.key"
  SSLCertificateChainFile "/etc/pki/katello/certs/katello-server-ca_e.crt"
  SSLVerifyClient         optional
  SSLCACertificateFile    "/etc/pki/katello/certs/katello-default-ca_e.crt"
  SSLVerifyDepth          3
  SSLOptions +StdEnvVars +ExportCertData
</VirtualHost>
""".strip()

HTTPD_CONF_WITHOUT_SSL = """
<VirtualHost *:80>
    ServerName a.b.c.com
</VirtualHost>
""".strip()

HTTPD_SSL_CONF_NO_VALUE = """
<VirtualHost *:443>
  ## SSL directives
  SSLEngine off
  SSLCertificateFile      ""
  SSLCertificateKeyFile   ""
  SSLCertificateChainFile ""
</VirtualHost>
""".strip()

NGINX_CONF = """
http {
    listen 80;
    listen 443;
    include /etc/nginx/conf.d/*.conf;
}
""".strip()

NGINX_SSL_CONF = """
server {
  ssl_certificate      "/a/b/c.rsa.crt";
  ssl_certificate_key   "/a/b/c.rsa.key";

  ssl_certificate     "/a/b/c.cecdsa.crt";
  ssl_certificate_key "/a/b/c.cecdsa.key";
}
""".strip()

NGINX_SSL_CONF_MULTIPLE_SERVERS = """
server {
    listen          443 ssl;
    server_name     www.example.com;
    ssl_certificate      "/a/b/www.example.com.crt";
    ssl_certificate_key   "/a/b/www.example.com.key";
    ssl_certificate     "/a/b/www.example.com.cecdsa.crt";
    ssl_certificate_key "/a/b/www.example.com.cecdsa.key";
}

server {
    listen          443 ssl;
    server_name     www.example.org;
    ssl_certificate      "/a/b/www.example.org.crt";
    ssl_certificate_key   "/a/b/www.example.org.key";
}
""".strip()

NGINX_CONF_WITHOUT_SSL = """
server {
  server_name 'a.b.c.com';
}
""".strip()

MSSQL_WITH_TLS = """
[sqlagent]
enabled = true
[EULA]
accepteula = Y
[memory]
memorylimitmb = 2048
[network]
tlscert = /tmp/mssql.pem
""".strip()

MSSQL_WITHOUT_TLS = """
[sqlagent]
enabled = true
[EULA]
accepteula = Y
[memory]
memorylimitmb = 2048
""".strip()

HTTPD_NSS_CERT_ENDATE = """
Not After : Mon Jan 18 07:02:43 2038
""".strip()

HTTPD_WITH_NSS = """
Listen 8443
<VirtualHost _default_:8443>
ServerName www.examplea.com:8443
NSSEngine on
NSSCertificateDatabase /etc/httpd/aliasa
NSSNickname testcerta
</VirtualHost>
<VirtualHost :8443>
ServerName www.exampleb.com:8443
NSSEngine on
NSSCertificateDatabase /etc/httpd/aliasb
NSSNickname testcertb
</VirtualHost>
<VirtualHost :8443>
ServerName www.examplec.com:8443
NSSEngine off
NSSCertificateDatabase /etc/httpd/aliasc
NSSNickname testcertc
</VirtualHost>
""".strip()

HTTPD_WITH_NSS_OFF = """
Listen 8443
<VirtualHost _default_:8443>
NSSEngine off
NSSCertificateDatabase /etc/httpd/alias
NSSNickname testcert
</VirtualHost>
""".strip()

def test_httpd_certificate():
    conf1 = HttpdConf(context_wrap(HTTPD_CONF, path='/etc/httpd/conf/httpd.conf'))
    conf2 = HttpdConf(context_wrap(HTTPD_SSL_CONF, path='/etc/httpd/conf.d/ssl.conf'))
    conf_tree = HttpdConfTree([conf1, conf2])

    broker = {
        HttpdConfTree: conf_tree
    }
    result = httpd_ssl_certificate_files(broker)
    assert result == ['/etc/pki/katello/certs/katello-apache.crt']

    conf1 = HttpdConf(context_wrap(HTTPD_CONF, path='/etc/httpd/conf/httpd.conf'))
    conf2 = HttpdConf(context_wrap(HTTPD_SSL_CONF_2, path='/etc/httpd/conf.d/ssl.conf'))
    conf_tree = HttpdConfTree([conf1, conf2])

    broker = {
        HttpdConfTree: conf_tree
    }
    result = httpd_ssl_certificate_files(broker)
    # "/etc/pki/katello/certs/katello-apache_e.crt" not in the result
    assert result == ['/etc/pki/katello/certs/katello-apache.crt', '/etc/pki/katello/certs/katello-apache_d.crt']

def test_nginx_certificate():
    conf1 = NginxConfPEG(context_wrap(NGINX_CONF, path='/etc/nginx/nginx.conf'))
    conf2 = NginxConfPEG(context_wrap(NGINX_SSL_CONF, path='/etc/nginx/conf.d/ssl.conf'))
    conf_tree = NginxConfTree([conf1, conf2])

    broker = {
        NginxConfTree: conf_tree
    }
    result = nginx_ssl_certificate_files(broker)
    assert result == ['/a/b/c.rsa.crt', '/a/b/c.cecdsa.crt']

    conf1 = NginxConfPEG(context_wrap(NGINX_CONF, path='/etc/nginx/nginx.conf'))
    conf2 = NginxConfPEG(context_wrap(NGINX_SSL_CONF_MULTIPLE_SERVERS, path='/etc/nginx/conf.d/ssl.conf'))
    conf_tree = NginxConfTree([conf1, conf2])

    broker = {
        NginxConfTree: conf_tree
    }
    result = nginx_ssl_certificate_files(broker)
    assert result == ['/a/b/www.example.com.crt', '/a/b/www.example.com.cecdsa.crt', '/a/b/www.example.org.crt']

def test_httpd_ssl_cert_exception():
    conf1 = HttpdConf(context_wrap(HTTPD_CONF, path='/etc/httpd/conf/httpd.conf'))
    conf2 = HttpdConf(context_wrap(HTTPD_CONF_WITHOUT_SSL, path='/etc/httpd/conf.d/no_ssl.conf'))
    conf_tree = HttpdConfTree([conf1, conf2])
    broker1 = {
        HttpdConfTree: conf_tree
    }
    conf1 = HttpdConf(context_wrap(HTTPD_CONF, path='/etc/httpd/conf/httpd.conf'))
    conf2 = HttpdConf(context_wrap(HTTPD_SSL_CONF_NO_VALUE, path='/etc/httpd/conf.d/no_ssl.conf'))
    conf_tree = HttpdConfTree([conf1, conf2])
    broker2 = {
        HttpdConfTree: conf_tree
    }
    with pytest.raises(SkipComponent):
        httpd_ssl_certificate_files(broker1)
        httpd_ssl_certificate_files(broker2)

def test_nginx_ssl_cert_exception():
    conf1 = NginxConfPEG(context_wrap(NGINX_CONF, path='/etc/nginx/nginx.conf'))
    conf2 = NginxConfPEG(context_wrap(NGINX_CONF_WITHOUT_SSL, path='/etc/nginx/conf.d/no_ssl.conf'))
    conf_tree = NginxConfTree([conf1, conf2])
    broker1 = {
        NginxConfTree: conf_tree
    }
    with pytest.raises(SkipComponent):
        nginx_ssl_certificate_files(broker1)

def test_mssql_tls_cert_exception():
    conf1 = MsSQLConf(context_wrap(MSSQL_WITH_TLS, path='/var/opt/mssql/mssql.conf'))
    broker1 = {
        MsSQLConf: conf1
    }
    result = mssql_tls_cert_file(broker1)
    assert result == "/tmp/mssql.pem"

def test_mssql_tls_no_cert_exception():
    conf1 = MsSQLConf(context_wrap(MSSQL_WITHOUT_TLS, path='/var/opt/mssql/mssql.conf'))
    broker1 = {
        MsSQLConf: conf1
    }
    with pytest.raises(SkipComponent):
        mssql_tls_cert_file(broker1)

def test_httpd_certificate_info_in_nss():
    conf1 = HttpdConf(context_wrap(HTTPD_CONF, path='/etc/httpd/conf/httpd.conf'))
    conf2 = HttpdConf(context_wrap(HTTPD_WITH_NSS, path='/etc/httpd/conf.d/nss.conf'))
    conf_tree = HttpdConfTree([conf1, conf2])
    broker = {
        HttpdConfTree: conf_tree
    }
    result = httpd_certificate_info_in_nss(broker)
    assert result == [('/etc/httpd/aliasa', 'testcerta'), ('/etc/httpd/aliasb', 'testcertb')]

def test_httpd_certificate_info_in_nss_exception():
    conf1 = HttpdConf(context_wrap(HTTPD_CONF, path='/etc/httpd/conf/httpd.conf'))
    conf2 = HttpdConf(context_wrap(HTTPD_WITH_NSS_OFF, path='/etc/httpd/conf.d/nss.conf'))
    conf_tree = HttpdConfTree([conf1, conf2])
    broker = {
        HttpdConfTree: conf_tree
    }
    with pytest.raises(SkipComponent):
        httpd_certificate_info_in_nss(broker)


text:
package github

import (
	"fmt"
	"os"
)

func vprintln(a ...interface{}) (int, error) {
	if VERBOSITY > 0 {
		return fmt.Fprintln(os.Stderr, a...)
	}

	return 0, nil
}

func vprintf(format string, a ...interface{}) (int, error) {
	if VERBOSITY > 0 {
		return fmt.Fprintf(os.Stderr, format, a...)
	}

	return 0, nil
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:padding="5dp">

    <ImageView
        android:id="@+id/img_footer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:src="@mipmap/ic_launcher" />

    <TextView
        android:id="@+id/title_footer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/img_footer"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="2dp"
        android:text="@string/test"
        android:textColor="@color/colorTabTextNormal" />
</RelativeLayout>


text:
<!DOCTYPE html>

	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Month view</title>

<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css" type="text/css" media="screen" title="no title" charset="utf-8">


text:
from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0003_auto_20171111_1733'),
    ]

    operations = [
        migrations.CreateModel(
            name='ArticleRate',
            fields=[
                ('article', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='article_rate', serialize=False, to='blog.Article', verbose_name='Ratio articulo')),
                ('positives', models.PositiveIntegerField(default=0)),
            ],
        ),
    ]


text:
namespace DbShell.Driver.Common.Structure
{
    public interface IFullNamedObject
    {
        NameWithSchema FullName { get; }
    }
}


text:
@interface CZHeadBtnView : UIScrollView

-(instancetype)initHeadBtnShuLiangName:(NSArray *)textArr;

@end


text:
"""
Common functions and regex expressions for github
"""

import re

GITHUB_REGEX = re.compile(
    r'^(https://github.com/|\w+@github\.com:)(?P<repository>[a-zA-Z0-9_\-]+/[a-zA-Z0-9_\-]+)\.git$')
GITHUB_ISSUE_REGEX = re.compile(r'^(([a-zA-Z0-9_\-]*|[a-zA-Z0-9_\-]+/[a-zA-Z0-9_\-]+)#|GH-)(?P<issue>\d+)$')

def extract_repository_from_url(git_url):
    """

    :param git_url:
    :return:
    :rtype: str | None

    >>> extract_repository_from_url('https://github.com/jmcs/turnstile.git')
    'jmcs/turnstile'
    >>> extract_repository_from_url('git@github.com:jmcs/senza.git')
    'jmcs/senza'
    >>> extract_repository_from_url('git@bitbucket.org:jmcs/somerepo.git') is None
    True
    """

    match = GITHUB_REGEX.match(git_url)
    if match:
        return match.group('repository')
    else:
        return None

def extract_issue_number(github_reference):
    """
    Extracts the issue number from the github reference

    :param github_reference:
    :type github_reference: str
    :return:
    :rtype: int | None

    >>> extract_issue_number('#42')
    42
    >>> extract_issue_number('GH-24')
    24
    >>> extract_issue_number('jmcs#26')
    26
    >>> extract_issue_number('jmcs/turnstile#36')
    36
    >>> extract_issue_number('JIRA-1000') is None
    True
    """

    match = GITHUB_ISSUE_REGEX.match(github_reference)
    if match:
        return int(match.group('issue'))
    else:
        return None


text:
<!DOCTYPE html>

    <title>Absence | Lyrics of the Hearthside | Paul Laurence Dunbar | Lit2Go ETC</title>
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/screenless.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/printless.css" type="text/css" media="print" title="no title" charset="utf-8">

          Lit2Go

<form action="http://etc.usf.edu/lit2go/search/"><input type="text" name="q" placeholder="Search" value=""></form>

Authors

Books

Genres

Collections

Readability

      Lyrics of the Hearthside

      by Paul Laurence Dunbar

      Absence

        Additional Information

            Year Published:
            1913

            Language:
            English

            Country of Origin:
            United States of America

            Source:
            Dunbar, P.L. (1913). The Complete Poems of Paul Laurence Dunbar. New York: Dodd, Mead, and Company.

            Readability:

                Flesch–Kincaid Level:
                6.5

            Word Count:
            249

            Genre:
            Poetry

            Keywords:
            bird, dreams, hope, life

            ✎ Cite This

  Share
  |

Downloads

          Audio

          Passage PDF

Student Activity

            APA

            MLA

            Chicago

            Dunbar, P. (1913). Absence. Lyrics of the Hearthside (Lit2Go Edition). Retrieved February 15, 2016, from http://etc.usf.edu/lit2go/190/lyrics-of-the-hearthside/3950/absence/

            Dunbar, Paul Laurence. "Absence." Lyrics of the Hearthside. Lit2Go Edition. 1913. Web. <http://etc.usf.edu/lit2go/190/lyrics-of-the-hearthside/3950/absence/>. February 15, 2016.

            Paul Laurence Dunbar, "Absence," Lyrics of the Hearthside, Lit2Go Edition, (1913), accessed February 15, 2016, http://etc.usf.edu/lit2go/190/lyrics-of-the-hearthside/3950/absence/.

Back

Next

                  <audio controls style="width:99%;">
            <source src="http://etc.usf.edu/lit2go/audio/mp3/lyrics-of-the-hearthside-009-absence.3950.mp3" type="audio/mpeg" />
                          <source src="http://etc.usf.edu/lit2go/audio/ogg/lyrics-of-the-hearthside-009-absence.3950.ogg" type="audio/ogg" />
                        The embedded audio player requires a modern internet browser. You should visit Browse Happy and update your internet browser today!
          </audio>

	Good–night, my love, for I have dreamed of thee

	In waking dreams, until my soul is lost—

	Is lost in passion’s wide and shoreless sea,

	Where, like a ship, unruddered, it is tost

	Hither and thither at the wild waves’ will.

	There is no potent Master’s voice to still

	This newer, more tempestuous Galilee!

	The stormy petrels of my fancy fly

	In warning course across the darkening green,

	And, like a frightened bird, my heart doth cry

	And seek to find some rock of rest between

	The threatening sky and the relentless wave.

	It is not length of life that grief doth crave,

	But only calm and peace in which to die.

	Here let me rest upon this single hope,

	For oh, my wings are weary of the wind,

	And with its stress no more may strive or cope.

	One cry has dulled mine ears, mine eyes are blind,—

	Would that o’er all the intervening space,

	I might fly forth and see thee face to face.

	I fly; I search, but, love, in gloom I grope.

	Fly home, far bird, unto thy waiting nest;

	Spread thy strong wings above the wind–swept sea.

	Beat the grim breeze with thy unruffled breast

	Until thou sittest wing to wing with me.

	Then, let the past bring up its tales of wrong;

	We shall chant low our sweet connubial song,

	Till storm and doubt and past no more shall be!

Back

Next

            This collection of children's literature is a part of the Educational Technology Clearinghouse and is funded by various grants.

            Copyright © 2006—2016 by the Florida Center for Instructional Technology, College of Education, University of South Florida.

License

Credits

FAQ

Giving

This document was downloaded from Lit2Go, a free online collection of stories and poems in Mp3 (audiobook) format published by the Florida Center for Instructional Technology. For more information, including classroom activities, readability data, and original sources, please visit http://etc.usf.edu/lit2go/190/lyrics-of-the-hearthside/3950/absence/.

Lit2Go: Lyrics of the Hearthside

Absence


text:
.ag-basic .ag-cell {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

label {
    font-weight: normal !important;
}

.div-percent-bar {
    display: inline-block;
    height: 100%;
    position: relative;
}

.div-percent-value {
    position: absolute;
    z-index: 1;
    padding-left: 4px;
    font-weight: bold;
    font-size: 13px;
}

.div-outer-div {
    display: inline-block;
    height: 100%;
    width: 100%;
}


text:
package com.zvoykish.zevo.framework.operators.selection;

import com.zvoykish.zevo.framework.EvoConfiguration;
import com.zvoykish.zevo.framework.EvoFunctions;
import com.zvoykish.zevo.framework.entities.Generation;
import com.zvoykish.zevo.framework.entities.Individual;
import com.zvoykish.zevo.framework.operators.Selection;
import com.zvoykish.zevo.model.FitnessCalculator;
import com.zvoykish.zevo.utils.Randomizer;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Zvika
 * Date: 03/05/2010
 * Time: 02:00:22
 */
@SuppressWarnings({"UnusedDeclaration"})
public class FittestSelection extends Selection {

    private Generation lastGeneration;
    private double[] lastDistributions;

    public FittestSelection(EvoConfiguration configuration, EvoFunctions functions) {
        super(configuration, functions);
        lastGeneration = null;
        lastDistributions = null;
    }

    @Override
    public List<Individual> getTwoCandidates(Generation generation) {
        List<Individual> result = new ArrayList<>();
        List<Individual> individuals = generation.getIndividuals();
        double[] distributions;
        if (lastGeneration == generation) {
            distributions = lastDistributions;
        }
        else {
            FitnessCalculator fitnessCalculator = functions.getFitnessCalculator();
            distributions = new double[individuals.size()];
            for (int i = 0; i < individuals.size(); i++) {
                distributions[i] = fitnessCalculator.getFitness(individuals.get(i), generation);
            }

            lastGeneration = generation;
            lastDistributions = distributions;
        }

        int randomIndex1 = Randomizer.getRandomIndexForDistribution(distributions);
        if (randomIndex1 == -1) {
            randomIndex1 = 0;
        }
        result.add(individuals.get(randomIndex1));

        int randomIndex2 = Randomizer.getRandomIndexForDistribution(distributions);
        if (randomIndex2 == -1) {
            randomIndex2 = (randomIndex1 != 1) ? 1 : 2;
        }
        result.add(individuals.get(randomIndex2));

        return result;
    }
}


text:
package hudson.model;

import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebResponse;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import net.sf.json.JSONObject;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.TestExtension;
import org.kohsuke.stapler.export.ExportedBean;
import org.xml.sax.SAXException;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;

import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/**
 * @author Kohsuke Kawaguchi
 */
public class ApiTest {

    @Rule
    public JenkinsRule j = new JenkinsRule();

    @Test
    @Issue("JENKINS-2828")
    public void xpath() throws Exception {
        j.createWebClient().goTo("api/xml?xpath=/*[1]", "application/xml");
    }

    @Issue("JENKINS-27607")
    @Test public void json() throws Exception {
        FreeStyleProject p = j.createFreeStyleProject("p");
        JenkinsRule.WebClient wc = j.createWebClient();
        WebResponse response = wc.goTo(p.getUrl() + "api/json?tree=name", "application/json").getWebResponse();
        JSONObject json = JSONObject.fromObject(response.getContentAsString());
        assertEquals("p", json.get("name"));

        String s = wc.goTo(p.getUrl() + "api/json?tree=name&jsonp=wrap", "application/javascript").getWebResponse().getContentAsString();
        assertTrue(s.startsWith("wrap("));
        assertEquals(')', s.charAt(s.length()-1));
        json = JSONObject.fromObject(s.substring("wrap(".length(), s.length() - 1));
        assertEquals("p", json.get("name"));
    }

    @Test
    @Issue("JENKINS-3267")
    public void wrappedZeroItems() throws Exception {
        Page page = j.createWebClient().goTo("api/xml?wrapper=root&xpath=/hudson/nonexistent", "application/xml");
        assertEquals("<root/>", page.getWebResponse().getContentAsString());
    }

    /**
     * Test that calling the XML API with the XPath {@code document} function fails.
     *
     * @throws Exception if so
     */
    @Issue("SECURITY-165")
    @Test public void xPathDocumentFunction() throws Exception {
        File f = new File(j.jenkins.getRootDir(), "queue.xml");
        JenkinsRule.WebClient wc = j.createWebClient()
                .withThrowExceptionOnFailingStatusCode(false);

        // could expect application/xml but as an error occurred it's a text/html that is returned
        Page page = wc.goTo("api/xml?xpath=document(\"" + f.getAbsolutePath() + "\")", null);
        assertEquals(HttpURLConnection.HTTP_INTERNAL_ERROR, page.getWebResponse().getStatusCode());
        assertThat(page.getWebResponse().getContentAsString(), containsString("Illegal function: document"));
    }

    @Test
    @Issue("JENKINS-3267")
    public void wrappedOneItem() throws Exception {
        Page page = j.createWebClient().goTo("api/xml?wrapper=root&xpath=/hudson/view/name", "application/xml");
        assertEquals("<root><name>"+ AllView.DEFAULT_VIEW_NAME+"</name></root>", page.getWebResponse().getContentAsString());
    }

    @Test
    public void wrappedMultipleItems() throws Exception {
        j.createFreeStyleProject();
        j.createFreeStyleProject();
        Page page = j.createWebClient().goTo("api/xml?wrapper=root&xpath=/hudson/job/name", "application/xml");
        assertEquals("<root><name>test0</name><name>test1</name></root>", page.getWebResponse().getContentAsString());
    }

    @Test
    public void unwrappedZeroItems() throws Exception {
        j.createWebClient().assertFails("api/xml?xpath=/hudson/nonexistent", HttpURLConnection.HTTP_NOT_FOUND);
    }

    @Test
    public void unwrappedOneItem() throws Exception {
        Page page = j.createWebClient().goTo("api/xml?xpath=/hudson/view/name", "application/xml");
        assertEquals("<name>"+ AllView.DEFAULT_VIEW_NAME+"</name>", page.getWebResponse().getContentAsString());
    }

    @Test
    public void unwrappedLongString() throws Exception {
        j.jenkins.setSystemMessage("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.");
        Page page = j.createWebClient().goTo("api/xml?xpath=/hudson/description", "application/xml");
        assertEquals(
                "<description>"+j.jenkins.getSystemMessage()+"</description>",
                page.getWebResponse().getContentAsString());
    }

    @Test
    public void unwrappedMultipleItems() throws Exception {
        j.createFreeStyleProject();
        j.createFreeStyleProject();
        j.createWebClient().assertFails("api/xml?xpath=/hudson/job/name", HttpURLConnection.HTTP_INTERNAL_ERROR);
    }

    @Issue("JENKINS-22566")
    @Test
    public void parameter() throws Exception {
        FreeStyleProject p = j.createFreeStyleProject("p");
        p.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("foo", "")));
        j.assertBuildStatusSuccess(p.scheduleBuild2(0, new ParametersAction(new StringParameterValue("foo", "bar"))));

        Page page = j.createWebClient().goTo(
                p.getUrl() + "api/xml?tree=builds[actions[parameters[name,value]]]&xpath=freeStyleProject/build/action/parameter",
                "application/xml");
        assertEquals(
                "<parameter _class=\"hudson.model.StringParameterValue\"><name>foo</name><value>bar</value></parameter>",
                page.getWebResponse().getContentAsString());
    }

    @Issue("JENKINS-22566")
    @Ignore("TODO currently fails with: org.dom4j.DocumentException: Error on line 1 of document  : An invalid XML character (Unicode: 0x1b) was found in the element content of the document")
    @Test
    public void escapedParameter() throws Exception {
        FreeStyleProject p = j.createFreeStyleProject("p");
        p.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("foo", "")));
        j.assertBuildStatusSuccess(p.scheduleBuild2(0, new ParametersAction(new StringParameterValue("foo", "bar\u001B"))));

        Page page = j.createWebClient().goTo(
                p.getUrl() + "api/xml?tree=builds[actions[parameters[name,value]]]&xpath=freeStyleProject/build/action/parameter",
                "application/xml");
        assertEquals(
                "<parameter _class=\"hudson.model.StringParameterValue\"><name>foo</name><value>bar</value></parameter>",
                page.getWebResponse().getContentAsString());
    }

    @Test
    @Issue("SECURITY-1704")
    public void project_notExposedToIFrame() throws Exception {
        FreeStyleProject p = j.createFreeStyleProject("p");
        ensureXmlIsNotExposedToIFrame(p.getUrl());
        ensureJsonIsNotExposedToIFrame(p.getUrl());
        ensurePythonIsNotExposedToIFrame(p.getUrl());
    }

    @Test
    @Issue("SECURITY-1704")
    public void custom_notExposedToIFrame() throws Exception {
        ensureXmlIsNotExposedToIFrame("custom/");
        ensureJsonIsNotExposedToIFrame("custom/");
        ensurePythonIsNotExposedToIFrame("custom/");
    }

    /**
     * Test the wrapper parameter for the api/xml urls to avoid XSS.
     * @throws Exception See {@link #checkWrapperParam(String, Integer, String)}
     */
    @Issue("SECURITY-1129")
    @Test
    public void wrapperXss() throws Exception {
        String wrapper = "html%20xmlns=\"http://www.w3.org/1999/xhtml\"><script>alert(%27XSS%20Detected%27)</script></html><!--";

        checkWrapperParam(wrapper, HttpServletResponse.SC_BAD_REQUEST, Messages.Api_WrapperParamInvalid());
    }

    /**
     * Test the wrapper parameter for the api/xml urls with a bad name.
     * @throws Exception See {@link #checkWrapperParam(String, Integer, String)}
     */
    @Issue("SECURITY-1129")
    @Test
    public void wrapperBadName() throws Exception {
        String wrapper = "-badname";
        checkWrapperParam(wrapper, HttpServletResponse.SC_BAD_REQUEST, Messages.Api_WrapperParamInvalid());

    }

    /**
     * Test the wrapper parameter with a good name, to ensure the security fix doesn't break anything.
     * @throws Exception See {@link #checkWrapperParam(String, Integer, String)}
     */
    @Issue("SECURITY-1129")
    @Test
    public void wrapperGoodName() throws Exception {
        String wrapper = "__GoodName-..-OK";
        checkWrapperParam(wrapper, HttpServletResponse.SC_OK, null);

    }

    /**
     * Check the response for a XML api with the wrapper param specified. At least the statusCode or the responseMessage
     * should be indicated.
     * @param wrapper the wrapper param passed in the url.
     * @param statusCode the status code expected in the response. If it's null, it's not checked.
     * @param responseMessage the message expected in the response. If it's null, it's not checked.
     * @throws IOException See {@link org.jvnet.hudson.test.JenkinsRule.WebClient#goTo(String, String)}
     * @throws SAXException See {@link org.jvnet.hudson.test.JenkinsRule.WebClient#goTo(String, String)}
     */
    private void checkWrapperParam(String wrapper, Integer statusCode, String responseMessage) throws IOException, SAXException {
        if (statusCode == null && responseMessage == null) {
            fail("You should check at least one, the statusCode or the responseMessage when testing the wrapper param");
        }

        JenkinsRule.WebClient wc = j.createWebClient();
        wc.getOptions().setThrowExceptionOnFailingStatusCode(false);
        WebResponse response = wc.goTo(String.format("whoAmI/api/xml?xpath=*&wrapper=%s", wrapper), null).getWebResponse();

        if (response != null) {
            if (statusCode != null) {
                assertEquals(statusCode.intValue(), response.getStatusCode());
            }
            if (responseMessage != null) {
                assertEquals(responseMessage, response.getContentAsString());
            }
        } else {
            fail("The response shouldn't be null");
        }
    }

    private void ensureXmlIsNotExposedToIFrame(String itemUrl) throws Exception {
        WebResponse response = j.createWebClient().goTo(itemUrl + "api/xml", "application/xml").getWebResponse();
        assertThat(response.getResponseHeaderValue("X-Frame-Options"), equalTo("deny"));
    }

    private void ensureJsonIsNotExposedToIFrame(String itemUrl) throws Exception {
        WebResponse response = j.createWebClient().goTo(itemUrl + "api/json", "application/json").getWebResponse();
        assertThat(response.getResponseHeaderValue("X-Frame-Options"), equalTo("deny"));
    }

    private void ensurePythonIsNotExposedToIFrame(String itemUrl) throws Exception {
        WebResponse response = j.createWebClient().goTo(itemUrl + "api/python", "text/x-python").getWebResponse();
        assertThat(response.getResponseHeaderValue("X-Frame-Options"), equalTo("deny"));
    }

    @TestExtension("custom_notExposedToIFrame")
    public static class CustomObject implements RootAction {
        @Override
        public @CheckForNull
        String getIconFileName() {
            return null;
        }

        @Override
        public @CheckForNull String getDisplayName() {
            return null;
        }

        @Override
        public @CheckForNull String getUrlName() {
            return "custom";
        }

        public Api getApi() {
            return new Api(new CustomData("s3cr3t"));
        }

        @ExportedBean
        static class CustomData {
            private String secret;
            CustomData(String secret){
                this.secret = secret;
            }
        }
    }
}


text:
{% if site.google-tracking-id %}

{% endif %}

{% if site.disqus-shortname %}

  {% if page.section-type == "post" %}

  {% endif %}

  {% if page.section-type == "post" or page.section-type == "blog" or page.section-type == "index" or page.section-type == "tag" %}

  {% endif %}

{% endif %}

{% if page.section-type == "post" %}

{% endif %}

{% if site.dynamic-typing and page.section-type == "index"%}

{% endif %}

{% if page.section-type == "post" %}

{% endif %}

{% if page.section-type == "index" %}

    <link rel="stylesheet" href="/css/instafeed.css">
{% endif %}


text:
// Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management.Automation;

namespace Microsoft.PowerShell.Commands.Utility
{
    public abstract class ConsoleColorCmdlet : PSCmdlet
    {
        [ParameterAttribute]
        public ConsoleColor BackgroundColor { get; set; }

        [ParameterAttribute]
        public ConsoleColor ForegroundColor { get; set; }

        public ConsoleColorCmdlet()
        {
            this.BackgroundColor = Console.BackgroundColor;
            this.ForegroundColor = Console.ForegroundColor;
        }
    }
}


text:
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.contrib.auth.decorators import login_required
from django.template import RequestContext
from django.http import Http404
import logging
import json
import subprocess
import time
from RoombaSCI import RoombaAPI
from roomba import AsciiRoomba
logger = logging.getLogger('app')

RFCOMM_DEV="/dev/ttyUSB0"
#RFCOMM_DEV="/dev/tty.usbserial-FTG661LW"
RFCOMM_BAUDRATE=115200
incrementer = 0
roomba = 0

@login_required
def index(request):
    return render_to_response('controlcenter/index.html', context_instance=RequestContext(request))

def takePicture():
    logger.debug("IN The take Picture function")
    process = subprocess.Popen(["/bin/bash", "/srv/RoombaCatStalker/takePicture.sh"],stdout=subprocess.PIPE)
    process.wait()
    return process.returncode

def moveDelay():
    time.sleep(.70);
    roomba.stop();

def controlAction(request):
    logger.debug("Got Request /n \n")
    global incrementer, roomba
    incrementer += 1
    logger.debug(request.POST)
    if request.method == "POST":
        logger.debug("Speed is "+str(request.POST.getlist('speed')[0]))
        roomba.full()
        roomba.speed = int(request.POST.getlist('speed')[0])
	if 'left' in request.POST:
            roomba.left()
	    moveDelay()
            logger.debug("Move Left")
        elif 'right' in request.POST:
            roomba.right()
	    moveDelay()
            logger.debug("Move Right")
        elif 'forward' in request.POST:
            roomba.forward()
	    moveDelay()
            logger.debug("Move forward")
        elif 'backward' in request.POST:
            roomba.backward()
 	    moveDelay()
            logger.debug("Move backward")
        elif 'stop' in request.POST:
            roomba.stop()
            logger.debug("Move stop")
        elif 'disconnect' in request.POST:
	    roomba.off()
    elif request.method == "GET":
        if 'getSensors' in request.GET:
            logger.debug("Received Get Sensors Call")
            sensors = roomba.sensors
            jsonObject = {"bumps":{"left":sensors.bumps.left,"right":sensors.bumps.right},"cliff": {"front_left":sensors.cliff.front_left,"front_right":sensors.cliff.front_right,"left":sensors.cliff.left,"right":sensors.cliff.right}, "wheel_drops": {"castor":sensors.wheel_drops.castor,"left":sensors.wheel_drops.left,"right":sensors.wheel_drops.right},"voltage": sensors.voltage, "wall": sensors.wall}
            return HttpResponse(json.dumps(jsonObject), mimetype='application/json')
        elif 'connect' in request.GET:
            roomba = RoombaAPI(RFCOMM_DEV, RFCOMM_BAUDRATE);
            logger.debug("Started First Connect")
            roomba.connect()
            logger.debug("Received GetSensors Call")

            return HttpResponse(json.dumps(roomba.port.isOpen()), mimetype='application/json')
        elif 'takePicture' in request.GET:
            success = takePicture()
            return HttpResponse(json.dumps(success), mimetype='application/json')
        return Http404
    else:
        logger.debug("Not a Post or get Request")
    return render_to_response('controlcenter/index.html', context_instance=RequestContext(request))


text:
using System;
using System.Globalization;
using System.Text;
using DiscUtils.Streams;

namespace DiscUtils.Registry
{
    /// <summary>
    /// A registry value.
    /// </summary>
    internal sealed class RegistryValue
    {
        private readonly ValueCell _cell;
        private readonly RegistryHive _hive;

        internal RegistryValue(RegistryHive hive, ValueCell cell)
        {
            _hive = hive;
            _cell = cell;
        }

        /// <summary>
        /// Gets the type of the value.
        /// </summary>
        public RegistryValueType DataType
        {
            get { return _cell.DataType; }
        }

        /// <summary>
        /// Gets the name of the value, or empty string if unnamed.
        /// </summary>
        public string Name
        {
            get { return _cell.Name ?? string.Empty; }
        }

        /// <summary>
        /// Gets the value data mapped to a .net object.
        /// </summary>
        /// <remarks>The mapping from registry type of .NET type is as follows:
        /// <list type="table">
        ///   <listheader>
        ///     <term>Value Type</term>
        ///     <term>.NET type</term>
        ///   </listheader>
        ///   <item>
        ///     <description>String</description>
        ///     <description>string</description>
        ///   </item>
        ///   <item>
        ///     <description>ExpandString</description>
        ///     <description>string</description>
        ///   </item>
        ///   <item>
        ///     <description>Link</description>
        ///     <description>string</description>
        ///   </item>
        ///   <item>
        ///     <description>DWord</description>
        ///     <description>uint</description>
        ///   </item>
        ///   <item>
        ///     <description>DWordBigEndian</description>
        ///     <description>uint</description>
        ///   </item>
        ///   <item>
        ///     <description>MultiString</description>
        ///     <description>string[]</description>
        ///   </item>
        ///   <item>
        ///     <description>QWord</description>
        ///     <description>ulong</description>
        ///   </item>
        /// </list>
        /// </remarks>
        public object Value
        {
            get { return ConvertToObject(GetData(), DataType); }
        }

        /// <summary>
        /// The raw value data as a byte array.
        /// </summary>
        /// <returns>The value as a raw byte array.</returns>
        public byte[] GetData()
        {
            if (_cell.DataLength < 0)
            {
                int len = _cell.DataLength & 0x7FFFFFFF;
                byte[] buffer = new byte[4];
                EndianUtilities.WriteBytesLittleEndian(_cell.DataIndex, buffer, 0);

                byte[] result = new byte[len];
                Array.Copy(buffer, result, len);
                return result;
            }

            return _hive.RawCellData(_cell.DataIndex, _cell.DataLength);
        }

        /// <summary>
        /// Sets the value as raw bytes, with no validation that enough data is specified for the given value type.
        /// </summary>
        /// <param name="data">The data to store.</param>
        /// <param name="offset">The offset within <c>data</c> of the first byte to store.</param>
        /// <param name="count">The number of bytes to store.</param>
        /// <param name="valueType">The type of the data.</param>
        public void SetData(byte[] data, int offset, int count, RegistryValueType valueType)
        {
            // If we can place the data in the DataIndex field, do that to save space / allocation
            if ((valueType == RegistryValueType.Dword || valueType == RegistryValueType.DwordBigEndian) && count <= 4)
            {
                if (_cell.DataLength >= 0)
                {
                    _hive.FreeCell(_cell.DataIndex);
                }

                _cell.DataLength = (int)((uint)count | 0x80000000);
                _cell.DataIndex = EndianUtilities.ToInt32LittleEndian(data, offset);
                _cell.DataType = valueType;
            }
            else
            {
                if (_cell.DataIndex == -1 || _cell.DataLength < 0)
                {
                    _cell.DataIndex = _hive.AllocateRawCell(count);
                }

                if (!_hive.WriteRawCellData(_cell.DataIndex, data, offset, count))
                {
                    int newDataIndex = _hive.AllocateRawCell(count);
                    _hive.WriteRawCellData(newDataIndex, data, offset, count);
                    _hive.FreeCell(_cell.DataIndex);
                    _cell.DataIndex = newDataIndex;
                }

                _cell.DataLength = count;
                _cell.DataType = valueType;
            }

            _hive.UpdateCell(_cell, false);
        }

        /// <summary>
        /// Sets the value stored.
        /// </summary>
        /// <param name="value">The value to store.</param>
        /// <param name="valueType">The registry type of the data.</param>
        public void SetValue(object value, RegistryValueType valueType)
        {
            if (valueType == RegistryValueType.None)
            {
                if (value is int)
                {
                    valueType = RegistryValueType.Dword;
                }
                else if (value is byte[])
                {
                    valueType = RegistryValueType.Binary;
                }
                else if (value is string[])
                {
                    valueType = RegistryValueType.MultiString;
                }
                else
                {
                    valueType = RegistryValueType.String;
                }
            }

            byte[] data = ConvertToData(value, valueType);
            SetData(data, 0, data.Length, valueType);
        }

        /// <summary>
        /// Gets a string representation of the registry value.
        /// </summary>
        /// <returns>The registry value as a string.</returns>
        public override string ToString()
        {
            return Name + ":" + DataType + ":" + DataAsString();
        }

        private static object ConvertToObject(byte[] data, RegistryValueType type)
        {
            switch (type)
            {
                case RegistryValueType.String:
                case RegistryValueType.ExpandString:
                case RegistryValueType.Link:
                    return Encoding.Unicode.GetString(data).Trim('\0');

                case RegistryValueType.Dword:
                    return EndianUtilities.ToInt32LittleEndian(data, 0);

                case RegistryValueType.DwordBigEndian:
                    return EndianUtilities.ToInt32BigEndian(data, 0);

                case RegistryValueType.MultiString:
                    string multiString = Encoding.Unicode.GetString(data).Trim('\0');
                    return multiString.Split('\0');

                case RegistryValueType.QWord:
                    return string.Empty + EndianUtilities.ToUInt64LittleEndian(data, 0);

                default:
                    return data;
            }
        }

        private static byte[] ConvertToData(object value, RegistryValueType valueType)
        {
            if (valueType == RegistryValueType.None)
            {
                throw new ArgumentException("Specific registry value type must be specified", nameof(valueType));
            }

            byte[] data;
            switch (valueType)
            {
                case RegistryValueType.String:
                case RegistryValueType.ExpandString:
                    string strValue = value.ToString();
                    data = new byte[strValue.Length * 2 + 2];
                    Encoding.Unicode.GetBytes(strValue, 0, strValue.Length, data, 0);
                    break;

                case RegistryValueType.Dword:
                    data = new byte[4];
                    EndianUtilities.WriteBytesLittleEndian((int)value, data, 0);
                    break;

                case RegistryValueType.DwordBigEndian:
                    data = new byte[4];
                    EndianUtilities.WriteBytesBigEndian((int)value, data, 0);
                    break;

                case RegistryValueType.MultiString:
                    string multiStrValue = string.Join("\0", (string[])value) + "\0";
                    data = new byte[multiStrValue.Length * 2 + 2];
                    Encoding.Unicode.GetBytes(multiStrValue, 0, multiStrValue.Length, data, 0);
                    break;

                default:
                    data = (byte[])value;
                    break;
            }

            return data;
        }

        private string DataAsString()
        {
            switch (DataType)
            {
                case RegistryValueType.String:
                case RegistryValueType.ExpandString:
                case RegistryValueType.Link:
                case RegistryValueType.Dword:
                case RegistryValueType.DwordBigEndian:
                case RegistryValueType.QWord:
                    return ConvertToObject(GetData(), DataType).ToString();

                case RegistryValueType.MultiString:
                    return string.Join(",", (string[])ConvertToObject(GetData(), DataType));

                default:
                    byte[] data = GetData();
                    string result = string.Empty;
                    for (int i = 0; i < Math.Min(data.Length, 8); ++i)
                    {
                        result += string.Format(CultureInfo.InvariantCulture, "{0:X2} ", (int)data[i]);
                    }

                    return result + string.Format(CultureInfo.InvariantCulture, " ({0} bytes)", data.Length);
            }
        }
    }
}


text:
 Page Heading
            Secondary Text

Thumbnail label

This is a template for a simple marketing or informational website. It includes a large callout
                    called a jumbotron and three supporting pieces of content. Use it as a starting point to create
                    something more unique.

Read more

Thumbnail label

This is a template for a simple marketing or informational website. It includes a large callout
                    called a jumbotron and three supporting pieces of content. Use it as a starting point to create
                    something more unique.

Read more

Thumbnail label

This is a template for a simple marketing or informational website. It includes a large callout
                    called a jumbotron and three supporting pieces of content. Use it as a starting point to create
                    something more unique.

Read more

                        «

1

2

3

4

5

                        »


text:
var YUMMY2 = "griddles_yummy2_a";
var MAINKEY = "ごちそう";
var TAGMANAGE = "タグを管理";
var griddles_apis = {};
var yummy2 = {};

//
// クエリリストをつくる
//
function creatingKeyList(data, id) {
  document.getElementById(id).innerHTML = '<paper-item label="すべてのごちそう" class="menu_item" id="btn_all_gochiso" data-label="ごちそう"></paper-item>';
  var tags = [];
  var str_tags = "," + tags.toString() + ",";
    if(data != undefined) {
        for(var j = 0; j < data.length; j++) {
          if(j > 0) {
                var yss = data[j].tags.ys;
                for(var i = 0; i < yss.length; i++) {
                    var rg = new RegExp("," + yss[i] + ",", "gi");
                    var res = str_tags.search(rg);
                    if(res == -1 && yss[i] != MAINKEY) {
                      tags.push(yss[i]);
                      str_tags = str_tags + yss[i] + ",";
                    }
                }
          }
        }
        var template = '<paper-item label="{L}" class="menu_item" data-label="{DL}"></paper-item>';
        var html = "";
        var max = tags.length;
        if(tags.length > 10) {
          max = 10;
        }
        for(var j = 0; j < max; j++) {
            var html = html + griddles_apis.make(template, {L: tags[j], DL: tags[j]});
        }
        if(tags.length > 10) {
          html = html + "<hr>" + griddles_apis.make(template, {L: TAGMANAGE, DL: TAGMANAGE});
        }
        $($("#"+id)).append(html);

        return tags;
    }
}

//
// クエリに対応するカードを表示する
//
function miils() {
  var g = document.querySelector("griddles-ui-card");
  appStorage({"key": YUMMY2}, "get", function(e, keys) {
    var imageList = []; // ランダム表示するヘッダ画像の候補
    var query = yummy2.query;
    var rg = new RegExp("," + query + ",", "gi");
    var key = keys[0];
    var smpls = e[key];
    for(var i = 0; i < smpls.length; i++) {
       if(i > 0) {
          var obj = smpls[i];
          var tags = smpls[i].tags.ys;
          var str_tags = "," + tags.toString() + ",";
          var res = str_tags.search(rg);
          var src = smpls[i].web;

          var card = g.apis.makeCard(null, 'T', 'photo');
              card = g.apis.makeCard(card, 'S', 0);
              card = g.apis.makeCard(card, 'R', 0);
              card = g.apis.makeCard(card, 'C', src);
              card = g.apis.makeCard(card, 'H', false);
              card = g.apis.makeCard(card, 'D', "webpage:" + smpls[i].page);

          if(res != -1 || query == MAINKEY) {
            imageList.push(src);
            $("griddles-ui-card").append(card);
          }
       }
    }
    var headerBgURL = "";
    if(imageList.length > 0) {
      var r = Math.floor(Math.random() * (imageList.length));
      headerBgURL = imageList[r];
    }else {
      headerBgURL = "src/1frgq.jpg";
    }
    changeHeadImage(headerBgURL);
    document.querySelector("griddles-ui-card").query = query;
  });
};

function isChromeApp() {
    var res = false;
    if(chrome != undefined) {
        if(chrome.app.window != undefined) {
        // 「chrome アプリ」である
        res = true;
        }
    }
  return res;
}

function changeHeadImage(url) {
  var headerBg = document.querySelector("core-scroll-header-panel").headerBg;
  if(isChromeApp() == true) {
      var xhr = new XMLHttpRequest();
          xhr.open('GET', url, true);
          xhr.responseType = 'blob';
          xhr.onload = function(e) {
              var blob_url = window.webkitURL.createObjectURL(this.response);
              url = blob_url;
              headerBg.style.backgroundImage = "url('"+ url +"')";
          }
          xhr.send();
  }else {
      headerBg.style.backgroundImage = "url('"+ url +"')";
  }
}

function griddlesAppCardClicked(card) {
   /* open web page */
   changeHeadImage(card[0].src);
   window.open(card[0].data.webpage);
}

function ImportingData() {
   var import_code = document.getElementById("dialog_input_import").value;
   if(import_code != "") {
       var import_code = JSON.parse(import_code);
       appStorage({"key": YUMMY2, "value": import_code}, "set", griddlesAppInit);
   }
}

function removingData() {
   appStorage({"key": YUMMY2}, "remove", griddlesAppInit);
}

function toggleDialog(id) {
    var dialog = document.querySelector('#' + id);
    dialog.toggle();
}

//
// griddles-ui-card の main関数
//
function griddlesAppInit() {
  console.log("appInit..");
  griddles_apis = document.querySelector("griddles-ui-card").apis;
  var smpls = sample_data;

  appStorage({"key": YUMMY2}, "get", function(e, keys) {
    var key = keys[0];
    var json = e[key];
    if(json != undefined && json != null) {
       smpls = json;
       var queries = creatingKeyList(smpls, "menus");
    }else if(json == undefined) {
       appStorage({"key": YUMMY2, "value": smpls}, "set", function() {
           var queries = creatingKeyList(smpls, "menus");
       })
    }
  });
}

/*
 * Event Listener
 */
document.getElementById("btn_import").addEventListener("click", function() {
   toggleDialog('dialog_import');
}, false);

document.getElementById("btn_remove").addEventListener("click", function() {
   removingData();
}, false);

document.getElementById("dialog_btn_import").addEventListener("click", function() {
   ImportingData();
}, false);

window.addEventListener("click", function(e) {
   var id = e.target.id;
   var dataset = e.target.dataset;
   if(dataset.label != undefined && dataset.label != TAGMANAGE) {
       var now = document.querySelector("griddles-ui-card").query;
       if(now != dataset.label) {
         yummy2.query = dataset.label;
         miils();
       }else {
         console.log("同一のクエリ.");
       }
   }
},false);


text:
class WithTwoAppsCorrect < TestCask
  version '1.2.3'
  sha256 '9203c30951f9aab41ac294bbeb1dcef7bed401ff0b353dcb34d68af32ea51853'

  url TestHelper.local_binary_url('caffeine.zip')
  homepage 'http://example.com/local-caffeine'

  app 'Caffeine.app'
  app 'Caffeine.app', :target => 'AnotherName.app'
end


text:
MyMinecraftMods
===============


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- valid - tt:animate in out-of-line animation context with linear calculation mode -->
<tt xml:lang="" xmlns="http://www.w3.org/ns/ttml"
    xmlns:ttp="http://www.w3.org/ns/ttml#parameter" ttp:profile="ttml2-transformation"
    xmlns:tts="http://www.w3.org/ns/ttml#styling"
    xmlns:ttva="http://skynav.com/ns/ttv/annotations" ttva:warnOn="all" ttva:expectedErrors="0" ttva:expectedWarnings="0" ttva:model="ttml2">
  <head>
    <animation>
      <animate xml:id="a1" calcMode="linear" keyTimes="0;0.25;0.50;1" tts:color="red;green;yellow;blue"/>
    </animation>
  </head>
</tt>


text:
require File.expand_path("../helper", __FILE__)

class TestSave < Test::Unit::TestCase
  include TestHelper

  # Test initial variables and setting/getting state.
  def test_basic
    testname='save'
    filter = Proc.new{|got_lines, correct_lines|
      got_lines.each do |s|
        s.gsub!(/(\d+) file .*gcd.rb/, '\1 file gcd.rb')
      end
      got_lines.each do |s|
        s.gsub!(/break .*gcd.rb:10/, "break gcd.rb:10")
      end
    }
    script = File.join('data', testname + '.cmd')
    assert(run_debugger(testname, "--script #{script} -- ./example/gcd.rb 3 5",
                        :filter => filter))
  end
end


text:
cask 'dashcam-viewer' do
  version '2.1.6'
  sha256 'cb0a03231fd70a63763c6b13c5ff672c584b164f505e9c1b80e0d4b3e7ee091b'

  # dropboxusercontent.com/u/25150850 was verified as official when first introduced to the cask
  url "https://dl.dropboxusercontent.com/u/25150850/Dashcam_Viewer_v#{version}.dmg"
  name 'Dashcam Viewer'
  name 'Dashcam Viewer by Earthshine Software'
  homepage 'https://dashcamviewer.com'
  license :freemium

  app 'Dashcam Viewer.app'
end