text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="
  http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  http://www.springframework.org/schema/context
  http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<bean class="org.olat.core.logging.Tracing">
	<constructor-arg value="${node.id}" />
</bean>

<bean id="logFileParser" class="org.olat.core.logging.LogFileParser">
	<constructor-arg type="String" value="${log.dir}" />
</bean>

</beans>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Inter-component Interfaces: EM_ProfileAccessInterface Struct Reference</title>
<link href="hydoxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Modules

Packages

Classes

Files

Related Pages

Class List

Class Members

EM_ProfileAccessInterface Struct Reference
#include <em_profile_access.h>

List of all members.

Detailed Description

A EM interface used to access to profile collectors.

Public Attributes

EM_PCTYPE(* 	get_pc_type )(EM_Handle _this, PC_Handle pc)

 	Request profile collector type for specified profile collector handle.

Method_Profile_Handle(* 	get_method_profile )(EM_Handle _this, PC_Handle pc, Method_Handle mh)

 	Request method profile from profile collector.

PC_Handle(* 	get_pc )(EM_Handle _this, EM_PCTYPE profile_type, JIT_Handle jh, EM_JIT_PC_Role jit_role)

 	Request profile collector of specified type and role for a JIT.

Method_Profile_Handle(* 	eb_profiler_create_profile )(PC_Handle ph, Method_Handle mh)

 	Create new entry-backedge profile for a method.

void *(* 	eb_profiler_get_entry_counter_addr )(Method_Profile_Handle mph)

 	Request the address of entry counter.

void *(* 	eb_profiler_get_backedge_counter_addr )(Method_Profile_Handle mph)

 	Request the address of backedge counter.

char(* 	eb_profiler_is_in_sync_mode )(PC_Handle pch)

 	Check if entry-backedge profiler is configured to work in synchronous mode In synchronous mode JIT is responsible to emit checks that counter's limit is reached for both entry and backedge counters.

void(* 	eb_profiler_sync_mode_callback )(Method_Profile_Handle mph)

 	If profile collector is in sync mode JIT must call this method every time the counter limit is reached.

uint32(* 	eb_profiler_get_entry_threshold )(PC_Handle pch)

Returns:

The counter's limit for entry threshold for a given profile collector.

uint32(* 	eb_profiler_get_backedge_threshold )(PC_Handle pch)

Returns:

The counter's limit for backedge threshold for a given profile collector.

Method_Profile_Handle(* 	edge_profiler_create_profile )(PC_Handle ph, Method_Handle mh, uint32 numEdgeCounters, uint32 *counterKeys, uint32 checkSum)

 	Create an edge profile for a method.

uint32(* 	edge_profiler_get_num_counters )(Method_Profile_Handle mph)

 	Return number of edge counters in profile.

uint32(* 	edge_profiler_get_checksum )(Method_Profile_Handle mph)

 	Return profile checksum.

void *(* 	edge_profiler_get_counter_addr )(Method_Profile_Handle mph, uint32 key)

 	Return the address of counter associated with key.

void *(* 	edge_profiler_get_entry_counter_addr )(Method_Profile_Handle mph)

 	Return the address of entry counter.

uint32(* 	edge_profiler_get_entry_threshold )(PC_Handle pch)

 	Return the entry threshold for profile collector.

uint32(* 	edge_profiler_get_backedge_threshold )(PC_Handle pch)

 	Return the edge threshold for profile collector.

Method_Profile_Handle(* 	value_profiler_create_profile )(PC_Handle pch, Method_Handle mh, uint32 numKeys, uint32 *keys)

 	Create an value profile for a method.

void(* 	value_profiler_add_value )(Method_Profile_Handle mph, uint32 instructionKey, POINTER_SIZE_INT valueToAdd)

 	Update frequency or insert the new value of given instruction.

POINTER_SIZE_INT(* 	value_profiler_get_top_value )(Method_Profile_Handle mph, uint32 instructionKey)

Returns:

The maximum value(by frequency) of give instruction.

void(* 	value_profiler_dump_values )(Method_Profile_Handle mph, std::ostream &os)

Member Data Documentation

          EM_PCTYPE(* EM_ProfileAccessInterface.get_pc_type)(EM_Handle _this, PC_Handle pc)

Request profile collector type for specified profile collector handle.

Parameters:

	_this 	- EM instance profile collector belongs to

	pc 	- profile collector handle we interested in

Returns:

The type of profile collector.

          Method_Profile_Handle(* EM_ProfileAccessInterface.get_method_profile)(EM_Handle _this, PC_Handle pc, Method_Handle mh)

Request method profile from profile collector.

Parameters:

	_this 	- EM instance profile collector belongs to

	pc 	- profile collector used to collect profile

	mh 	- method we asking profile for

Returns:

Method profile handle, that can be used to access to custom method profile properties with specialized profile collector interface.

          PC_Handle(* EM_ProfileAccessInterface.get_pc)(EM_Handle _this, EM_PCTYPE profile_type, JIT_Handle jh, EM_JIT_PC_Role jit_role)

Request profile collector of specified type and role for a JIT.

Parameters:

	_this 	- EM instance profile collector belongs to

	profile_type 	- the type of profile collector

	jh 	- handle to JIT, profile collector created for

	jit_role 	- the role of JIT: the user or supplier of profile

Returns:

The handle to profile collector instance.

          Method_Profile_Handle(* EM_ProfileAccessInterface.eb_profiler_create_profile)(PC_Handle ph, Method_Handle mh)

Create new entry-backedge profile for a method.

Only one profile per method can be created for a single profile collector instance.

          void*(* EM_ProfileAccessInterface.eb_profiler_get_entry_counter_addr)(Method_Profile_Handle mph)

Request the address of entry counter.

JIT configured to generate entry-backedge profile must emit the code to increment this counter every time a method called.

          void*(* EM_ProfileAccessInterface.eb_profiler_get_backedge_counter_addr)(Method_Profile_Handle mph)

Request the address of backedge counter.

JIT configured to generate entry-backedge profile must emit the code to increment this counter every time any backedge in a method is called.

          char(* EM_ProfileAccessInterface.eb_profiler_is_in_sync_mode)(PC_Handle pch)

Check if entry-backedge profiler is configured to work in synchronous mode In synchronous mode JIT is responsible to emit checks that counter's limit is reached for both entry and backedge counters.

If limit is reached eb_profiler_sync_mode_callback must be called directly from managed code. In asynchronous mode counters checks are done by profile collector in a separate thread.

See also:

eb_profiler_sync_mode_callback()

          void(* EM_ProfileAccessInterface.eb_profiler_sync_mode_callback)(Method_Profile_Handle mph)

If profile collector is in sync mode JIT must call this method every time the counter limit is reached.

See also:

eb_profiler_is_in_sync_mode()

          uint32(* EM_ProfileAccessInterface.eb_profiler_get_entry_threshold)(PC_Handle pch)

Returns:

The counter's limit for entry threshold for a given profile collector.

          uint32(* EM_ProfileAccessInterface.eb_profiler_get_backedge_threshold)(PC_Handle pch)

Returns:

The counter's limit for backedge threshold for a given profile collector.

          Method_Profile_Handle(* EM_ProfileAccessInterface.edge_profiler_create_profile)(PC_Handle ph, Method_Handle mh, uint32 numEdgeCounters, uint32 *counterKeys, uint32 checkSum)

Create an edge profile for a method.

Only one profile per method can be created for a single profile collector instance.

Parameters:

	ph 	- edge profile collector handle

	mh 	- method handle to create profile for

	numEdgeCounters 	- number of edge counters in a method

	counterKeys 	- the keys, or numbers, will be associated with each counter. The key must be used to access to counter value

	checksum 	- profile checksum

Returns:

A handle to access method profile data.

          uint32(* EM_ProfileAccessInterface.edge_profiler_get_num_counters)(Method_Profile_Handle mph)

Return number of edge counters in profile.

          uint32(* EM_ProfileAccessInterface.edge_profiler_get_checksum)(Method_Profile_Handle mph)

Return profile checksum.

          void*(* EM_ProfileAccessInterface.edge_profiler_get_counter_addr)(Method_Profile_Handle mph, uint32 key)

Return the address of counter associated with key.

          void*(* EM_ProfileAccessInterface.edge_profiler_get_entry_counter_addr)(Method_Profile_Handle mph)

Return the address of entry counter.

          uint32(* EM_ProfileAccessInterface.edge_profiler_get_entry_threshold)(PC_Handle pch)

Return the entry threshold for profile collector.

          uint32(* EM_ProfileAccessInterface.edge_profiler_get_backedge_threshold)(PC_Handle pch)

Return the edge threshold for profile collector.

          Method_Profile_Handle(* EM_ProfileAccessInterface.value_profiler_create_profile)(PC_Handle pch, Method_Handle mh, uint32 numKeys, uint32 *keys)

Create an value profile for a method.

Only one profile per method can be created for a single profile collector instance.

Parameters:

	pch 	- value profile collector handle

	mh 	- method handle to create profile for

	numKeys 	- number of instructions to be profiled

	keys 	- the keys, or numbers, will be associated with each instruction. The key must be used to access to instruction value

          void(* EM_ProfileAccessInterface.value_profiler_add_value)(Method_Profile_Handle mph, uint32 instructionKey, POINTER_SIZE_INT valueToAdd)

Update frequency or insert the new value of given instruction.

          POINTER_SIZE_INT(* EM_ProfileAccessInterface.value_profiler_get_top_value)(Method_Profile_Handle mph, uint32 instructionKey)

Returns:

The maximum value(by frequency) of give instruction.

          void(* EM_ProfileAccessInterface.value_profiler_dump_values)(Method_Profile_Handle mph, std::ostream &os)

The documentation for this struct was generated from the following file:

em_profile_access.h

<address style="text-align: center;">

Genereated on Tue Mar 11 19:25:26 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.

</address>

redpajama_set_name: RedPajamaGithub


text:
{% if collectiontopic.id %}

Edit Collection Topic

{% else %}

Add Collection Topic

{% endif %}

<form action="{{ action }}" method="POST">
  {% csrf_token %}

    {{ form.as_ul }}

  <input id="save_collectiontopic" type="submit" value="Save" />
</form>

{% if collectiontopic.id %}
Delete
{% endif %}

back to list


text:
;(function(cam, $, GGRC) {

GGRC.Controllers.Modals("GGRC.Controllers.QuickForm", {
  defaults : {
    model: null,
    instance: null
  }
}, {
  init: function () {
    if(this.options.instance && !this.options.model) {
      this.options.model = this.options.instance.constructor;
    }
    this.options.$content = this.element;
    if (this.element.data("force-refresh")) {
      this.options.instance.refresh();
    }
  },
  "input, textarea, select change": function (el, ev) {
    if (el.data("toggle") === "datepicker") {
      var val = el.datepicker("getDate"),
          prop = el.attr("name"),
          old_value = this.options.instance.attr(prop);

          if (moment(val).isSame(old_value)) {
            return;
          }
          $.when(this.options.instance.refresh()).then(function () {
            this.options.instance.attr(prop, val);
            this.options.instance.save();
          }.bind(this));
      return;
    }
    if (!el.is("[data-lookup]")) {
      this.set_value_from_element(el);
      setTimeout(function () {
        this.options.instance.save();
      }.bind(this), 100);
    }
  },
  autocomplete_select: function (el, event, ui) {
    var prop = el.attr("name").split(".").slice(0, -1).join(".");
    if (this._super.apply(this, arguments) !== false) {
      setTimeout(function () {
        this.options.instance.save().then(function () {
          var obj = this.options.instance.attr(prop);
          if (obj.attr) {
            obj.attr("saved", true);
          }
        }.bind(this));
      }.bind(this), 100);
    } else {
      return false;
    }
  },
  "input, select, textarea click": function (el, ev) {
    if (el.data("toggle") === "datepicker") {
      return;
    }
    this._super && this._super.apply(this, arguments);
    ev.stopPropagation();
  },
  ".dropdown-menu > li click": function (el, ev) {
    ev.stopPropagation();
    var that = this;
    this.set_value({ name: el.data('name'), value: el.data('value') });
    setTimeout(function() {
      that.options.instance.save();
      $(el).closest(".open").removeClass("open");
    }, 100);
  }

  , "button[data-name][data-value]:not(.disabled), a.undoable[data-toggle*=modal] click": function(el, ev) {

    var that = this
      , name = el.data('name')
      , old_value = {};

    if(el.data('openclose')){
      var action = el.data('openclose'),
          main = el.closest('.item-main'),
          openclose = main.find('.openclose'),
          isOpened = openclose.hasClass('active');

      // We can't use main.openclose(action) here because content may not be loaded yet
      if(action === 'trigger'){
        openclose.trigger('click');
      }
      else if(action === 'close' && isOpened){
        openclose.trigger('click');
      }
      else if(action === 'open' && !isOpened){
        openclose.trigger('click');
      }
    }

    old_value[el.data("name")] = this.options.instance.attr(el.data("name"));
    if(el.data("also-undo")) {
      can.each(el.data("also-undo").split(","), function(attrname) {
        attrname = attrname.trim();
        old_value[attrname] = that.options.instance.attr(attrname);
      });
    }

    // Check if the undo button was clicked:
    this.options.instance.attr('_undo') || that.options.instance.attr('_undo', []);

    if(el.is("[data-toggle*=modal")) {
      setTimeout(function() {
        $(".modal:visible").one("modal:success", function() {
          that.options.instance.attr('_undo').unshift(old_value);
        });
      }, 100);
    } else {
      ev.stopPropagation();
      that.options.instance.attr('_undo').unshift(old_value);

    that.options.instance.attr('_disabled', 'disabled');
    that.options.instance.refresh().then(function(instance){
      that.set_value({ name: el.data('name'), value: el.data('value') });
      return instance.save();
    }).then(function(){
      that.options.instance.attr('_disabled', '');
    });
  }
  }

  , "a.undo click" : function(el, ev){
    ev.stopPropagation();
    var that = this
      , name = el.data('name')
      , old_value = this.options.instance.attr(name) || "";

    new_value = that.options.instance.attr('_undo').shift();
    that.options.instance.attr('_disabled', 'disabled');
    that.options.instance.refresh().then(function(instance){
      can.each(new_value, function(value, name) {
        that.set_value({ name: name, value: value });
      });
      return instance.save();
    }).then(function(){
      that.options.instance.attr('_disabled', '');
    });
  }
});
})(this.can, this.can.$, this.GGRC);


text:
@(title: String, plugin_css: Html = Html(" "), plugin_js: Html = Html(" "), page_js: Html = Html(" "), body_styles: String = "", admin: Option[models.daos.NsAdmin] = None)(content: Html)(implicit messages: Messages)

@import common._

<!DOCTYPE html>

@site(Messages("home.title"), plugin_css, plugin_js, page_js, body_styles, admin = admin) {
@navbar(admin)

@content

© 2017 Context360 Inc

        Analytics with  by Sparkle

}


text:
package org.apache.camel.component.spring.ws;

import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;

import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

import org.apache.camel.component.spring.ws.util.FileUtil;
import org.apache.camel.test.junit4.CamelSpringTestSupport;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.ws.client.core.WebServiceTemplate;

public class ConsumerEndpointMappingByBeanNameRouteTest extends CamelSpringTestSupport {

    private static final String xmlRequestForGoogleStockQuote = "<GetQuote xmlns=\"http://www.stockquotes.edu/\"><symbol>GOOG</symbol></GetQuote>";

    private String expectedResponse;
    private WebServiceTemplate webServiceTemplate;

    public ConsumerEndpointMappingByBeanNameRouteTest() throws IOException {
        expectedResponse = FileUtil.readFileAsString("src/test/resources/stockquote-response.xml");
    }

    @Before
    public void setUp() throws Exception {
        super.setUp();
        webServiceTemplate = (WebServiceTemplate) applicationContext.getBean("webServiceTemplate");
    }

    @Test
    public void testBeanName() throws Exception {
        StreamSource source = new StreamSource(new StringReader(xmlRequestForGoogleStockQuote));
        StringWriter sw = new StringWriter();
        StreamResult result = new StreamResult(sw);
        webServiceTemplate.sendSourceAndReceiveToResult(source, result);
        assertNotNull(result);
        assertEquals(expectedResponse, sw.toString());
    }

    @Override
    protected AbstractXmlApplicationContext createApplicationContext() {
        return new ClassPathXmlApplicationContext(
                "org/apache/camel/component/spring/ws/ConsumerEndpointMappingByBeanNameRouteTest-context.xml");
    }

}


text:
<?php

/**
 *
 * @package    Gems
 * @subpackage Tracker
 * @copyright  Copyright (c) 2011 Erasmus MC
 * @license    New BSD License
 * @since      Class available since version 1.4
 */
interface Gems_Tracker_Engine_TrackEngineInterface
{
    /**
     *
     * @param array $trackData array containing track record
     */
    public function __construct($trackData);

    /**
     * Integrate field loading en showing and editing
     *
     * @param \MUtil_Model_ModelAbstract $model
     * @param boolean $addDependency True when editing, can be false in all other cases
     * @param string $respTrackId Optional Database column name where Respondent Track Id is set
     * @return \Gems_Tracker_Engine_TrackEngineAbstract
     */
    public function addFieldsToModel(\MUtil_Model_ModelAbstract $model, $addDependency = true, $respTrackId = false);

    /**
     * Set menu parameters from this track engine
     *
     * @param \Gems_Menu_ParameterSource $source
     * @return \Gems_Tracker_Engine_TrackEngineInterface (continuation pattern)
     */
    public function applyToMenuSource(\Gems_Menu_ParameterSource $source);

    /**
     * Calculate the track info from the fields
     *
     * @param int $respTrackId Gems respondent track id or null when new
     * @param array $data The values to save
     * @return string The description to save as track_info
     */
    public function calculateFieldsInfo(array $data);

    /**
     * Calculate the number of active rounds in this track from the database.
     *
     * @return int The number of rounds in this track.
     */
    public function calculateRoundCount();

    /**
     * Check for the existence of all tokens and create them otherwise
     *
     * @param \Gems_Tracker_RespondentTrack $respTrack The respondent track to check
     * @param int $userId Id of the user who takes the action (for logging)
     * @param \Gems_Task_TaskRunnerBatch $changes batch for counters
     */
    public function checkRoundsFor(\Gems_Tracker_RespondentTrack $respTrack, $userId, \Gems_Task_TaskRunnerBatch $batch = null);

    /**
     * Check the valid from and until dates in the track starting at a specified token
     *
     * @param \Gems_Tracker_RespondentTrack $respTrack The respondent track to check
     * @param \Gems_Tracker_Token $startToken The token to start at
     * @param int $userId Id of the user who takes the action (for logging)
     * @param \Gems_Tracker_Token $skipToken Optional token to skip in the recalculation
     * @return int The number of tokens changed by this code
     */
    public function checkTokensFrom(\Gems_Tracker_RespondentTrack $respTrack, \Gems_Tracker_Token $startToken, $userId, \Gems_Tracker_Token $skipToken = null);

    /**
     * Check the valid from and until dates in the track
     *
     * @param \Gems_Tracker_RespondentTrack $respTrack The respondent track to check
     * @param int $userId Id of the user who takes the action (for logging)
     * @return \Gems_Tracker_ChangeTracker detailed info on changes
     */
    public function checkTokensFromStart(\Gems_Tracker_RespondentTrack $respTrack, $userId);

    /**
     * Convert a TrackEngine instance to a TrackEngine of another type.
     *
     * @see getConversionTargets()
     *
     * @param type $conversionTargetClass
     */
    public function convertTo($conversionTargetClass);

    /**
     * Copy a track and all it's related data (rounds/fields etc)
     *
     * @param inte $oldTrackId  The id of the track to copy
     * @return int              The id of the copied track
     */
    public function copyTrack($oldTrackId);

    /**
     * An array of snippet names for displaying the answers to a survey.
     *
     * @return array if string snippet names
     */
    public function getAnswerSnippetNames();

    /**
     * Returns a list of classnames this track engine can be converted into.
     *
     * Should always contain at least the class itself.
     *
     * @see convertTo()
     *
     * @param array $options The track engine class options available in as a "track engine class names" => "descriptions" array
     * @return array Filter or adaptation of $options
     */
    public function getConversionTargets(array $options);

    /**
     * A longer description of the workings of the engine.
     *
     * Engine level function, should be the same for each class instance.
     *
     * @return string Name
     */
    public function getDescription();

    /**
     *
     * @return string External description of the track
     */
    public function getExternalName();

    /**
     * Get the FieldUpdateEvent for this trackId
     *
     * @return \Gems\Event\TrackBeforeFieldUpdateEventInterface | null
     */
    public function getFieldBeforeUpdateEvent();

    /**
     * Returns an array of the fields in this track key / value are id / code
     *
     * @return array fieldid => fieldcode With null when no fieldcode
     */
    public function getFieldCodes();

    /**
     * Returns an array of the fields in this track
     * key / value are id / field name
     *
     * @return array fieldid => fieldcode
     */
    public function getFieldNames();

    /**
     * Returns the field data for the respondent track id.
     *
     * @param int $respTrackId Gems respondent track id or null when new
     * @return array of the existing field values for this respondent track
     */
    public function getFieldsData($respTrackId);

    /**
     * Get the storage model for field values
     *
     * @return \Gems\Tracker\Model\FieldDataModel
     */
    public function getFieldsDataStorageModel();

    /**
     * Returns the field definition for the track enige.
     *
     * @return \Gems\Tracker\Engine\FieldsDefinition;
     */
    public function getFieldsDefinition();

    /**
     * Returns a model that can be used to retrieve or save the field definitions for the track editor.
     *
     * @param boolean $detailed Create a model for the display of detailed item data or just a browse table
     * @param string $action The current action
     * @return \Gems\Tracker\Model\FieldMaintenanceModel
     */
    public function getFieldsMaintenanceModel($detailed = false, $action = 'index');

    /**
     * Returns an array name => code of all the fields of the type specified
     *
     * @param string $fieldType
     * @return array name => code
     */
    public function getFieldsOfType($fieldType);

    /**
     * Get the FieldUpdateEvent for this trackId
     *
     * @return \Gems_Event_TrackFieldUpdateEventInterface | null
     */
    public function getFieldUpdateEvent();

    /**
     * Get the round id of the first round
     *
     * @return int Gems id of first round
     */
    public function getFirstRoundId();

    /**
     * A pretty name for use in dropdown selection boxes.
     *
     * Engine level function, should be the same for each class instance.
     *
     * @return string Name
     */
    public function getName();

    /**
     * Look up the round id for the next round
     *
     * @param int $roundId  Gems round id
     * @return int Gems round id
     */
    public function getNextRoundId($roundId);

    /**
     * Look up the round id for the previous round
     *
     * @param int $roundId  Gems round id
     * @param int $roundOrder Optional extra round order, for when the current round may have changed.
     * @return int Gems round id
     */
    public function getPreviousRoundId($roundId, $roundOrder = null);

    /**
     * Get all respondent relation fields
     *
     * Returns an array of field id => field name
     *
     * @return array
     */
    public function getRespondentRelationFields();

    /**
     * Get the round object
     *
     * @param int $roundId  Gems round id
     * @return \Gems\Tracker\Round
     */
    public function getRound($roundId);

    /**
     * Returns a snippet name that can be used to display the answers to the token or nothing.
     *
     * @param \Gems_Tracker_Token $token
     * @return array Of snippet names
     */
    public function getRoundAnswerSnippets(\Gems_Tracker_Token $token);

    /**
     * Return the Round Changed event name for this round
     *
     * @param int $roundId
     * @return \Gems_Event_RoundChangedEventInterface event instance or null
     */
    public function getRoundChangedEvent($roundId);

    /**
     * Get the defaults for a new round
     *
     * @return array Of fieldname => default
     */
    public function getRoundDefaults();

    /**
     * The round descriptions for this track
     *
     * @return array roundId => string
     */
    public function getRoundDescriptions();

    /**
     * An array of snippet names for editing a round.
     *
     * @return array of string snippet names
     */
    public function getRoundEditSnippetNames();

    /**
     * Returns a model that can be used to retrieve or save the data.
     *
     * @param boolean $detailed Create a model for the display of detailed item data or just a browse table
     * @param string $action The current action
     * @return \Gems_Model_JoinModel
     */
    public function getRoundModel($detailed, $action);

    /**
     * Get all the round objects
     *
     * @return array of roundId => \Gems\Tracker\Round
     */
    public function getRounds();

    /**
     * An array of snippet names for editing a round.
     *
     * @return array of string snippet names
     */
    public function getRoundShowSnippetNames();

    /**
     * An array of snippet names for deleting a token.
     *
     * @param \Gems_Tracker_Token $token Allows token status dependent delete snippets
     * @return array of string snippet names
     */
    public function getTokenDeleteSnippetNames(\Gems_Tracker_Token $token);

    /**
     * An array of snippet names for editing a token.
     *
     * @param \Gems_Tracker_Token $token Allows token status dependent edit snippets
     * @return array of string snippet names
     */
    public function getTokenEditSnippetNames(\Gems_Tracker_Token $token);

    /**
     * Returns a model that can be used to save, edit, etc. the token
     *
     * @return \Gems_Tracker_Model_StandardTokenModel
     */
    public function getTokenModel();

    /**
     * An array of snippet names for displaying a token
     *
     * @param \Gems_Tracker_Token $token Allows token status dependent show snippets
     * @return array of string snippet names
     */
    public function getTokenShowSnippetNames(\Gems_Tracker_Token $token);

    /**
     * Get the TrackCompletedEvent for the given trackId
     *
     * @return \Gems_Event_TrackCalculationEventInterface | null
     */
    public function getTrackCalculationEvent();

    /**
     *
     * @return string The gems track code
     */
    public function getTrackCode();

    /**
     * Get the TrackCompletedEvent for the given trackId
     *
     * @return \Gems_Event_TrackCompletedEventInterface|null
     */
    public function getTrackCompletionEvent();

    /**
     *
     * @return int The track id
     */
    public function getTrackId();

    /**
     *
     * @return string The gems track name
     */
    public function getTrackName();

    /**
     * The track type of this engine
     *
     * @return string 'T' or 'S'
     */
    public function getTrackType();

    /**
     * Is the field an appointment type
     *
     * @param string $fieldName
     * @return boolean
     */
    public function isAppointmentField($fieldName);

    /**
     * True if the user can create this kind of track in TrackMaintenanceAction.
     * False if this type of track is created by specialized user interface actions.
     *
     * Engine level function, should be the same for each class instance.
     *
     * @return boolean
     */
    public function isUserCreatable();

    /**
     * Updates the number of rounds in this track.
     *
     * @param int $userId The current user
     * @return int 1 if data changed, 0 otherwise
     */
    public function updateRoundCount($userId);
}


text:
ACCEPTED

#### According to
GRIN Taxonomy for Plants

#### Published in
Fl. Brit. India 1:273. 1874

#### Original name
null

### Remarks
null


text:
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace OpenCvSharp.CPlusPlus
{
    /// <summary>
    /// 2-Tuple of short (System.Int16)
    /// </summary>
    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    public struct Vec2s : IVec<short>
    {
        /// <summary>
        /// The value of the first component of this object.
        /// </summary>
        public short Item0;
        /// <summary>
        /// The value of the second component of this object.
        /// </summary>
        public short Item1;

        /// <summary>
        /// Initializer
        /// </summary>
        /// <param name="item0"></param>
        /// <param name="item1"></param>
        public Vec2s(short item0, short item1)
        {
            Item0 = item0;
            Item1 = item1;
        }

        /// <summary>
        /// Indexer
        /// </summary>
        /// <param name="i"></param>
        /// <returns></returns>
        public short this[int i]
        {
            get
            {
                switch (i)
                {
                    case 0: return Item0;
                    case 1: return Item1;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(i));
                }
            }
            set
            {
                switch (i)
                {
                    case 0: Item0 = value; break;
                    case 1: Item1 = value; break;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(i));
                }
            }
        }
    }

    /// <summary>
    /// 3-Tuple of short (System.Int16)
    /// </summary>
    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    public struct Vec3s : IVec<short>
    {
        /// <summary>
        /// The value of the first component of this object.
        /// </summary>
        public short Item0;
        /// <summary>
        /// The value of the second component of this object.
        /// </summary>
        public short Item1;
        /// <summary>
        /// The value of the third component of this object.
        /// </summary>
        public short Item2;

        /// <summary>
        /// Initializer
        /// </summary>
        /// <param name="item0"></param>
        /// <param name="item1"></param>
        /// <param name="item2"></param>
        public Vec3s(short item0, short item1, short item2)
        {
            Item0 = item0;
            Item1 = item1;
            Item2 = item2;
        }

        /// <summary>
        /// Indexer
        /// </summary>
        /// <param name="i"></param>
        /// <returns></returns>
        public short this[int i]
        {
            get
            {
                switch (i)
                {
                    case 0: return Item0;
                    case 1: return Item1;
                    case 2: return Item2;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(i));
                }
            }
            set
            {
                switch (i)
                {
                    case 0: Item0 = value; break;
                    case 1: Item1 = value; break;
                    case 2: Item2 = value; break;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(i));
                }
            }
        }
    }

    /// <summary>
    /// 4-Tuple of short (System.Int16)
    /// </summary>
    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    public struct Vec4s : IVec<short>
    {
        /// <summary>
        /// The value of the first component of this object.
        /// </summary>
        public short Item0;

        /// <summary>
        /// The value of the second component of this object.
        /// </summary>
        public short Item1;

        /// <summary>
        /// The value of the third component of this object.
        /// </summary>
        public short Item2;

        /// <summary>
        /// The value of the fourth component of this object.
        /// </summary>
        public short Item3;

        /// <summary>
        /// Initializer
        /// </summary>
        /// <param name="item0"></param>
        /// <param name="item1"></param>
        /// <param name="item2"></param>
        /// <param name="item3"></param>
        public Vec4s(short item0, short item1, short item2, short item3)
        {
            Item0 = item0;
            Item1 = item1;
            Item2 = item2;
            Item3 = item3;
        }

        /// <summary>
        /// Indexer
        /// </summary>
        /// <param name="i"></param>
        /// <returns></returns>
        public short this[int i]
        {
            get
            {
                switch (i)
                {
                    case 0: return Item0;
                    case 1: return Item1;
                    case 2: return Item2;
                    case 3: return Item3;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(i));
                }
            }
            set
            {
                switch (i)
                {
                    case 0: Item0 = value; break;
                    case 1: Item1 = value; break;
                    case 2: Item2 = value; break;
                    case 3: Item3 = value; break;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(i));
                }
            }
        }
    }

    /// <summary>
    /// 6-Tuple of short (System.Int16)
    /// </summary>
    [Serializable]
    [StructLayout(LayoutKind.Sequential)]
    public struct Vec6s : IVec<short>
    {
        /// <summary>
        /// The value of the first component of this object.
        /// </summary>
        public short Item0;

        /// <summary>
        /// The value of the second component of this object.
        /// </summary>
        public short Item1;

        /// <summary>
        /// The value of the third component of this object.
        /// </summary>
        public short Item2;

        /// <summary>
        /// The value of the fourth component of this object.
        /// </summary>
        public short Item3;

        /// <summary>
        /// The value of the fifth component of this object.
        /// </summary>
        public short Item4;

        /// <summary>
        /// The value of the sixth component of this object.
        /// </summary>
        public short Item5;

        /// <summary>
        /// Initializer
        /// </summary>
        /// <param name="item0"></param>
        /// <param name="item1"></param>
        /// <param name="item2"></param>
        /// <param name="item3"></param>
        /// <param name="item4"></param>
        /// <param name="item5"></param>
        public Vec6s(short item0, short item1, short item2, short item3, short item4, short item5)
        {
            Item0 = item0;
            Item1 = item1;
            Item2 = item2;
            Item3 = item3;
            Item4 = item4;
            Item5 = item5;
        }

        /// <summary>
        /// Indexer
        /// </summary>
        /// <param name="i"></param>
        /// <returns></returns>
        public short this[int i]
        {
            get
            {
                switch (i)
                {
                    case 0: return Item0;
                    case 1: return Item1;
                    case 2: return Item2;
                    case 3: return Item3;
                    case 4: return Item4;
                    case 5: return Item5;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(i));
                }
            }
            set
            {
                switch (i)
                {
                    case 0: Item0 = value; break;
                    case 1: Item1 = value; break;
                    case 2: Item2 = value; break;
                    case 3: Item3 = value; break;
                    case 4: Item4 = value; break;
                    case 5: Item5 = value; break;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(i));
                }
            }
        }
    }
}


text:
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" sizes="16x16 32x32" href="/favicon.ico?v=2">
    <title>aries</title>
    <script type="text/javascript" src="//use.typekit.net/lzt3wqe.js"></script>
    <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
</head>


text:
var amp;
var mic;
var canChange = true;

function setup() {
  createCanvas(300,300);
  amp = new p5.Amplitude();//by dafault it listens to any sound in your sketch
  mic = new p5.AudioIn();
  mic.start();
  amp.setInput(mic); //if you might want another audio source, set this one to mic
  bgColor = color(255,0,0);
}

function draw() {
  background(bgColor);

  var level = amp.getLevel();
  var y = map(level,0,1,height, 0);
  stroke(0);
  strokeWeight(9);
  // line(100,0, 100,y*100);
  ellipse(width/2,y,120,120);
  noStroke();
  text(level, 20,20);
  amp.smooth(.95);//decay rate of 95%, it defaults to 1
  threshhold = .03;
  if (level>threshhold && canChange){
    bgColor = color(random(255),random(255),random(255));
    canChange = false;
  } else if (level<threshhold){
    canChange = true;
  }

}


text:
package com.iosxc.android.jzhdemo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;
import android.view.View;

import com.iosxc.android.utils.SecurityUtils;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class MainActivity extends AppCompatActivity {
    private static final String JZH_API_BASE_URL = "http://116.239.4.195:9056/jzh";
    private static final String PAGE_NOTIFY_URL = "http://103.16.127.68:8018/Result/FuiouCallBack";
    private static final String BACK_NOTIFY_URL = "http://103.16.127.68:8018/Result/FuiouNotify";
    private static final String MCHNT_CD = "0002900F0339996";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void on500001Click(View view) throws Exception{
        Map<String, String> paramMap = new HashMap<String, String>(7);
        paramMap.put("mchnt_cd",MCHNT_CD);
        paramMap.put("mchnt_txn_ssn",genSSn());
        paramMap.put("login_id","18611429112");
        paramMap.put("amt","100");
        paramMap.put("page_notify_url",PAGE_NOTIFY_URL);
        paramMap.put("back_notify_url",BACK_NOTIFY_URL);
        Intent jzhWebApiIntent = new Intent(this,JzhWebActivity.class);
        jzhWebApiIntent.putExtra(JzhWebActivity.INTENT_EXTRA_KEY_APIURL, JZH_API_BASE_URL+"/app/500001.action");
        jzhWebApiIntent.putExtra(JzhWebActivity.INTENT_EXTRA_KEY_POSTDATA, paramMap2bytes(paramMap));
        startActivity(jzhWebApiIntent);
    }

    public void on500002Click(View view) throws Exception{
        Map<String, String> paramMap = new HashMap<String, String>(7);
        paramMap.put("mchnt_cd",MCHNT_CD);
        paramMap.put("mchnt_txn_ssn",genSSn());
        paramMap.put("login_id","18611429112");
        paramMap.put("amt","100");
        paramMap.put("page_notify_url",PAGE_NOTIFY_URL);
        paramMap.put("back_notify_url",BACK_NOTIFY_URL);
        Intent jzhWebApiIntent = new Intent(this,JzhWebActivity.class);
        jzhWebApiIntent.putExtra(JzhWebActivity.INTENT_EXTRA_KEY_APIURL, JZH_API_BASE_URL + "/app/500002.action");
        jzhWebApiIntent.putExtra(JzhWebActivity.INTENT_EXTRA_KEY_POSTDATA,paramMap2bytes(paramMap));
        startActivity(jzhWebApiIntent);
    }

    public void on500003Click(View view) throws Exception {
        Map<String, String> paramMap = new HashMap<String, String>(7);
        paramMap.put("mchnt_cd",MCHNT_CD);
        paramMap.put("mchnt_txn_ssn",genSSn());
        paramMap.put("login_id","18611429112");
        paramMap.put("amt","100");
        paramMap.put("page_notify_url",PAGE_NOTIFY_URL);
        paramMap.put("back_notify_url",BACK_NOTIFY_URL);
        Intent jzhWebApiIntent = new Intent(this,JzhWebActivity.class);
        jzhWebApiIntent.putExtra(JzhWebActivity.INTENT_EXTRA_KEY_APIURL, JZH_API_BASE_URL+"/app/500003.action");
        jzhWebApiIntent.putExtra(JzhWebActivity.INTENT_EXTRA_KEY_POSTDATA,paramMap2bytes(paramMap));
        startActivity(jzhWebApiIntent);
    }

    //测试用,请勿生产使用
    private String genSSn(){
        return UUID.randomUUID().toString().substring(2).replaceAll("-","");
    }

    private byte[] paramMap2bytes(Map<String,String> paramMap) throws Exception {
        Object[] keys  =  paramMap.keySet().toArray();
        Arrays.sort(keys);
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<keys.length;i++){
            Object key = keys[i];
            sb.append(i==keys.length-1?paramMap.get(key):(paramMap.get(key)+"|"));
        }
        String str4Sign = sb.toString();
        Log.e("jzh", "STRING 4 SIGN:" + str4Sign);
        paramMap.put("signature",genSign(str4Sign));
        StringBuilder postStrSb = new StringBuilder();
        Object[] set = paramMap.entrySet().toArray();
        for(int i=0;i<set.length;i++){
            Map.Entry<String,String> entry  = (Map.Entry<String, String>) set[i];
            postStrSb.append(String.format("%s=%s",entry.getKey(),(i==set.length-1?entry.getValue():(entry.getValue()+"&"))));
        }
        return postStrSb.toString().getBytes("UTF-8");
    }

    private String genSign(String str4Sign) throws Exception {
        String sign = Base64.encodeToString(SecurityUtils.rsaEncrypt(str4Sign.getBytes("UTF-8")),Base64.DEFAULT);
        return URLEncoder.encode(sign,"UTF-8");
    }
}


text:
package at.fhj.itm.pswe.pagecrawler.wordanalyzer;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.inject.Inject;

import org.jboss.ejb3.annotation.TransactionTimeout;

import at.fhj.itm.pswe.dao.AnalyzerDao;
import at.fhj.itm.pswe.model.Article;
import at.fhj.itm.pswe.model.ArticleStat;
import at.fhj.itm.pswe.model.Container;
import at.fhj.itm.pswe.model.Website;
import at.fhj.itm.pswe.model.WebsiteStat;
import at.fhj.itm.pswe.model.Word;

@Stateless
@LocalBean
public class Analyzer {

	/*
	 * @PersistenceContext(unitName = "TermStatistics") private EntityManager
	 * em;
	 */

	private AnalyzerDao analyzerDAO;

	@Inject
	public void setAnalyzerDAO(AnalyzerDao analyzerDAO) {
		this.analyzerDAO = analyzerDAO;
	}

	private String input;
	private HashMap<String, Integer> wordMap;
	ReaderFilterWords rf = new ReaderFilterWords();
	private List<String> filterwords;

	private static String DATE;

	public Analyzer() {
	}

	public void analyzeResults(String path) throws ParseException {
		readResultFile(path);
	}
	/*
	 * Temporary Testcode? public void testPersist() { // TESTCODE Website ws =
	 * em.find(Website.class, 18);
	 *
	 * Word w = new Word(); w.setActive(true); w.setText("hello"); //
	 * em.persist(w); Container c = new Container(); c.setAmount(10);
	 * c.setWord(w); c.setLogDate("01.10.2015"); c.setWebsite(ws);
	 * em.persist(c); em.flush(); // END }
	 */

	private void persistData(String url, String data, Website newWebsite, String currentDate) {

		// Timestamp before starting analyzing article
		long articleStartTime = System.currentTimeMillis();

		this.wordMap = this.calculateWordMap(data);
		Iterator<Map.Entry<String, Integer>> it = this.wordMap.entrySet().iterator();

		Article ar = null;

		System.out.println("Start iterate over Wordmap");
		while (it.hasNext()) {
			// get key/value pair from hash map
			Map.Entry<String, Integer> pair = (Map.Entry<String, Integer>) it.next();

			String word = (String) pair.getKey();
			int count = (int) pair.getValue();

			Word wo = analyzerDAO.findWord(word);

			long findTypeofWordTimebefore = 0;
			long findTypeofWordTimeafter = 0;

			long setTypeForWordTimebefore = 0;
			long setTypeForWordTimeafter = 0;

			System.out.println("WORD: " + word + " | COUNT: " + count);

			// check if word exists in the database
			if (wo == null) {

				wo = new Word();
				wo.setActive(true);
				wo.setText(word);

				findTypeofWordTimebefore = System.currentTimeMillis();
				// look up word type in the wordlist
				String wordtype = analyzerDAO.findTypeForWord(word);

				findTypeofWordTimeafter = System.currentTimeMillis();

				setTypeForWordTimebefore = System.currentTimeMillis();
				// Set Type for word and persist both
				analyzerDAO.setTypeForWord(wo, wordtype);
				setTypeForWordTimeafter = System.currentTimeMillis();

			}

			// Get Article, if already in Database
			long findArticleTimebefore = System.currentTimeMillis();
			Article tmp = new Article();
			tmp.setUrl(url);
			ar = analyzerDAO.findArticle(tmp);
			long findArticleTimeafter = System.currentTimeMillis();
			// add container entry to database
			Container newCont = new Container();
			newCont.setAmount(count);
			newCont.setWord(wo);
			newCont.setLogDate(DATE);
			newCont.setWebsite(newWebsite);
			newCont.setArticle(ar);
			long saveContainerTimebefore = System.currentTimeMillis();
			analyzerDAO.saveContainer(newCont);
			long saveContainerTimeafter = System.currentTimeMillis();

			long saveContainerTime = System.currentTimeMillis();

			System.out.println("findWordTime: " + (findTypeofWordTimeafter - findTypeofWordTimebefore));
			System.out.println("setTypeForWordTime: " + (setTypeForWordTimeafter - setTypeForWordTimebefore));
			System.out.println("findArticleTime: " + (findArticleTimeafter - findArticleTimebefore));
			System.out.println("saveContainerTime: " + (saveContainerTimeafter - saveContainerTimebefore));
			System.out.println();
		}

		// Output of time from analyzing
		System.out.println("Time of Analyzing Article:");
		System.out.println(System.currentTimeMillis() - articleStartTime);
		// Persist articleStat
		ArticleStat articleStat = new ArticleStat();
		articleStat.setAnalyzeDuration(System.currentTimeMillis() - articleStartTime);
		articleStat.setArticle(ar);
		articleStat.setLogDate(DATE);
		analyzerDAO.saveArticleStat(articleStat);

		System.out.println("End iterating over Wordmap");
	}

	public HashMap<String, Integer> calculateWordMap(String input) {
		filterwords = rf.readWords();

		HashMap<String, Integer> wordmap = new HashMap<String, Integer>();
		String[] inputWords = input.split(" ");
		for (int i = 0; i < inputWords.length; i++) {
			String word = inputWords[i].trim();
			// System.out.println("Current word: " + word);

			// remove punctuation from start and end of word
			// according to:
			// http://stackoverflow.com/questions/12506655/how-can-i-remove-all-leading-and-trailing-punctuation
			word = word.replaceFirst("^[^a-zA-ZÖöÄäÜü]+", "").replaceAll("[^a-zA-ZÖöÄäÜü]+$", "").trim();

			if (!word.isEmpty()) {
				boolean isForbidden = false;

				if (filterwords.contains(word)) {
					isForbidden = true;
				}

				/*
				 * old solution for (String s : filterwords) {
				 *
				 * // System.out.println("Filter: "+s); if
				 * (s.contentEquals(word)) { // System.out.println("TRUE: "+s+
				 * " vs "+word); isForbidden = true; }
				 *
				 * }
				 */

				if (!isForbidden) {
					if (wordmap.containsKey(word)) {
						wordmap.put(word, wordmap.get(word) + 1);
					} else {
						wordmap.put(word, 1);
					}
				}
			}
		}

		return wordmap;
	}

	@TransactionTimeout(3600)
	public void readResultFile(String path) throws ParseException {
		try (BufferedReader br = new BufferedReader(new FileReader(path))) {
			String crawlerDuration = "";
			// Read Start Page
			String line = br.readLine();
			String website = line;
			// Read Start Date
			line = br.readLine();
			String currentdate = line;
			DATE = currentdate;

			// Get Current Root Domain only once, pass it further

			// Expect that domain only exists once
			Website webSite = analyzerDAO.findWebsite(website);

			// Update Last Website Crawldate
			// analyzerDAO.updateCrawlDateofWebsite(website);

			int count = 0;

			// Get Timestamp before starting analyzing
			long analyzerStartTime = System.currentTimeMillis();

			// Start with analyzing data
			while (true) {
				String url = br.readLine();
				System.out.println("URL: " + url + "|");
				String data = br.readLine();
				System.out.println("Data: " + data);
				count++;
				if (data == null) {
					crawlerDuration = url;
					break;
				} else {
					try {
						persistData(url, data, webSite, currentdate);
						// flush to db every 20 words
						if (count > 20) {
							count = 0;
							analyzerDAO.flushDAO();
						}
					} catch (Exception e) {
						e.printStackTrace();
						break; // If error occurs
					}
				}
			}
			// Output of time from analyzing
			System.out.println("Time of Analyzing:");
			System.out.println(System.currentTimeMillis() - analyzerStartTime);
			// Persist websiteStat
			WebsiteStat websiteStat = new WebsiteStat();
			websiteStat.setAnalyzeDuration(System.currentTimeMillis() - analyzerStartTime);

			// Convert Time into millis
			Long durationMillis = 0L;
			Date crawlduration = new SimpleDateFormat("HH:mm:ss").parse(crawlerDuration);
			durationMillis = (long) crawlduration.getHours() * 60 * 60 * 1000 + crawlduration.getMinutes() * 60 * 1000
					+ crawlduration.getSeconds() * 1000;

			websiteStat.setCrawlDuration(durationMillis);
			websiteStat.setLogDate(DATE);
			websiteStat.setWebsite(webSite);
			analyzerDAO.saveWebsiteStat(websiteStat);
			analyzerDAO.updateCrawlDateofWebsite(website);

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public String getInput() {
		return input;
	}

	public void setInput(String input) {
		this.input = input;
	}

	public HashMap<String, Integer> getWordMap() {
		return wordMap;
	}

	public void setWordMap(HashMap<String, Integer> wordMap) {
		this.wordMap = wordMap;
	}

}


text:
layout: page
title: "SOCY 4841: Independent Study in Sociology Statistics"
comments: true
description: "blanks"
keywords: "SOCY,4841,CU,Boulder"
---

#### GRADE AND WORKLOAD STATISTICS

**Percent withdrawn**: 4.17%

**Percent incomplete**: 0.0%

**Average grade** (4.0 scale): 4.0

**Standard deviation in grades** (4.0 scale): 0.0

**Average workload** (raw): 0.0

**Standard deviation in workload** (raw): 0.0

#### COURSE AND INSTRUCTOR RATINGS/INFORMATION

**Average course rating** (6 point scale): 0.0

**Standard deviation in course rating** (6 point scale): 0.0

**Average instructor rating** (6 point scale): 0.0

**Standard deviation in instructor rating** (6 point scale): 0.0

**Instructors**: Patti Adler, Sara Steen

#### GENERAL CLASS INFORMATION

**Years provided**: Spring 2008, Fall 2010

**Credits**: 1

**RAP/Honors class?** Neither

**Number of Sections**: 2

**Department**: SOCY

**College**: College of Arts and Sciences

**A&S Division**: Social Sciences

**Level**: Upper

**Activity**: IND - Ind Study


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

    <android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay"
        app:elevation="0dp">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:titleTextAppearance="@style/Toolbar.TitleText">
        </android.support.v7.widget.Toolbar>
    </android.support.design.widget.AppBarLayout>

    <WebView
        android:id="@+id/webView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#987654"/>
</LinearLayout>


text:
2photo_api
==========

Site parser and REST api for 2photo.ru


text:
This repository contains code written for the [Kaggle Diabetic Retinopathy](https://www.kaggle.com/c/diabetic-retinopathy-detection/leaderboard) challenge, and achieved 20th place out of 661 competitors. Read more about the challenge and the creation of this repository [here](http://ilyakava.tumblr.com/post/125230881527/my-1st-kaggle-convnet-getting-to-3rd-percentile).

While I competed in the challenge, this project evolved into my personal general purpose framework for training Deep Convolutional Neural Networks. It is built on top of [theano](http://deeplearning.net/software/theano/), [Lasagne](http://lasagne.readthedocs.org/en/latest/#), [pylearn2](http://deeplearning.net/software/pylearn2/) and many other general purpose python libraries.

**Features in this framework:**

- network architecture via json
    - nonlinearities, initialization, CONV filters, FC size, CONV+FC dropout+(pooling size+stride+overlap), and padding
- data augmentation (`cmd` line options)
    - color casting
    - flipping
    - jittering
- data handling
    - image normalize/standardization (`cmd` line option)
    - automated creation of image conversion batch files
    - streaming and caching multiple minibatches in GPU (i.e. macrobatches) (`cmd` line option)
    - easy restoring of network parameters: easy to pause then continue training at a later time (`cmd` line option)
    - control over class balance per minibatch (`cmd` line option)
        - classes automatically evenly distributed throughout minibatches
        - custom class (im)balance specifiable
    - consistent training/validation sets by default (`cmd` line option)
    - minibatch shuffling (`cmd` line option)
- evaluation
    - automatic autosave of best results during training
    - plotting CONV layer weights
    - occlusion heatmap studies
    - plotting network results
    - prediction from 1 or more models (`cmd` line option)
- misc `cmd` line options
    - multiple error functions
        - cross+relative entropy
        - nnrank
        - mse
        - error function code is easy to swap
    - learning rate, flipping noise decay controllable
    - color/grayscale switching
    - number output classes configurable
    - label/image source
    - CPU or GPU
    - c01b or bc01
    - detects if fundus image was taken with indirect or direct ophthalmoscope with 90% accuracy (using identification tab from indirect ophthalmoscopes)

# Getting Started

## Code (tested on Ubuntu 14.10)

### Install for a new Machine

`sudo apt-get install -y git python-pip python-yaml python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose libfreetype6-dev libpng-dev`

### Install General Python deps:

`sudo pip install theano scikit-learn scikit-image nyanbar natsort`

- If `skimage.io` has issues, try: `sudo pip install -U scikit-image`.
- I used theano version '0.7.0'

### Install Lasagne

```
git clone https://github.com/Lasagne/Lasagne.git && cd Lasagne/ && git checkout 4e4f2f4fdefdab6c2634c7ba080dc3e036782378 && pip install -r requirements.txt && sudo python setup.py install && cd ..
```

### Install pylearn2

```
git clone git://github.com/lisa-lab/pylearn2.git && cd pylearn2/ && git checkout 04c77eb9998c9dad1f2efa020736989005cd9c98 && python setup.py develop && sudo python setup.py develop && cd ..
```

#### Create a [~/.theanorc](http://deeplearning.net/software/theano/library/config.html) file

Ex Contents:

```
[global]
floatX = float32
device = gpu0

```

[Override with another device via](http://deeplearning.net/software/theano/library/config.html): `THEANO_FLAGS='device=gpu0'` prefix. Get a list of gpus via: `nvidia-smi -L`.

Also ensure that something like the following lines are in your `~/.bashrc`:

```
export PATH=/usr/local/cuda-7.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH
```

## Competition Data

### Install

`sudo apt-get install -y p7zip-full graphicsmagick`

### Download & Unpack Data (~45 mins for test)

Download from [kaggle](https://www.kaggle.com/c/diabetic-retinopathy-detection/data?trainLabels.csv.zip) (maybe with w3m) and place in `data/train`, to unpack run:

`7z e -oorig/ train.zip.001`

This will place the images into `data/train/orig`

After placing the test zip files into `data/test` you can run a similar command `7z e -oorig/ test.zip.001` to place the images into `data/test/orig`

Place `trainLabels.csv` into `data/train`

### Preparing Data for the Network

#### Full Size Originals -> Smaller Originals (~2.5 images per second on single CPU)

(Ex) This will create 3 batchfiles for graphicsmagick to output 128x128 pngs:

```
mkdir data/train/centered_crop
python my_code/create_resize_batchfiles.py data/train/orig/ data/train/centered_crop/ 2 128 3
```

Then follow the on screen directions, which will list what commands to run to process the images cataloged in the generated batchfiles.

Depending on how your CPU schedules, more than 1 batchfile may not result in any speedup (3 is the best size for me however).

## The Competition Network

### Training the network

#### Running on CPU

It is possible to run the network on a cpu, though keep in mind it is 15 times slower to train a single batch of size 128!* There are two things to keep in mind:

1. prefix your python command with: `THEANO_FLAGS='device=cpu'`
2. you must use the command line options `-cc 0 -fs bc01` when you run the network.

*On an Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz with the default network on 128px images, it takes 54.8 mins per epoch on the CPU versus 3.7 mins/epoch on the GPU.

#### Easiest to train

`python -m my_code.VGGNet -x 160`

#### My 2nd best Network (Kappa ~0.72)

`python -m my_code.VGGNet -d data/train/cent_crop_192/ -n vgg_mini7b_leak_sig_ecp -x 200`

#### My best Network (Kappa ~0.74)

`python -m my_code.VGGNet -d data/train/cent_crop_256/ -n vgg_mini7b_leak_sig_ecp -x 200`

#### Seeing Validation Kappa/Error over time

`python -m my_code.plot_results -f results/best_results.pkl`

### Testing a single network

`python -m my_code.predict -M models/modelfile.pkl -D data/test/cent_crop_192/`

*This command will print out where it saves a *.csv file submittable to Kaggle, as well as a *.pkl file containing the network's raw outputs, ready to be ensembled with other raw outputs.*

### Combining/Ensembling test output

`python -m my_code.avg_raw_ouputs results/my_2nd_best.pkl,results/my_1st_best.pkl`

*Combine "My 2nd best Network" with "My best Network" to get a Kappa ~0.76*

### Comparing csvs for overlap

`python -m my_code.compare_csv data/train/trainLabels.csv results/result1.csv`

### Occlusion heatmap study

`python -m my_code.plot_occluded_activations -M models/mymodel.pkl -D data/train/centered_crop/41188_right.png`

# Misc

## Running tests

`make test`

## Getting Help

- [SO](http://stackoverflow.com/questions/tagged/neural-network)
- [DataScience Beta](http://datascience.stackexchange.com/questions/tagged/deep-learning)
- [CrossValidated](http://stats.stackexchange.com/questions/tagged/deep-learning)

## Image Alignment (~3 seconds per image)

To reduce noise in the training dataset, detect which images are inverted (taken with an indirect ophthalmoscope) and which are left/right, and invert the images until optic nerve is on the right side of the image.

`python my_code/batch_align.py data/train/orig/ n i`

This will run the ith of n partitions that creates a csv of which inversions to perform on the images in that partition. For example, you could run:

`python my_code/batch_align.py data/train/orig/ 3 1`
`python my_code/batch_align.py data/train/orig/ 3 2`
`python my_code/batch_align.py data/train/orig/ 3 3`

In three different `screen` sessions for parallel processing. Each will report having created a csv file. You can join these multiple csvs into one with: `awk 'FNR==1 && NR!=1{next;}{print}' *.csv > my.csv`

A 90% accurate alignment of the training set is made available [here](https://www.dropbox.com/s/it1e3rjh25020mq/kaggle-dr-alignment-training.csv?dl=0). `horizontal_flip == 1` means the image should be flipped on its horizontal axis (upside-down). `vertical_flip == 1` means the image should be flipped on its vertical axis (left-right). Doing both of the flips as specified in the csv file will lead to 90% of the training images having the optic nerve on the right, slightly above the horizontal.


text:
This is the source code of the [Golo Web Console](http://golo-console.appspot.com) that runs on Google App Engine.

## Usage

You may run it locally using the AppEngine plugin:

    mvn appengine:devserver

You may alternatively use the Jetty plugin for live-reloads:

    mvn jetty:run

## License

    Copyright (C) 2013 Julien Ponge

    Permission is hereby granted, free of charge, to any person obtaining a copy of
    this software and associated documentation files (the "Software"), to deal in
    the Software without restriction, including without limitation the rights to
    use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
    the Software, and to permit persons to whom the Software is furnished to do so,
    subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
    FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
    COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
    IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Running inside Docker

[Docker](http://docker.io/) is an increasingly popular container solution. We provide a Docker image
that can be built from this source code, see the `Dockerfile`.

Build and run cheatsheet:

    $ docker build -t jponge/docker-golo-console .
    $ docker run -p 18080:8080 -d jponge/docker-golo-console


text:
package tethys.derivation.builder

import java.util.regex.Pattern

import scala.annotation.StaticAnnotation

trait FieldStyle  { self =>
  def applyStyle(field: String): String

  def andThen(that: FieldStyle): FieldStyle = new FieldStyle {
    override def applyStyle(field: String): String = that.applyStyle(self.applyStyle(field))
  }

  def andThen(that: String => String): FieldStyle = new FieldStyle {
    override def applyStyle(field: String): String = that.apply(self.applyStyle(field))
  }

  def >>(that: FieldStyle): FieldStyle = andThen(that)
  def >>(that: String => String): FieldStyle = andThen(that)
}

object FieldStyle {

  def apply(fun: String => String): FieldStyle = new FieldStyle {
    override def applyStyle(field: String): String = fun(field)
  }

  class Ref(fieldStyle: FieldStyle) extends StaticAnnotation
  trait StyleReference extends FieldStyle {
    final override def applyStyle(field: String): String = throw new RuntimeException("StyleReference should not be used at runtime")
  }

  // Names transformations adopted from scala enumeratum
  private val regexp1: Pattern = Pattern.compile("([A-Z]+)([A-Z][a-z])")
  private val regexp2: Pattern = Pattern.compile("([a-z\\d])([A-Z])")
  private val replacement: String = "$1_$2"

  private def splitName(name: String): List[String] = {
    val first = regexp1.matcher(name).replaceAll(replacement)
    regexp2.matcher(first).replaceAll(replacement).split("_").toList
  }

  val snakecase: FieldStyle = new FieldStyle {
    override def applyStyle(field: String): String = splitName(field).mkString("_")
  }

  val lowercase: FieldStyle = new FieldStyle {
    override def applyStyle(field: String): String = field.toLowerCase()
  }

  val uppercase: FieldStyle = new FieldStyle {
    override def applyStyle(field: String): String = field.toUpperCase()
  }

  val kebabcase: FieldStyle = new FieldStyle {
    override def applyStyle(field: String): String = splitName(field).mkString("-")
  }

  val lowerSnakecase: FieldStyle = snakecase >> lowercase
  val upperSnakecase: FieldStyle = snakecase >> uppercase
  val lowerKebabcase: FieldStyle = kebabcase >> lowercase
  val upperKebabcase: FieldStyle = kebabcase >> uppercase
}


text:
package org.zstack.header.errorcode;

import org.zstack.header.exception.CloudRuntimeException;
import org.zstack.utils.gson.JSONObjectUtil;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Objects;

public class ErrorCode implements Serializable, Cloneable {
    private String code;
    private String description;
    private String details;
    private String elaboration;
    private ErrorCode cause;
    private LinkedHashMap opaque;

    public LinkedHashMap getOpaque() {
        return opaque;
    }

    public void setOpaque(LinkedHashMap opaque) {
        this.opaque = opaque;
    }

    public void putToOpaque(String key, Object value) {
        if (opaque == null) {
            opaque = new LinkedHashMap();
        }
        opaque.put(key, value);
    }

    public Object getFromOpaque(String key) {
        return opaque == null ? null : opaque.get(key);
    }

    public ErrorCode() {
    }

    public ErrorCode(String code, String description) {
        super();
        this.code = code;
        this.description = description;
    }

    public ErrorCode(String code, String description, String details) {
        super();
        this.code = code;
        this.description = description;
        this.details = details;
    }

    public ErrorCode(ErrorCode other) {
        this.code = other.code;
        this.description = other.description;
        this.details = other.details;
        this.elaboration = other.elaboration;
        this.cause = other.cause;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    public ErrorCode copy() {
        try {
            return (ErrorCode) this.clone();
        } catch (CloneNotSupportedException e) {
            throw new CloudRuntimeException(e);
        }
    }

    @Override
    public String toString() {
        return JSONObjectUtil.toJsonString(this);
    }

    public static ErrorCode fromString(String err) {
        String arr = err.replace("ErrorCode", "").replace("[", "").replace("]", "").trim();
        try {
            String[] items = arr.split(",");
            ErrorCode code = new ErrorCode(items[0].split("=")[1].trim(), items[1].split("=")[1].trim());
            code.setDetails(items[2].split("=")[1].trim());
            return code;
        } catch (Exception e) {
            throw new IllegalArgumentException(String.format("Cannot deserialize string[%s] to ErrorCode", err), e);
        }
    }

    public ErrorCode getCause() {
        return cause;
    }

    public void setCause(ErrorCode cause) {
        this.cause = cause;
    }

    public ErrorCode causedBy(ErrorCode cause) {
        setCause(cause);
        return this;
    }

    public ErrorCode causedBy(List<ErrorCode> cause) {
        ((ErrorCodeList) this).setCauses(cause);
        return this;
    }

    public String getElaboration() {
        return elaboration;
    }

    public void setElaboration(String elaboration) {
        this.elaboration = elaboration;
    }

    public boolean isError(Enum... errorEnums) {
        for (Enum e : errorEnums) {
            if (e.toString().equals(getCode())) {
                return true;
            }
        }

        return false;
    }

    @Override
    public boolean equals(Object t) {
        if (this == t){
            return true;
        }
        if (!(t instanceof ErrorCode)){
            return false;
        }

        ErrorCode other = (ErrorCode)t;
        return Objects.equals(this.code, other.code) &&
                Objects.equals(this.cause, other.cause) &&
                Objects.equals(this.details, other.details) &&
                Objects.equals(this.opaque, other.opaque);
    }

    @Override
    public int hashCode() {
        StringBuilder sb = new StringBuilder();
        sb.append(code == null ? "" : code);
        sb.append(details == null ? "" : details);
        sb.append(opaque == null ? "" : opaque);
        sb.append(cause == null ? "" : cause.toString());
        return sb.toString().hashCode();
    }
}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.Windows.Automation;
using System.Windows.Automation.Peers;
using System.Windows.Automation.Provider;

namespace Microsoft.SSHDebugPS.UI
{
    /// <summary>
    /// This automationpeer class is here to support the custom expand/collapse action on the listbox item
    /// </summary>
    /// <typeparam name="T">Must be IContainerViewModel</typeparam>
    public class ContainerListBoxItemAutomationPeer<T> :
        ListBoxItemAutomationPeer,
        IExpandCollapseProvider
        where T : IContainerViewModel
    {
        public ContainerListBoxItemAutomationPeer(object item, ContainerListBoxAutomationPeer ownerAutomationPeer)
            : base(item, ownerAutomationPeer)
        { }

        /// <summary>
        /// Item is from the constructor and is the IContainerViewModel, not the listboxitem
        /// </summary>
        protected T ViewModel
        {
            get
            {
                return (T)Item;
            }
        }

        #region IExpandCollapseProvider
        public ExpandCollapseState ExpandCollapseState
        {
            get
            {
                return ViewModel.IsExpanded ? ExpandCollapseState.Expanded : ExpandCollapseState.Collapsed;
            }
        }

        public void Expand()
        {
            ViewModel.IsExpanded = true;
        }

        public void Collapse()
        {
            ViewModel.IsExpanded = false;
        }
        #endregion

        public override object GetPattern(PatternInterface patternInterface)
        {
            if (patternInterface == PatternInterface.ExpandCollapse)
            {
                return this;
            }

            return base.GetPattern(patternInterface);
        }

        #region Core overrides
        protected override AutomationControlType GetAutomationControlTypeCore()
        {
            return AutomationControlType.ListItem;
        }

        protected override string GetLocalizedControlTypeCore()
        {
            return ControlType.Button.LocalizedControlType;
        }

        protected override string GetNameCore()
        {
            return ViewModel.ContainerAutomationName;
        }

        protected override bool IsKeyboardFocusableCore()
        {
            return true;
        }
        #endregion
    }
}


text:
	Buy Coins

				{{rewardCoins}}
				<button ion-button class="buy video"  ng-click="rewardVideo($event)" >Watch Video</button>

			  {{product.title}}
			   + No Ads
			  <button ion-button class="buy" ng-click="buyProduct($event, product.productId)" > {{product.price}}</button>

Cannot make a purchase now, please try again later

{{rewardCoins}}


text:
My first project
Hello there,

This is a readme edit.

Anothe edit to the readme file.


text:
<?php

namespace Hyyan\WPI\Admin;

/**
 * Features
 *
 * @author Hyyan
 */
class Features extends AbstractSettings
{

    /**
     * {@inheritdocs}
     */
    public static function getID()
    {
        return 'wpi-features';
    }

    /**
     * {@inheritdocs}
     */
    protected function doGetSections()
    {
        return array(
            array(
                'title' => __('Features', 'woo-poly-integration'),
                'desc' => __(
                        ' The section will allow you to Enable/Disable
                          Plugin Features.'
                        , 'woo-poly-integration'
                )
            )
        );
    }

    /**
     * {@inheritdocs}
     */
    protected function doGetFields()
    {
        return array(
            array(
                'name' => 'fields-locker',
                'type' => 'checkbox',
                'default' => 'on',
                'label' => __('Fields Locker', 'woo-poly-integration'),
                'desc' => __(
                        'Fields locker makes it easy for user to know which
                         field to translate and which to ignore '
                        , 'woo-poly-integration'
                )
            ),
            array(
                'name' => 'emails',
                'type' => 'checkbox',
                'default' => 'on',
                'label' => __('Emails', 'woo-poly-integration'),
                'desc' => __(
                        'Use order language whenever woocommerce sends order emails'
                        , 'woo-poly-integration'
                )
            ),
            array(
                'name' => 'reports',
                'type' => 'checkbox',
                'default' => 'on',
                'label' => __('Reports', 'woo-poly-integration'),
                'desc' => __(
                        'Enable reports langauge filtering and combining'
                        , 'woo-poly-integration'
                )
            ),
            array(
                'name' => 'coupons',
                'type' => 'checkbox',
                'default' => 'on',
                'label' => __('Coupons Sync', 'woo-poly-integration'),
                'desc' => __(
                        'Apply coupons rules for product and its translations'
                        , 'woo-poly-integration'
                )
            ),
            array(
                'name' => 'stock',
                'type' => 'checkbox',
                'default' => 'on',
                'label' => __('Stock Sync', 'woo-poly-integration'),
                'desc' => __(
                        'Sync stock for product and its translations'
                        , 'woo-poly-integration'
                )
            ),
            array(
                'name' => 'categories',
                'type' => 'checkbox',
                'default' => 'on',
                'label' => __('Translate Categories', 'woo-poly-integration'),
                'desc' => __(
                        'Enable categories translations'
                        , 'woo-poly-integration'
                )
            ),
            array(
                'name' => 'tags',
                'type' => 'checkbox',
                'default' => 'on',
                'label' => __('Translate Tags', 'woo-poly-integration'),
                'desc' => __(
                        'Enable tags translations'
                        , 'woo-poly-integration'
                )
            ),
            array(
                'name' => 'attributes',
                'type' => 'checkbox',
                'default' => 'on',
                'label' => __('Translate Attributes', 'woo-poly-integration'),
                'desc' => __(
                        'Enable Attributes translations'
                        , 'woo-poly-integration'
                )
            ),
            array(
                'name' => 'shipping-class',
                'type' => 'checkbox',
                'default' => 'off',
                'label' => __('Translate ShippingClass', 'woo-poly-integration'),
                'desc' => __(
                        'Enable ShippingClass translations'
                        , 'woo-poly-integration'
                )
            )
        );
    }

}


text:
namespace WebApiAngularJsAzureUploader.Areas.HelpPage
{
    /// <summary>
    /// Indicates whether the sample is used for request or response
    /// </summary>
    public enum SampleDirection
    {
        Request = 0,
        Response
    }
}


text:
package org.apache.activemq.artemis.tests.integration.client;

import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.ActiveMQIllegalStateException;
import org.apache.activemq.artemis.api.core.ActiveMQObjectClosedException;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.api.core.client.ClientConsumer;
import org.apache.activemq.artemis.api.core.client.ClientMessage;
import org.apache.activemq.artemis.api.core.client.ClientProducer;
import org.apache.activemq.artemis.api.core.client.ClientSession;
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
import org.apache.activemq.artemis.api.core.client.MessageHandler;
import org.apache.activemq.artemis.api.core.client.ServerLocator;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.tests.integration.mqtt.imported.util.Wait;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class ReceiveTest extends ActiveMQTestBase {

   SimpleString addressA = new SimpleString("addressA");

   SimpleString queueA = new SimpleString("queueA");

   private ServerLocator locator;

   private ActiveMQServer server;

   @Override
   @Before
   public void setUp() throws Exception {
      super.setUp();

      locator = createInVMNonHALocator();
      server = createServer(false);
      server.start();
   }

   @Test
   public void testBasicReceive() throws Exception {
      ClientSessionFactory cf = createSessionFactory(locator);
      ClientSession sendSession = cf.createSession(false, true, true);
      ClientProducer cp = sendSession.createProducer(addressA);
      ClientSession session = cf.createSession(false, true, true);
      session.createQueue(addressA, queueA, false);
      ClientConsumer cc = session.createConsumer(queueA);
      session.start();
      cp.send(sendSession.createMessage(false));
      Assert.assertNotNull(cc.receive());
      session.close();
      sendSession.close();
   }

   @Test
   public void testReceiveTimesoutCorrectly() throws Exception {

      ClientSessionFactory cf = createSessionFactory(locator);
      ClientSession session = cf.createSession(false, true, true);
      session.createQueue(addressA, queueA, false);
      ClientConsumer cc = session.createConsumer(queueA);
      session.start();
      long time = System.currentTimeMillis();
      cc.receive(1000);
      Assert.assertTrue(System.currentTimeMillis() - time >= 1000);
      session.close();
   }

   @Test
   public void testReceiveOnClosedException() throws Exception {

      ClientSessionFactory cf = createSessionFactory(locator);
      ClientSession session = cf.createSession(false, true, true);
      session.createQueue(addressA, queueA, false);
      ClientConsumer cc = session.createConsumer(queueA);
      session.start();
      session.close();
      try {
         cc.receive();
         Assert.fail("should throw exception");
      } catch (ActiveMQObjectClosedException oce) {
         //ok
      } catch (ActiveMQException e) {
         Assert.fail("Invalid Exception type:" + e.getType());
      }
      session.close();
   }

   @Test
   public void testReceiveThrowsExceptionWhenHandlerSet() throws Exception {

      ClientSessionFactory cf = createSessionFactory(locator);
      ClientSession session = cf.createSession(false, true, true);
      session.createQueue(addressA, queueA, false);
      ClientConsumer cc = session.createConsumer(queueA);
      session.start();
      cc.setMessageHandler(new MessageHandler() {
         @Override
         public void onMessage(final ClientMessage message) {
         }
      });
      try {
         cc.receive();
         Assert.fail("should throw exception");
      } catch (ActiveMQIllegalStateException ise) {
         //ok
      } catch (ActiveMQException e) {
         Assert.fail("Invalid Exception type:" + e.getType());
      }
      session.close();
   }

   @Test
   public void testReceiveImmediate() throws Exception {

      // forces perfect round robin
      locator.setConsumerMaxRate(1);
      ClientSessionFactory cf = createSessionFactory(locator);
      ClientSession sendSession = cf.createSession(false, true, true);
      ClientProducer cp = sendSession.createProducer(addressA);
      ClientSession session = cf.createSession(false, true, true);
      session.createQueue(addressA, queueA, false);
      ClientConsumer cc = session.createConsumer(queueA);
      ClientConsumer cc2 = session.createConsumer(queueA);
      session.start();
      cp.send(sendSession.createMessage(false));
      cp.send(sendSession.createMessage(false));
      cp.send(sendSession.createMessage(false));
      sendSession.commit();

      final Queue queue = server.locateQueue(queueA);

      Wait.waitFor(new Wait.Condition() {
         @Override
         public boolean isSatisified() throws Exception {
            return queue.getMessageCount() == 3;
         }
      });

      Assert.assertNotNull(cc2.receive(5000));
      Assert.assertNotNull(cc.receive(5000));
      if (cc.receiveImmediate() == null) {
         Assert.assertNotNull(cc2.receiveImmediate());
      }
      session.close();
      sendSession.close();
   }
}


text:
from singleton import Singleton
from aiohttp import web
import os

class HTTPserver(metaclass=Singleton):
    def __init__(self):
        self.SERVER_DIR = os.path.dirname(os.path.abspath(__file__))
        self.PROJECT_DIR = os.path.join( os.path.dirname( __file__ ), '..' )

        self.app = web.Application()

    async def index(self, request):
        with open(self.PROJECT_DIR+'/client/dist/index.html') as f:
            return web.Response(text=f.read(), content_type='text/html')

    def start(self):
        self.app.router.add_get('/', self.index)
        self.app.router.add_static('/', self.PROJECT_DIR+'/client/dist', show_index=True)
        web.run_app(self.app, port=80)


text:
namespace Cassandra
{
    ///
    ///  A retry policy that sometimes retry with a lower consistency level than the
    ///  one initially requested.
 BEWARE: This policy may retry queries
    ///  using a lower consistency level than the one initially requested. By doing
    ///  so, it may break consistency guarantees. In other words, if you use this
    ///  retry policy, there is cases (documented below) where a read at
    ///  <c>Quorum</c> may not see a preceding write at
    ///  <c>Quorum</c>. Do not use this policy unless you have understood the
    ///  cases where this can happen and are OK with that. It is also highly
    ///  recommended to always wrap this policy into <see cref="LoggingRetryPolicy"/>
    ///  to log the occurrences of such consistency break.

 This policy : the same
    ///  retries than the <link>DefaultRetryPolicy</link> policy. But on top of that,
    ///  it also retries in the following cases:

On a read timeout: if the
    ///  number of replica that responded is greater than one but lower than is
    ///  required by the requested consistency level, the operation is retried at a
    ///  lower consistency level.

On a write timeout: if the operation is an
    ///  <c>WriteType.UNLOGGED_BATCH</c> and at least one replica acknowledged
    ///  the write, the operation is retried at a lower consistency level.
    ///  Furthermore, for other operation, if at least one replica acknowledged the
    ///  write, the timeout is ignored.

On an unavailable exception: if at
    ///  least one replica is alive, the operation is retried at a lower consistency
    ///  level.

 The reasoning behind this retry policy is the following
    ///  one. If, based on the information the Cassandra coordinator node returns,
    ///  retrying the operation with the initially requested consistency has a change
    ///  to succeed, do it. Otherwise, if based on these informations we know the
    ///  initially requested consistency level cannot be achieve currently, then:
    ///

For writes, ignore the exception (thus silently failing the
    ///  consistency requirement) if we know the write has been persisted on at least
    ///  one replica.

For reads, try reading at a lower consistency level
    ///  (thus silently failing the consistency requirement).

 In other
    ///  words, this policy : the idea that if the requested consistency level cannot
    ///  be achieved, the next best thing for writes is to make sure the data is
    ///  persisted, and that reading something is better than reading nothing, even if
    ///  there is a risk of reading stale data.

    ///
    public class DowngradingConsistencyRetryPolicy : IRetryPolicy
    {
        public static DowngradingConsistencyRetryPolicy Instance = new DowngradingConsistencyRetryPolicy();

        private DowngradingConsistencyRetryPolicy()
        {
        }

        ///
        ///  Defines whether to retry and at which consistency level on a read timeout.
        ///
 This method triggers a maximum of one retry. If less replica responsed
        ///  than required by the consistency level (but at least one replica did
        ///  respond), the operation is retried at a lower consistency level. If enough
        ///  replica responded but data was not retrieve, the operation is retried with
        ///  the initial consistency level. Otherwise, an exception is thrown.

        ///
        /// <param name="query"> the original query that timeouted. </param>
        /// <param name="cl"> the original consistency level of the read that timeouted.
        ///  </param>
        /// <param name="requiredResponses"> the number of responses that were required
        ///  to achieve the requested consistency level. </param>
        /// <param name="receivedResponses"> the number of responses that had been
        ///  received by the time the timeout exception was raised. </param>
        /// <param name="dataRetrieved"> whether actual data (by opposition to data
        ///  checksum) was present in the received responses. </param>
        /// <param name="nbRetry"> the number of retry already performed for this
        ///  operation. </param>
        ///
        /// <returns>a RetryDecision as defined above.</returns>
        public RetryDecision OnReadTimeout(IStatement query, ConsistencyLevel cl, int requiredResponses, int receivedResponses, bool dataRetrieved,
                                           int nbRetry)
        {
            if (nbRetry != 0)
                return RetryDecision.Rethrow();

            if (receivedResponses < requiredResponses)
            {
                // Tries the biggest CL that is expected to work
                return MaxLikelyToWorkCl(receivedResponses);
            }

            return !dataRetrieved ? RetryDecision.Retry(cl) : RetryDecision.Rethrow();
        }

        ///
        ///  Defines whether to retry and at which consistency level on a write timeout.
        ///
 This method triggers a maximum of one retry. If <c>writeType ==
        ///  WriteType.BATCH_LOG</c>, the write is retried with the initial consistency
        ///  level. If <c>writeType == WriteType.UNLOGGED_BATCH</c> and at least one
        ///  replica acknowleged, the write is retried with a lower consistency level
        ///  (with unlogged batch, a write timeout can always mean that part of the
        ///  batch haven't been persisted at' all, even if <c>receivedAcks > 0</c>).
        ///  For other <c>writeType</c>, if we know the write has been persisted on
        ///  at least one replica, we ignore the exception. Otherwise, an exception is
        ///  thrown.

        ///
        /// <param name="query"> the original query that timeouted. </param>
        /// <param name="cl"> the original consistency level of the write that timeouted.
        ///  </param>
        /// <param name="writeType"> the type of the write that timeouted. </param>
        /// <param name="requiredAcks"> the number of acknowledgments that were required
        ///  to achieve the requested consistency level. </param>
        /// <param name="receivedAcks"> the number of acknowledgments that had been
        ///  received by the time the timeout exception was raised. </param>
        /// <param name="nbRetry"> the number of retry already performed for this
        ///  operation. </param>
        ///
        /// <returns>a RetryDecision as defined above.</returns>
        public RetryDecision OnWriteTimeout(IStatement query, ConsistencyLevel cl, string writeType, int requiredAcks, int receivedAcks, int nbRetry)
        {
            if (nbRetry != 0)
                return RetryDecision.Rethrow();

            switch (writeType)
            {
                case "SIMPLE":
                case "BATCH":
                    // Since we provide atomicity there is no point in retrying
                    return RetryDecision.Ignore();
                case "COUNTER":
                    // We should not retry counters, period!
                    return RetryDecision.Ignore();
                case "UNLOGGED_BATCH":
                    // Since only part of the batch could have been persisted,
                    // retry with whatever consistency should allow to persist all
                    return MaxLikelyToWorkCl(receivedAcks);
                case "BATCH_LOG":
                    return RetryDecision.Retry(cl);
            }
            return RetryDecision.Rethrow();
        }

        ///
        ///  Defines whether to retry and at which consistency level on an unavailable
        ///  exception.
 This method triggers a maximum of one retry. If at least one
        ///  replica is know to be alive, the operation is retried at a lower consistency
        ///  level.

        ///
        /// <param name="query"> the original query for which the consistency level
        ///  cannot be achieved. </param>
        /// <param name="cl"> the original consistency level for the operation. </param>
        /// <param name="requiredReplica"> the number of replica that should have been
        ///  (known) alive for the operation to be attempted. </param>
        /// <param name="aliveReplica"> the number of replica that were know to be alive
        ///  by the coordinator of the operation. </param>
        /// <param name="nbRetry"> the number of retry already performed for this
        ///  operation. </param>
        ///
        /// <returns>a RetryDecision as defined above.</returns>
        public RetryDecision OnUnavailable(IStatement query, ConsistencyLevel cl, int requiredReplica, int aliveReplica, int nbRetry)
        {
            return nbRetry != 0 ? RetryDecision.Rethrow() : MaxLikelyToWorkCl(aliveReplica);

            // Tries the biggest CL that is expected to work
        }

        private static RetryDecision MaxLikelyToWorkCl(int knownOk)
        {
            if (knownOk >= 3)
                return RetryDecision.Retry(ConsistencyLevel.Three);
            if (knownOk >= 2)
                return RetryDecision.Retry(ConsistencyLevel.Two);
            if (knownOk >= 1)
                return RetryDecision.Retry(ConsistencyLevel.One);
            return RetryDecision.Rethrow();
        }
    }
}


text:
angular.module('KitchenSink')
    .controller('FormsPatternController', ['$scope', 'bbModal', function ($scope, bbModal) {
        $scope.locals = {
            openForm: function () {
                bbModal.open({
                    templateUrl: 'patterns/forms/modalform.html'
                });
            }
        };
    }])
    .controller('FormsModalPatternController', ['$scope', function ($scope) {
        $scope.locals = {
            save: function () {

            }
        };
    }]);


text:
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

import os
import sys
from glob import glob
from typing import List

ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir))

def check_dir_init_file(provider_files: List[str]) -> None:
    missing_init_dirs = []
    for path in provider_files:
        if path.endswith("/__pycache__"):
            continue
        if os.path.isdir(path) and not os.path.exists(os.path.join(path, "__init__.py")):
            missing_init_dirs.append(path)

    if missing_init_dirs:
        with open(os.path.join(ROOT_DIR, "license-templates/LICENSE.txt")) as license:
            license_txt = license.readlines()
        prefixed_licensed_txt = [f"# {line}" if line != "\n" else "#\n" for line in license_txt]

        for missing_init_dir in missing_init_dirs:
            with open(os.path.join(missing_init_dir, "__init__.py"), "w") as init_file:
                init_file.write("".join(prefixed_licensed_txt))

        print("No __init__.py file was found in the following provider directories:")
        print("\n".join(missing_init_dirs))
        print("\nThe missing __init__.py files have been created. Please add these new files to a commit.")
        sys.exit(1)

if __name__ == "__main__":
    all_provider_subpackage_dirs = sorted(glob(f"{ROOT_DIR}/airflow/providers/**/*", recursive=True))
    check_dir_init_file(all_provider_subpackage_dirs)
    all_test_provider_subpackage_dirs = sorted(glob(f"{ROOT_DIR}/tests/providers/**/*", recursive=True))
    check_dir_init_file(all_test_provider_subpackage_dirs)


text:
package com.facebook.buck.core.module;

import com.google.common.collect.ImmutableSortedSet;

/** Provides access to module information. */
public interface BuckModuleManager {

  boolean isClassInModule(Class<?> cls);

  String getModuleHash(Class<?> cls);

  /** @return the hash of module's content (which includes code and resources.) */
  String getModuleHash(String moduleId);

  /** @return IDs of all modules known to this instance. */
  ImmutableSortedSet<String> getModuleIds();

  /** @return IDs of all modules the provided module depends on. */
  ImmutableSortedSet<String> getModuleDependencies(String moduleId);
}


text:
package com.rogueai.framework.snmp2bean.api.snmp4J.impl;

import java.io.IOException;

import org.snmp4j.PDU;
import org.snmp4j.Snmp;
import org.snmp4j.Target;
import org.snmp4j.event.ResponseEvent;

public class Snmp4JWrapperImpl<T> implements Snmp4JWrapper {

    private final Snmp snmp;

    public Snmp4JWrapperImpl(Snmp snmp) {
        this.snmp = snmp;
    }

    public Snmp getSnmp() {
        return snmp;
    }

    public ResponseEvent get(PDU pdu, Target target) {
        try {
            return snmp.get(pdu, target);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    public ResponseEvent getNext(PDU pdu, Target target) {
        try {
            return snmp.getNext(pdu, target);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }

    public void close() {
        try {
            snmp.close();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public ResponseEvent set(PDU pdu, Target target) {
        try {
            return snmp.set(pdu, target);
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }
}