text:
#ifndef H_OGUI_MANAGER
#define H_OGUI_MANAGER

#include <functional>
#include <list>
#include <memory>
#include <xstring.h>
#include <input_callback.h>
#include <ogui/font.h>

namespace OGUI {

class   Layout;
class   Widget;
typedef std::shared_ptr<Widget> widget_ptr;
typedef std::shared_ptr<Layout> layout_ptr;
typedef std::function<void(xstring,xstring,xstring)> event_callback;
#define OGUI_EVENT_CALLBACK [this](const xstring& name, const xstring& event_type, const xstring& param)
#define OGUI_EVENT_CALLBACK1(x1) [this,x1](const xstring& name, const xstring& event_type, const xstring& param)
#define OGUI_EVENT_CALLBACK2(x1,x2) [this,x1,x2](const xstring& name, const xstring& event_type, const xstring& param)
#define OGUI_EVENT_CALLBACK3(x1,x2,x3) [this,x1,x2,x3](const xstring& name, const xstring& event_type, const xstring& param)
#define OGUI_EVENT_CALLBACK_FUNC [](const xstring& name, const xstring& event_type, const xstring& param)

/** Main OGUI coordination singleton class */
class OGUIManager : public InputCallback
{
public:
  static OGUIManager* instance()
  {
    static std::unique_ptr<OGUIManager> ptr(new OGUIManager);
    return ptr.get();
  }

  /** Main initialization method.  Must be called once, to indicate the size of
      the virtual desktop
  */
  void        initialize_desktop(int width, int height);

  /** Return the current default font.  Initial font is preloaded automatically */
  font_ptr    get_default_font() { return m_Font; }

  /** Replace the default font with an alternative */
  void        set_default_font(font_ptr font) { m_Font=font; }

  /** Return a color by using one of the following indices:
  ```
          SKIN_COLOR_DEFAULT_FILL       - Fill color of static widgets
          SKIN_COLOR_BUTTON_HILIGHT     - Top and left highlight of 3D button look
          SKIN_COLOR_BUTTON_LOLIGHT     - Bottom and right highlight of 3D button look
          SKIN_COLOR_CHECK_COLOR        - Color of check mark in checkbox
          SKIN_COLOR_FRAME              - Color of FrameWidget border
          SKIN_COLOR_TABLE_HEADER_BG    - Background color of column headers in a table
          SKIN_COLOR_TABLE_HEADER_TEXT  - Text color of column headers in a table
          SKIN_COLOR_TEXT               - Text color (in TextWidget)
  ```
  */
  unsigned    get_skin_color(SkinColors which);
  void        set_skin_color(SkinColors which, unsigned value);

  /** Return the current skin colors.  */
  const skin_colors& get_skin_colors() const { return m_SkinColors.back(); }

  /** Save the current colors in the stack and place a copy of them on the top.
      This is used during layout XML loading, to allow local sub-tree color overrides
  */
  void               push_color_state();
  void               pop_color_state();

  /** Load color configuration from a file. The file is an XML of format similar to the following:
  ```
  <skin>
    <color name="DEFAULT_FILL" value="0xFF000000"/>
    <color name="TEXT" value="0xFFFF00FF"/>
    .
    .
    .
    .
  </skin>
  ```
  */
  void        load_skin(const xstring& skin_file)
  {
    std::ifstream f(skin_file);
    load_skin(f);
  }

  /** Load color configuration from a stream */
  void        load_skin(std::istream& skin_is);

  /** Register a listener to accept event callbacks.
      The listener_name is needed only for later calls to remove_listener
      target_name is the name of widget that is expected to raise events
      event_type is event type string, which can be one of the following:

      * clicked
      * toggled
      * mouse_move
      * mouse_drag
      * mouse_enter
      * mouse_leave
      * scroll
      * select

      The callback has the prototype of:  func(const xstring& name, const xstring& type, const xstring& param)

      * name        - Name of widget that generated the event
      * type        - Event type (see list above)
      * param       - Free format parameter, depending on event type

      Typical cases use one of the following macros to define a lambda callback:

      * OGUI_EVENT_CALLBACK
      * OGUI_EVENT_CALLBACKx  - where x is a digit indicating number of extra captured variables
      * OGUI_EVENT_CALLBACK_FUNC

      Example:

      ```
      OGUIManager::instance()->add_listener("myname","widget_name","clicked",OGUI_EVENT_CALLBACK_FUNC
      {
        do_something;
      });
      ```

      Calling add_listener on the widget directly shortens the code by using the widget's get_name() as the
      first parameter to this call.

      Example:

      ```
      widget->add_listener("myname","clicked",OGUI_EVENT_CALLBACK_FUNC
      {
      do_something;
      });
      ```

  */
  bool        add_listener(const xstring& listener_name, const xstring& target_name, const xstring& event_type, event_callback callback);

  /** Remove a previously registered listener.
      Using clear() also removes all listeners
  */
  bool        remove_listener(const xstring& listener_name, const xstring& target_name, const xstring& event_type);

  /** Called by widgets to notify with regards to an event that just occurred */
  void        raise_event(const xstring& name, const xstring& type, const xstring& params);

  /** Clear all widgets in the desktop and remove all listeners */
  void        clear();

  /** Return the desktop widget.  Usually used to add child UI elements */
  widget_ptr  get_desktop();

  /** Register a modal widget - See [ModalWidget](ModalWidget)
      All input events are then sent to this widget, until another or an empty widget is assigned
  */
  void        set_modal_widget(widget_ptr w);

  /** Called to direct all mouse events to a specific widget.
      Usually used when a widget is clicked to direct drag events to it, even if the cursor left
      the widget's area
  */
  void        capture_mouse(Widget* w) { m_MouseCapture=w; }

  /** Optionally call this method from the main program loop, to allow widgets to perform asynchronous tasks.
      The dt parameter is optional as well, and indicates the time from the last call to on_idle (in seconds).
      Widgets that want to get idle calls, need to add a listener to the event raised here.
  */
  virtual void on_idle(float dt=0)
  {
    raise_event("manager", "idle", S(dt));
  }

  /** Hook for keyboard events.  Not implemented yet */
  virtual void on_keyboard(unsigned char key) override {}

  virtual void mouse_down(int button, int x, int y) override;
  virtual void mouse_up(int button, int x, int y) override;
  virtual void mouse_move(int x, int y) override;
  virtual void mouse_drag(int x, int y) override;
  virtual void mouse_scroll(int direction) override;
private:
  friend struct std::default_delete<OGUIManager>;

  OGUIManager()
    : m_MouseCapture(0)
  {
    load_default_skin();
  }
  ~OGUIManager() {}
  OGUIManager(const OGUIManager&) {}
  OGUIManager& operator= (const OGUIManager&) { return *this; }

  void load_default_skin();

  typedef std::list<skin_colors> colors_stack;
  colors_stack m_SkinColors;

  widget_ptr& get_event_recipient() { if (m_ModalWidget) return m_ModalWidget; return m_Desktop; }

  widget_ptr            m_Desktop;
  font_ptr              m_Font;
  Widget*               m_MouseCapture;
  widget_ptr            m_LastCursorLeafWidget;
  widget_ptr            m_ModalWidget;

  struct listener
  {
    listener() {}
    listener(const xstring& listener_name, event_callback cb)
      : name(listener_name), callback(cb) {}
    xstring name;
    event_callback callback;
  };
  typedef std::vector<listener> listener_seq;
  typedef std::unordered_map<xstring,listener_seq> listener_map;

  bool remove_listener(const xstring& listener_name, listener_seq& seq);

  listener_map m_Listeners;
};

} // namespace OGUI

#endif // H_OGUI_MANAGER


text:
import cx from 'clsx';
import React from 'react';
import PropTypes from 'prop-types';

const OverlayContent = ({
  className,
  children,
}) => (
  <div className={cx('Overlay-content', className)}>
    {children}
  </div>
);

OverlayContent.propTypes = {
  className: PropTypes.string,
  children: PropTypes.node.isRequired,
};

export default OverlayContent;

redpajama_set_name: RedPajamaGithub


text:
package com.jayqqaa12.system.controller;

import com.jayqqaa12.common.UrlConfig;
import com.jayqqaa12.jbase.jfinal.ext.ctrl.Controller;
import com.jfinal.ext.route.ControllerBind;

@ControllerBind(controllerKey = "/system/chart" ,viewPath=UrlConfig.SYSTEM)
public class ChartController extends Controller
{

}


text:
import unittest

# third-party
from mock import MagicMock

# the ape
from theape.infrastructure.arguments.fetcharguments import Fetch, FetchStrategy
from theape.infrastructure.arguments.basestrategy import BaseStrategy
import theape.infrastructure.arguments.fetcharguments

fetch_usage = theape.infrastructure.arguments.fetcharguments.__doc__
class TestFetchArguments(unittest.TestCase):
    def setUp(self):
        self.args = ['fetch']
        self.arguments = Fetch(args=self.args)
        return

    def test_constructor(self):
        """
        Does it build?
        """
        arguments = Fetch(args=['fetch'])

        # test inheritance
        self.assertFalse(arguments.debug)
        self.assertEqual(fetch_usage, arguments.sub_usage)
        return

    def test_names(self):
        """
        Does it get the list of plugin names?
        """
        # default
        self.assertEqual(['Ape'], self.arguments.names)

        # positionl arguments
        self.arguments.reset()
        names = "apple banana cat".split()
        self.arguments.args = self.args + names
        self.assertEqual(names, self.arguments.names)
        return

    def test_modules(self):
        """
        Does it get a list of external modules?
        """
        # default is None
        self.assertEqual([], self.arguments.modules)

        # add one
        self.arguments.reset()
        modules = ['aoeu']
        options = ['-m'] + modules
        self.arguments.args = self.args + options
        self.assertEqual(modules, self.arguments.modules)

        # add multiple
        self.arguments.reset()
        modules = 'a b c d e'.split()
        options = ['-m'] + " -m".join(modules).split()
        self.arguments.args = self.args + options
        self.assertEqual(modules, self.arguments.modules)
        return

    def test_both(self):
        """
        Can you use both names and modules?
        """
        names = 'ab cd'.split()
        modules = 'a b c d'.split()
        arguments_options = names + ['-m'] + ' -m'.join(modules).split()
        self.arguments.args = self.args + arguments_options
        self.assertEqual(names, self.arguments.names)
        self.assertEqual(modules, self.arguments.modules)
        return
# end TestFetchArguments

class TestFetchStrategy(unittest.TestCase):
    def setUp(self):
        self.quartermaster = MagicMock()
        FetchStrategy.quartemaster = self.quartermaster
        self.strategy = FetchStrategy()
        return

    def test_constructor(self):
        """
        Does it build?
        """
        strategy = FetchStrategy()
        self.assertIsInstance(strategy, BaseStrategy)
        return

    def test_function(self):
        """
        Does it implement the `fetch` strategy?
        """
        self.strategy.quartermaster = self.quartermaster
        args = MagicMock()
        args.names = 'a b c'.split()
        args.modules = 'd e f'.split()
        definition_a, definition_b, definition_c = MagicMock(), MagicMock(), MagicMock()
        definitions = [definition_a, definition_b, definition_c]
        plugin_a, plugin_b, plugin_c = MagicMock(), MagicMock(), MagicMock()
        definition_a.return_value = plugin_a
        definition_b.return_value = plugin_b
        definition_c.return_value = plugin_c

        plugin_source = dict(zip(args.names, definitions))

        def side_effect(name):
            return plugin_source[name]

        self.quartermaster.get_plugin.side_effect = side_effect
        self.strategy.function(args)
        self.assertEqual(self.quartermaster, self.strategy.quartermaster)
        self.assertEqual(self.quartermaster.external_modules, args.modules)
        for definition in definitions:
            definition.return_value.fetch_config.assert_called_with()

        args.names.append('d')
        definition_d = MagicMock()
        definition_d.side_effect = TypeError("unknown plugin")
        plugin_source['d'] = definition_d

        # nothing should happen, because it handles unknown plugins
        self.strategy.function(args)

        # and the decorator handles other errors
        definition_a.side_effect = AttributeError("plugin implementation error")
        self.strategy.function(args)
        return


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycotaxon 7(1): 48 (1978)

#### Original name
Parmelia subelegantula Essl.

### Remarks
null


text:
/**
 * @file RelaxedLoop.h
 *
 * This file declares the CRelaxedLoop class.
 */

#ifndef RELAXEDLOOP_H_
#define RELAXEDLOOP_H_

/**
 * The CRelaxedLoop class specifies a loop featuring at 2 concentric regions: core and
 * a neutralisation layer. Each of these regions has a unique alpha value - the ratio of current
 * density to magnetic field. The loop may also be placed within a potential envelope where the
 * alpha value is zero.
 *
 */
class CRelaxedLoop {

public:
	CRelaxedLoop(void);
	CRelaxedLoop(const CRelaxedLoop& _rx);
	/// empty default destructor
	~CRelaxedLoop(void) {}

	CRelaxedLoop& operator=(const CRelaxedLoop& _rx);

	void reset(bool _full = false);

	void init_dimensions(double _r1, double _r2, double _l);
	void init_dimensions(double _r1, double _r2, double _r3, double _l);
	void init_field(double _psi, double _psi_r, double _a1, bool _helical_test = true);
	void fix_envelope(double _b, double _c = 0.0);
	void neutralise_envelope(void);

	double calc_bz(double _r) const;
	double calc_bth(double _r) const;
	double calc_p(double _r) const;
	double calc_p_av(double _rmin, double _rmax) const;
	double calc_psi(double _r) const;
	double calc_k(double _r) const;
	double calc_w(double _r) const;
	double calc_q(double _r) const;

	void profile(unsigned long _rs);

	double get_a1(void) const;
	double get_b1(void) const;
	double get_r1(void) const;
	double get_r2(void) const;

	void out_props(ofstream& _ofs) const;
	void out_pfs(ofstream& _ofs) const;

	static void dump_pfs(double _r, const CRelaxedLoop& _rx);

	/**
	 * Critical helicity is achieved for a constant alpha region when the value of the
	 * Bessel arguments is greater than or equal to KCRIT_BESSEL_ARG.
	 */
	static const double KCRIT_BESSEL_ARG;

private:
	/// true if the init_dimensions method has been successfully called for this object since the last reset
	bool dimensions_initialised;
	/// true if the field coefficients for the potential envelope have been fixed
	bool envelope_fixed;
	/// true if the C coefficients for the potential envelope has been set to zero
	bool envelope_neutralised;
	/// true if the init_field_coeffs method has been successfully called for this object since the last reset
	bool coeffs_initialised;
	/// true if all field coefficients have been normalised such that axial flux is conserved
	bool coeffs_normalised;
	/// true if the init_field method has been successfully called for this object since the last reset
	bool field_initialised;
	/// true if the profile method has been successfully called for this object since the last reset
	bool profiled;

	/// true if the relaxed loop is placed within a potential envelope
	bool has_pe;
	/// true if the relaxed loop has a current neutralisation layer
	bool has_nl;
	/// true if the core region has a critical helicity i.e., the relaxed state features helical modes
	bool is_helical;

	/// the core radius
	double r1;
	/// the neutralisation layer radius (or potential envelope radius if neutralisation layer does not exist)
	double r2;
	/// the potential envelope radius (if neutralisation layer exists)
	double r3;

	/// the length of the loop in units of its unrelaxed radius
	double l;

	/// the alpha value within the core [0,m_r1]
	double a1;
	/// the alpha value within the neutralisation layer (if it exists) [m_r2,m_r3]
	double a2;

	/// the magnetic field coefficient in the core
	double b1;
	/// the magnetic field coefficients in the neutralisation layer (or envelope radius if neutralisation layer does not exist)
	double b2, c2;
	/// the magnetic field coefficients in the envelope (if neutralisation layer exists)
	double b3, c3;

	/// the fixed magnetic field coefficients for the potential envelope
	double bpe, cpe;

	/// the magnetic axial field profile
	CProfile pf_bz;
	/// the magnetic azimuthal field profile
	CProfile pf_bth;
	/// the magnetic twist profile ((l*bth)/(r*bz))
	CProfile pf_twist;
	/// the magnetic shear profile (bth/bz)
	CProfile pf_shear;

	// the dump_id is always incremented after every dump
	static unsigned int dump_id;

	void init_field_coeffs(double _psi, double _psi_r);

	double calc_nlalpha(void);

	bool validate_radius(double _r) const;

	static double calc_bz(double _r, void* _param);
	static double calc_bth(double _r, void* _param);
	static double calc_r2bth(double _an, void* _param);

	double J0(double _param) const;
	double J1(double _param) const;
	double Y0(double _param) const;
	double Y1(double _param) const;
	double F0(double _param) const;
	double F1(double _param) const;

friend ofstream& operator<<(ofstream& _ofs, const CRelaxedLoop& _lp);

}; // end of CRelaxedLoop class declaration

#endif /* RELAXEDLOOP_H_ */


text:
<?php
	global $avia_config;

	$style 		= $avia_config['box_class'];
	$responsive	= avia_get_option('responsive_active') != "disabled" ? "responsive" : "fixed_layout";
	$blank 		= isset($avia_config['template']) ? $avia_config['template'] : "";
	$av_lightbox= avia_get_option('lightbox_active') != "disabled" ? 'av-default-lightbox' : 'av-custom-lightbox';

?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="<?php echo " html_{$style} ".$responsive." ".$av_lightbox." ".avia_header_class_string();?> ">

<meta charset="<?php bloginfo( 'charset' ); ?>" />

<title><?php if(function_exists('avia_set_title_tag')) { echo avia_set_title_tag(); } ?></title>

<?php
/*
 * outputs a rel=follow or nofollow tag to circumvent google duplicate content for archives
 * located in framework/php/function-set-avia-frontend.php
 */
 if (function_exists('avia_set_follow')) { echo avia_set_follow(); }

 /*
 * outputs a favicon if defined
 */
 if (function_exists('avia_favicon'))    { echo avia_favicon(avia_get_option('favicon')); }
?>

<?php

if( strpos($responsive, 'responsive') !== false ) echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">';
?>

<?php
/* Always have wp_head() just before the closing
 * tag of your theme, or you will break many plugins, which
 * generally use this hook to add elements to  such
 * as styles, scripts, and meta tags.
 */

wp_head();

?>

<body id="top" <?php body_class($style." ".$avia_config['font_stack']." ".$blank); avia_markup_helper(array('context' => 'body')); ?>>

	<?php
	if(!$blank) //blank templates dont display header nor footer
	{
		 //fetch the template file that holds the main menu, located in includes/helper-menu-main.php
         get_template_part( 'includes/helper', 'main-menu' );

	} ?>

	<div id='main' data-scroll-offset='<?php echo avia_header_setting('header_scroll_offset'); ?>'>

	<?php do_action('ava_after_main_container'); ?>


text:
@interface UINavigationController (MLNavigationBarTransition)

@end


text:
<!DOCTYPE html>

    <title>Sonnet 52 | The Sonnets | William Shakespeare | Lit2Go ETC</title>
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/screenless.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/printless.css" type="text/css" media="print" title="no title" charset="utf-8">

          Lit2Go

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

Authors

Books

Genres

Collections

Readability

      The Sonnets

      by William Shakespeare

      Sonnet 52

        Additional Information

            Year Published:
            1609

            Language:
            English

            Country of Origin:
            England

            Source:
            Shakespeare, W. The sonnets. In R. G. White (Ed.), The complete works of William Shakespeare. New York: Sully and Kleinteich.

            Readability:

                Flesch–Kincaid Level:
                11.0

            Word Count:
            115

            Genre:
            Poetry

            Keywords:
            17th century literature, british literature, poetry, william shakespeare

            ✎ Cite This

  Share
  |

Downloads

          Audio

          Passage PDF

            APA

            MLA

            Chicago

            Shakespeare, W. (1609). Sonnet 52. The Sonnets (Lit2Go Edition). Retrieved February 15, 2016, from http://etc.usf.edu/lit2go/179/the-sonnets/3657/sonnet-52/

            Shakespeare, William. "Sonnet 52." The Sonnets. Lit2Go Edition. 1609. Web. <http://etc.usf.edu/lit2go/179/the-sonnets/3657/sonnet-52/>. February 15, 2016.

            William Shakespeare, "Sonnet 52," The Sonnets, Lit2Go Edition, (1609), accessed February 15, 2016, http://etc.usf.edu/lit2go/179/the-sonnets/3657/sonnet-52/.

Back

Next

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

	So am I as the rich whose blessed key,

	Can bring him to his sweet up-locked treasure,

	The which he will not every hour survey,

	For blunting the fine point of seldom pleasure.

	Therefore are feasts so solemn and so rare,

	Since seldom coming in that long year set,

	Like stones of worth they thinly placed are,

	Or captain jewels in the carcanet.

	So is the time that keeps you as my chest

	Or as the wardrobe which the robe doth hide,

	To make some special instant special-blest,

	By new unfolding his imprisoned pride.

	    Blessed are you whose worthiness gives scope,

	    Being had to triumph, being lacked to hope.

Back

Next

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

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

License

Credits

FAQ

Giving

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

Lit2Go: The Sonnets

Sonnet 52


text:
package org.metafacture.metamorph.functions;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Collections;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;

import org.metafacture.metamorph.api.MorphBuildException;
import org.metafacture.metamorph.api.helpers.AbstractSimpleStatelessFunction;

/**
 * Format date/time strings in Metamorph. By default the input format is
 * dd.MM.yyyy and the output format is {@link java.text.DateFormat.Field#LONG}.
 *

 * The Attribute removeLeadingZeros will remove all leading zeros from all
 * numbers in the output date.
 *

 * The attribute era is used to specify if the date is BC or AD. Default
 * value is AUTO. To understand that, three short examples:
 *

 *
Input: 20.07.356 (era=BC)
 *
Output (German location): 20. Juli 0356 v. Chr.
 *
Input: 20.07.356 (era=AD,removeLeadingZeros=true)
 *
Output (German location): 20. Juli 356
 *
Input: 20.07.-356 (era=AUTO)
 *
Output (German location): 20. Juli 0357 v. Chr. (there is NO year 0;
 *       see ISO 8601, Proleptic Gregorian Calendar)
 *

 * Examples of using this function in Metamorph:
 *

 *
Default date format: {@code <dateformat />}
 *
Read ISO-dates and generate German style dates:
 *   {@code <dateformat inputformat="yyyy-MM-dd" outputformat="dd.MM.yyyy" />}
 *

 *
 * @author Michael Büchner
 */
public class DateFormat extends AbstractSimpleStatelessFunction {

	public static final String DEFAULT_INPUT_FORMAT = "dd.MM.yyyy";
	public static final DateFormats DEFAULT_OUTPUT_FORMAT = DateFormats.LONG;
	public static final boolean DEFAULT_REMOVE_LEADING_ZEROS = false;
	public static final Era DEFAULT_ERA = Era.AUTO;

	private static final Set<String> SUPPORTED_LANGUAGES;

	private String inputFormat = DEFAULT_INPUT_FORMAT;
	private DateFormats outputFormat = DEFAULT_OUTPUT_FORMAT;
	private Era era = DEFAULT_ERA;
	private boolean removeLeadingZeros = DEFAULT_REMOVE_LEADING_ZEROS;
	private Locale outputLocale = Locale.getDefault();

	/**
	 * Supported date formats. Maps to the date formats in
	 * {@link java.text.DateFormat}.
	 *
	 * @author Christoph Böhme
	 */
	public enum DateFormats {
		FULL(java.text.DateFormat.FULL),
		LONG(java.text.DateFormat.LONG),
		MEDIUM(java.text.DateFormat.MEDIUM),
		SHORT(java.text.DateFormat.SHORT);

		private final int formatId;

		DateFormats(final int formatId) {
			this.formatId = formatId;
		}

		int getFormatId() {
			return formatId;
		}

	}

	/**
	 * Supported eras (basically AUTO, AD and BC). Maps to
	 * {@link java.util.GregorianCalendar}.
	 *
	 * @author Michael Büchner
	 */
	public enum Era {
		AD(GregorianCalendar.AD),
		BC(GregorianCalendar.BC),
		AUTO(-1);

		private final int eraId;

		Era(final int eraId) {
			this.eraId = eraId;
		}

		int getEraId() {
			return eraId;
		}

	}

	static {
		final Set<String> set = new HashSet<String>();
		Collections.addAll(set, Locale.getISOLanguages());
		SUPPORTED_LANGUAGES = Collections.unmodifiableSet(set);
	}

	@Override
	public final String process(final String value) {
		String result;
		try {
			final Calendar c = Calendar.getInstance();
			final SimpleDateFormat sdf = new SimpleDateFormat(inputFormat);
			c.setTime(sdf.parse(value));
			if (era == Era.BC) {
				c.set(Calendar.ERA, GregorianCalendar.BC);
			} else if (era == Era.AD) {
				c.set(Calendar.ERA, GregorianCalendar.AD);
			}

			final SimpleDateFormat sdfp = (SimpleDateFormat) java.text.DateFormat.getDateInstance(outputFormat.getFormatId(), outputLocale);
			String p = sdfp.toPattern();
			if (c.get(Calendar.ERA) == GregorianCalendar.BC) {
				p = p.replace("yyyy", "yyyy G");
			}

			final SimpleDateFormat sdfo = new SimpleDateFormat(p, outputLocale);
			result = sdfo.format(c.getTime());

			if (removeLeadingZeros) {
				result = result.replaceAll("([0]{1,})([0-9]{1,})", "$2");
			}

		} catch (final IllegalArgumentException e) {
			throw new MorphBuildException("The date/time format is not supported.", e);
		} catch (final Exception e) {
			result = value;
		}
		return result;
	}

	public final void setInputFormat(final String inputFormat) {
		this.inputFormat = inputFormat;
	}

	public final void setOutputFormat(final DateFormats outputFormat) {
		this.outputFormat = outputFormat;
	}

	public final void setEra(final Era era) {
		this.era = era;
	}

	public final void setRemoveLeadingZeros(final boolean removeLeadingZeros) {
		this.removeLeadingZeros = removeLeadingZeros;
	}

	public final void setLanguage(final String language) {
		if (!SUPPORTED_LANGUAGES.contains(language)) {
			throw new MorphBuildException("Language '" + language + "' not supported.");
		}
		this.outputLocale = new Locale(language);
	}
}


text:
    <button class="btn btn-success m-1" (click)="alertService.success('Success!!')">Success</button>
    <button class="btn btn-danger m-1" (click)="myError()">Error</button>

    <button class="btn btn-info m-1" (click)="alertService.info('Some info....')">Info</button>
    <button class="btn btn-warning m-1" (click)="alertService.warning('Warning: ...')">Warn</button>
    <button class="btn btn-outline-dark m-1" (click)="alertService.clear()">Clear</button>

            <input type="checkbox" name="autoClose" id="autoClose" class="form-check-input"
                [(ngModel)]="options.autoClose">
            Auto close alert after three seconds

            <input type="checkbox" name="keepAfterRouteChange" id="keepAfterRouteChange" class="form-check-input"
                [(ngModel)]="options.keepAfterRouteChange">
            Keep displaying after one route change


text:
Ejercicio Práctico CSS

En esta sección, pondremos a práctica lo que hemos estado aprendiendo anteriormente.

Como parte del ejercicio, descarguen ejercicio_practico.zip. Sobre estos archivos se realizará el ejercicio.

El ejercicio consta de aplicarle una transición CSS a un elemento en los archivos que descargaron. Primero, en un editor de texto (preferiblemente sublime text), abran index.html y styles.css.

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Ejercicio Práctico</title>
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/normalize.css">
	<link rel="stylesheet" href="css/styles.css">
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-sm-12 center-block">
				<div class="jumbotron">
				  	<h1>Ejercicio Práctico</h1>
					<div class="panel panel-default animate">
					  <div class="panel-body">
					    Una transicionsita para mi ?
					  </div>
					</div>
				</div>
				<button class="btn btn-primary btn-large center-block toggle">Toggle Transición</button>
			</div>
		</div>
	</div>
	<script src="js/jquery-2.1.4.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
</body>
</html>

La parte del script ignórenla por ahora. Lo que hace básicamente es que, al clickear el botón, se le agrega o quita una clase a un elemento.

.animate {
	-webkit-transition: all 0.5s;
	-o-transition: all 0.5s;
	transition: all 0.5s;
}

.transicion {

}

Lo que deben hacer es agregar reglas CSS a la clase "transicion" para generar diferentes transiciones CSS al clickear el botón. Sencillo, no ?


text:
using System;

namespace AppStudio.DataProviders.Core
{
    [AttributeUsage(AttributeTargets.Field)]
    public sealed class StringValueAttribute : Attribute
    {
        private string _value;

        public StringValueAttribute(string value)
        {
            _value = value;
        }

        public string Value
        {
            get { return _value; }
        }
    }

}


text:
package org.james.material.refreshloadmore;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.AbsListView;
import android.widget.ScrollView;

/**
 * @author qinbaowei
 * @createtime 2015/10/10 09:52
 * @description must be only one child view
 */
public class RefreshLoadMoreLayout extends ViewGroup {
    private Context mContext;

    private HeaderLayout mHeaderLayout;
    private boolean mCanRefresh;

    private FooterLayout mFooterLayout;
    private boolean mCanLoadMore;

    private boolean mMultiTask;

    private CallBack mCallBack;

    private float mPreviousYPos;

    public RefreshLoadMoreLayout(Context context) {
        super(context);
        initViews(context);
    }

    public RefreshLoadMoreLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        initViews(context);
    }

    private void initViews(Context context) {
        this.mContext = context;
        setClickable(true);//make event deliver
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        int width = MeasureSpec.getSize(widthMeasureSpec);
        int childCount = getChildCount();
        for (int i = 0; i < childCount; i++) {
            View child = getChildAt(i);
            if (child instanceof HeaderLayout || child instanceof FooterLayout) {
                child.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), child.getMeasuredHeightAndState());
            } else {
                child.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY), getContentMeasuredHeightState());
            }
        }
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {//height of child must be smaller than parent
        int childCount = getChildCount();
        View vHeader = null;
        View vFooter = null;
        View vContent = null;
        for (int i = 0; i < childCount; i++) {
            View child = getChildAt(i);
            if (child instanceof HeaderLayout) {
                vHeader = child;
                vHeader.layout(0, 0, vHeader.getMeasuredWidth(), vHeader.getMeasuredHeight());
            } else if (child instanceof FooterLayout) {
                vFooter = child;
                int y = getMeasuredHeight() - vFooter.getMeasuredHeight();
                vFooter.layout(0, y, vFooter.getMeasuredWidth(), vFooter.getMeasuredHeight() + y);
            } else {
                vContent = child;
            }
        }
        int y = (null == vHeader ? 0 : vHeader.getMeasuredHeight()) - (null == vFooter ? 0 : vFooter.getMeasuredHeight());
        vContent.layout(0, y, vContent.getMeasuredWidth(), getMeasuredHeight() + y);
    }

    /**
     * @param height
     * @return force
     */
    private float externForce(int height, int factorHeight) {
        float s1 = (float) height / factorHeight;
        if (s1 >= 1.0f) {
            s1 = 0.4f;
        } else if (s1 >= 0.6 && s1 < 1.0) {
            s1 = 0.6f;
        } else if (s1 >= 0.3 && s1 < 0.6) {
            s1 = 0.8f;
        } else {
            s1 = 1.0f;
        }
        return s1;
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        switch (ev.getAction()) {
            case MotionEvent.ACTION_DOWN:
                mPreviousYPos = ev.getRawY();
                break;
            case MotionEvent.ACTION_MOVE:
                float fNowYPos = ev.getRawY();
                float disY = fNowYPos - mPreviousYPos;
                if (isHeaderActive()) {
                    disY *= externForce(mHeaderLayout.getHeaderHeight(), mHeaderLayout.getHeaderContentHeight());
                } else if (isFooterActive()) {
                    disY *= externForce(mFooterLayout.getFooterHeight(), mFooterLayout.getFooterContentHeight());
                }
                mPreviousYPos = fNowYPos;
                if (isPullDown(MotionEvent.ACTION_MOVE, disY)) {
                    mHeaderLayout.setHeaderHeight((int) (mHeaderLayout.getHeaderHeight() + disY));
                    updatePullDownStatus(MotionEvent.ACTION_MOVE);
                    if (mHeaderLayout.getHeaderHeight() > 0) {
                        ev.setAction(MotionEvent.ACTION_CANCEL);
                        return super.dispatchTouchEvent(ev);
                    }
                    return false;
                } else if (isPullUp(MotionEvent.ACTION_MOVE, disY)) {
                    mFooterLayout.setFooterHeight((int) (mFooterLayout.getFooterHeight() - disY));
                    updatePullUpStatus(MotionEvent.ACTION_MOVE);
                    if (mFooterLayout.getFooterHeight() > 0 && !mFooterLayout.isLoadingStatus()) {
                        ev.setAction(MotionEvent.ACTION_CANCEL);
                        return super.dispatchTouchEvent(ev);
                    }
                    return false;
                }

                break;
            case MotionEvent.ACTION_UP:
                if (isPullDown(MotionEvent.ACTION_UP, 0)) {
                    updatePullDownStatus(MotionEvent.ACTION_UP);
                } else if (isPullUp(MotionEvent.ACTION_UP, 0)) {
                    updatePullUpStatus(MotionEvent.ACTION_UP);
                }
                break;
            default:
                break;
        }
        return super.dispatchTouchEvent(ev);
    }

    private boolean isHeaderActive() {
        return isCanRefresh() && HeaderLayout.Status.NORMAL != mHeaderLayout.getStatus() && mHeaderLayout.getHeaderHeight() > 0;
    }

    private boolean isHeaderAutoMove() {
        if (!isCanRefresh()) {
            return false;
        }
        if (HeaderLayout.Status.BACK_REFRESH == mHeaderLayout.getStatus()) {
            return true;
        }
        if (HeaderLayout.Status.BACK_NORMAL == mHeaderLayout.getStatus()) {
            return true;
        }
        if (HeaderLayout.Status.AUTO_REFRESH == mHeaderLayout.getStatus()) {
            return true;
        }
        return false;
    }

    /**
     * @return isContentToTop() == isContentToBottom() ? isFooterActive() : isFooterAutoMove();
     */
    private boolean isLoadMoreActive() {
        return isContentToTop() == isContentToBottom() ? isFooterActive() : isFooterAutoMove();
    }

    private boolean isPullDown(int action, float fDisYPos) {
        if (!isCanRefresh()) {
            return false;
        }
        if (isHeaderAutoMove()) {
            return false;
        }
        if (isLoadMoreActive()) {
            return false;
        }
        switch (action) {
            case MotionEvent.ACTION_MOVE:
                if (fDisYPos > 0) {//move down
                    if (isContentToTop()) {//pull up
                        return true;
                    }
                } else if (fDisYPos < 0) {//move up
                    if (isHeaderActive()) {//back after pull down
                        return true;
                    }
                }
            case MotionEvent.ACTION_UP:
                if (isHeaderActive()) {
                    return true;
                }
            default:
                break;
        }
        return false;
    }

    private boolean isFooterAutoMove() {
        if (!isCanLoadMore()) {
            return false;
        }
        if (FooterLayout.Status.BACK_LOAD == mFooterLayout.getStatus()) {
            return true;
        }
        if (FooterLayout.Status.BACK_NORMAL == mFooterLayout.getStatus()) {
            return true;
        }
        return false;
    }

    private boolean isFooterActive() {
        return isCanLoadMore() && FooterLayout.Status.NORMAL != mFooterLayout.getStatus() && mFooterLayout.getFooterHeight() > 0;
    }

    /**
     * @return isContentToTop() == isContentToBottom() ? isHeaderActive() : isHeaderAutoMove();
     */
    private boolean isPullDownActive() {
        return isContentToTop() == isContentToBottom() ? isHeaderActive() : isHeaderAutoMove();
    }

    private boolean isPullUp(int action, float fDisYPos) {
        if (!isCanLoadMore()) {
            return false;
        }
        if (isFooterAutoMove()) {
            return false;
        }
        if (isPullDownActive()) {
            return false;
        }
        switch (action) {
            case MotionEvent.ACTION_MOVE:
                if (fDisYPos > 0) {//move down
                    if (isFooterActive()) {//back after pull up
                        return true;
                    }
                } else if (fDisYPos < 0) {//move up
                    if (isContentToBottom()) {//pull up
                        return true;
                    }
                }
            case MotionEvent.ACTION_UP:
                if (isFooterActive()) {
                    return true;
                }
            default:
                break;
        }
        return false;
    }

    private void updatePullDownStatus(int action) {

        switch (action) {
            case MotionEvent.ACTION_MOVE:
                if (HeaderLayout.Status.REFRESH == mHeaderLayout.getStatus()) {//change height not change status when refreshing
                    return;
                }
                if (mHeaderLayout.getHeaderHeight() >= mHeaderLayout.getHeaderContentHeight()) {//can release to refresh
                    mHeaderLayout.setStatus(HeaderLayout.Status.CAN_RELEASE);
                } else {//only pull down
                    mHeaderLayout.setStatus(HeaderLayout.Status.PULL_DOWN);
                }
                break;
            case MotionEvent.ACTION_UP://change status when move,check status on up
                if (HeaderLayout.Status.CAN_RELEASE == mHeaderLayout.getStatus()) {
                    mHeaderLayout.setStatus(HeaderLayout.Status.REFRESH);
                } else if (HeaderLayout.Status.PULL_DOWN == mHeaderLayout.getStatus()) {
                    mHeaderLayout.setStatus(HeaderLayout.Status.BACK_NORMAL);
                } else if (HeaderLayout.Status.REFRESH == mHeaderLayout.getStatus()) {
                    if (mHeaderLayout.getHeaderHeight() > mHeaderLayout.getHeaderContentHeight()) {
                        mHeaderLayout.setStatus(HeaderLayout.Status.BACK_REFRESH);
                    }
                }
                break;
            default:
                break;
        }

    }

    private void updatePullUpStatus(int action) {

        switch (action) {
            case MotionEvent.ACTION_MOVE:
                if (FooterLayout.Status.LOAD == mFooterLayout.getStatus()) {
                    return;
                }
                if (mFooterLayout.getFooterHeight() >= mFooterLayout.getFooterContentHeight()) {
                    mFooterLayout.setStatus(FooterLayout.Status.CAN_RELEASE);
                } else {
                    mFooterLayout.setStatus(FooterLayout.Status.PULL_UP);
                }
                break;
            case MotionEvent.ACTION_UP:
                if (FooterLayout.Status.CAN_RELEASE == mFooterLayout.getStatus()) {
                    mFooterLayout.setStatus(FooterLayout.Status.LOAD);
                } else if (FooterLayout.Status.PULL_UP == mFooterLayout.getStatus()) {
                    mFooterLayout.setStatus(FooterLayout.Status.BACK_NORMAL);
                } else if (FooterLayout.Status.LOAD == mFooterLayout.getStatus()) {
                    if (mFooterLayout.getFooterHeight() > mFooterLayout.getFooterContentHeight()) {
                        mFooterLayout.setStatus(FooterLayout.Status.BACK_LOAD);
                    }
                }
                break;
            default:
                break;
        }

    }

    private int getContentMeasuredHeightState() {
        if (getContentView() instanceof ScrollView || getContentView() instanceof RecyclerView || getContentView() instanceof AbsListView) {
            return MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        } else if (getContentView() instanceof View) {
            return MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY);
        }
        return 0;
    }

    public boolean isContentToTop() {
        return RefreshLoadMoreUtil.isContentToTop(getContentView());
    }

    public boolean isContentToBottom() {
        return RefreshLoadMoreUtil.isContentToBottom(getContentView());
    }

    public void init(Config config) {
        setCallBack(config.mCallBack);
        setRefreshLayout();
        setCanRefresh(config.mCanRefresh);
        setIsShowLastRefreshTime(config.mShowLastRefreshTime);
        setHeaderKeyLastRefreshTime(config.mKeyLastRefreshTime);
        setHeaderDateFormat(config.mHeaderDateFormat);
        setLoadMoreLayout();
        setCanLoadMore(config.mCanLoadMore);
        setSupportAutoLoadMore(config.mAutoLoadMore);
        setMultiTask(config.mMultiTask);
    }

    public static class Config {
        public CallBack mCallBack;
        public boolean mCanRefresh = true;
        public boolean mShowLastRefreshTime = false;
        public String mKeyLastRefreshTime = "";
        public String mHeaderDateFormat = "yyyy-MM-dd";
        public boolean mCanLoadMore = true;
        public boolean mAutoLoadMore = false;
        public boolean mMultiTask = false;

        public Config(CallBack callBack) {
            this.mCallBack = callBack;
        }

        /**
         * @param b 是否支持下拉刷新
         */
        public Config canRefresh(boolean b) {
            mCanRefresh = b;
            return this;
        }

        /**
         * @param currActivityClass 当前页面activity的类名(作为key保存时间)
         * @param dateFormat        显示上次刷新时间的格式
         */
        public Config showLastRefreshTime(Class currActivityClass, String dateFormat) {
            mShowLastRefreshTime = true;
            mKeyLastRefreshTime = currActivityClass.getSimpleName();
            mHeaderDateFormat = dateFormat;
            return this;
        }

        public Config showLastRefreshTime(Class currActivityClass) {
            return showLastRefreshTime(currActivityClass, "");
        }

        /**
         * @param b 是否支持上拉加载更多
         */
        public Config canLoadMore(boolean b) {
            mCanLoadMore = b;
            return this;
        }

        /**
         * 自动上拉加载更多(默认不自动加载更多)
         */
        public Config autoLoadMore() {
            mAutoLoadMore = true;
            return this;
        }

        /**
         * 刷新和加载更多可同时进行(默认不能同时进行)
         */
        public Config multiTask() {
            mMultiTask = true;
            return this;
        }
    }

    private void setHeaderDateFormat(String dateFormat) {
        mHeaderLayout.setDateFormat(dateFormat);
    }

    private void setHeaderKeyLastRefreshTime(String key) {
        mHeaderLayout.setKeyLastUpdateTime(key);
    }

    private void setIsShowLastRefreshTime(boolean b) {
        mHeaderLayout.setIsShowLastRefreshTime(b);
    }

    public void setCanRefresh(boolean canRefresh) {
        mCanRefresh = canRefresh;
    }

    private void setRefreshLayout() {
        mHeaderLayout = new HeaderLayout(mContext);
        mHeaderLayout.setCallBack(getCallBack());
        mHeaderLayout.setHeaderHeight(0);
        addView(mHeaderLayout, 0);//header should be the first view
    }

    public boolean isCanRefresh() {
        if (mMultiTask) {
            return mCanRefresh;
        } else {
            return mCanRefresh && null != mFooterLayout && !mFooterLayout.isLoadingMore();
        }
    }

    public boolean isCanLoadMore() {
        if (mMultiTask) {
            return mCanLoadMore;
        } else {
            return mCanLoadMore && null != mHeaderLayout && !mHeaderLayout.isRefreshing();
        }
    }

    public void setCanLoadMore(boolean canLoadMore) {
        mCanLoadMore = canLoadMore;
    }

    private void setLoadMoreLayout() {
        mFooterLayout = new FooterLayout(mContext);
        mFooterLayout.setCallBack(getCallBack());
        mFooterLayout.setFooterHeight(0);
        addView(mFooterLayout);
    }

    public void startAutoRefresh() {
        startAutoRefresh(500);
    }

    public void startAutoRefresh(final long delay) {
        getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                getViewTreeObserver().removeGlobalOnLayoutListener(this);
                postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        if (!isCanRefresh()) {
                            return;
                        }
                        if (HeaderLayout.Status.NORMAL != mHeaderLayout.getStatus()) {
                            return;
                        }
                        mHeaderLayout.setStatus(HeaderLayout.Status.AUTO_REFRESH);
                    }
                }, delay);
            }
        });

    }

    public void stopRefresh() {
        stopRefresh(true);
    }

    /**
     * @param canRefresh 是否禁用掉下拉刷新功能
     */
    public void stopRefresh(boolean canRefresh) {
        if (!isCanRefresh()) {
            return;
        }
        if (HeaderLayout.Status.BACK_NORMAL == mHeaderLayout.getStatus()) {
            return;
        }
        mHeaderLayout.setStatus(HeaderLayout.Status.BACK_NORMAL);
        setCanRefresh(canRefresh);
    }

    /**
     * 依然可以上拉加载更多
     */
    public void stopLoadMore() {
        stopLoadMore(false, true);
    }

    /**
     * @param noMoreData 是否没有更多数据了。如果为true,上拉的时候会提示'没有更多'了
     */
    public void stopLoadMoreNoData(boolean noMoreData) {
        stopLoadMore(noMoreData, true);
    }

    /**
     * 如果 canLoadMore=false,则上拉加载更多功能不能使用
     *
     * @param canLoadMore
     */
    public void stopLoadMore(boolean canLoadMore) {
        stopLoadMore(false, canLoadMore);
    }

    private void stopLoadMore(boolean noMoreData, boolean canLoadMore) {
        if (!isCanLoadMore()) {
            return;
        }
        if (FooterLayout.Status.BACK_NORMAL == mFooterLayout.getStatus()) {
            return;
        }
        mFooterLayout.setStatus(FooterLayout.Status.BACK_NORMAL);
        mFooterLayout.setNoMoreData(noMoreData);
        setCanLoadMore(canLoadMore);
    }

    public CallBack getCallBack() {
        return mCallBack;
    }

    private void setCallBack(CallBack callBack) {
        this.mCallBack = callBack;
    }

    private void setSupportAutoLoadMore(boolean b) {
        if (b) {
            if (getContentView() instanceof RecyclerView) {
                ((RecyclerView) getContentView()).addOnScrollListener(new RecyclerView.OnScrollListener() {
                    @Override
                    public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                        super.onScrolled(recyclerView, dx, dy);
                        if (dy > 0 && isCanLoadMore() && RefreshLoadMoreUtil.isContentToBottom(getContentView())) {
                            mFooterLayout.setStatus(FooterLayout.Status.LOAD);
                        }
                    }
                });
            } else if (getContentView() instanceof AbsListView) {
                ((AbsListView) getContentView()).setOnScrollListener(new AbsListView.OnScrollListener() {
                    @Override
                    public void onScrollStateChanged(AbsListView view, int scrollState) {
                        if (SCROLL_STATE_IDLE == scrollState) {
                            if (isCanLoadMore() && RefreshLoadMoreUtil.isContentToBottom(getContentView())) {
                                mFooterLayout.setStatus(FooterLayout.Status.LOAD);
                            }
                        }
                    }

                    @Override
                    public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {

                    }
                });
            }
        }
    }

    private void setMultiTask(boolean b) {
        mMultiTask = b;
    }

    public interface CallBack {
        void onRefresh();

        void onLoadMore();
    }

    public View getContentView() {
        return getChildAt(1);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/list_row_text"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textSize="40.0sp"/>


text:
{% extends "personal/header.html" %}

{% block content %}

Welcome

New site is coming soon!

Hi, My name is Thumbi Migwe. I'm a backend developer - Python Django.

This site is still on development.

More info »

About

Here's a little about what i am up to.

Hi, My name is Thumbi Migwe. I'm a backend developer - Python Django.

This site is still on development.

view my portfo »

Contact

Get in touch.

Email: thumbimigwe@outlook.com

Nairobi, Kenya

{% endblock %}


text:
from jinja2 import nodes
from jinja2.ext import Extension
from flask import get_flashed_messages
from ..utils import remove_yaml_frontmatter

__all__ = ('jinja_fragment_extension', 'jinja_block_as_fragment_extension', 'FlashMessagesExtension')

def parse_block_signature(parser):
    args = []
    kwargs = []
    require_comma = False

    while parser.stream.current.type != 'block_end':
        if require_comma:
            parser.stream.expect('comma')
            # support for trailing comma
            if parser.stream.current.type == 'block_end':
                break
        if parser.stream.current.type == 'name' and \
           parser.stream.look().type == 'assign':
            key = parser.stream.current.value
            parser.stream.skip(2)
            value = parser.parse_expression()
            kwargs.append(nodes.Keyword(key, value,
                                        lineno=value.lineno))
        else:
            args.append(parser.parse_expression())
        require_comma = True

    return args, kwargs

def jinja_fragment_extension(tag, endtag=None, name=None, tag_only=False, allow_args=True, callblock_args=None):
    """Decorator to easily create a jinja extension which acts as a fragment.
    """
    if endtag is None:
        endtag = "end" + tag

    def decorator(f):
        def parse(self, parser):
            lineno = parser.stream.__next__().lineno
            args = []
            kwargs = []
            if allow_args:
                args, kwargs = parse_block_signature(parser)

            call = self.call_method("support_method", args, kwargs, lineno=lineno)
            if tag_only:
                return nodes.Output([call], lineno=lineno)

            call_args = []
            if callblock_args is not None:
                for arg in callblock_args:
                    call_args.append(nodes.Name(arg, 'param', lineno=lineno))

            body = parser.parse_statements(['name:' + endtag], drop_needle=True)
            return nodes.CallBlock(call, call_args, [], body, lineno=lineno)

        def support_method(self, *args, **kwargs):
            return f(*args, **kwargs)

        attrs = {"tags": set([tag]), "parse": parse, "support_method": support_method}
        return type(name or f.__name__, (Extension,), attrs)

    return decorator

class BaseJinjaBlockAsFragmentExtension(Extension):
    def parse(self, parser):
        lineno = parser.stream.__next__().lineno
        body = parser.parse_statements(['name:' + self.end_tag], drop_needle=True)
        return nodes.Block(self.block_name, body, False, lineno=lineno)

def jinja_block_as_fragment_extension(name, tagname=None, classname=None):
    """Creates a fragment extension which will just act as a replacement of the
    block statement.
    """
    if tagname is None:
        tagname = name
    if classname is None:
        classname = "%sBlockFragmentExtension" % name.capitalize()
    return type(classname, (BaseJinjaBlockAsFragmentExtension,), {
        "tags": set([tagname]), "end_tag": "end" + tagname, "block_name": name})

class RemoveYamlFrontMatterExtension(Extension):
    """Jinja extension to remove YAML front-matters
    """
    def preprocess(self, source, name, filename=None):
        before = ""
        if source.startswith("{% load_macro"):
            before, source = source.split("\n", 1)
        return before + remove_yaml_frontmatter(source)

@jinja_fragment_extension("flash_messages", endtag="endflash", allow_args=False,
                          callblock_args=["message", "category"])
def FlashMessagesExtension(caller=None):
    messages = get_flashed_messages(with_categories=True)
    html = ""
    if messages:
        for cat, msg in messages:
            html += caller(msg, cat)
    return html


text:
Package.describe({
  name: 'package-to-test',
  version: '0.0.1',
  // Brief, one-line summary of the package.
  summary: '',
  // URL to the Git repository containing the source code for this package.
  git: '',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');
  api.addFiles('package-to-test.js');
  api.export('PackageToTest');
});

Package.onTest(function(api) {
  api.use('sanjo:jasmine@0.18.0');
  api.use('package-to-test');
  api.addFiles('tests/server/example-spec.js', 'server');
  api.addFiles('tests/client/example-spec.js', 'client');
});


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagemenet.Common;
using Microsoft.Azure.ServiceManagemenet.Common.Models;
using Microsoft.Azure.Management.Resources;
using Microsoft.Azure.Management.Sql;
using Microsoft.Azure.Management.Sql.Models;
using Microsoft.WindowsAzure.Management.Storage;
using System;
using System.Collections.Generic;
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Commands.Common.Authentication.Models;
using Microsoft.Azure.Commands.Sql.Common;

namespace Microsoft.Azure.Commands.Sql.ServerCommunicationLink.Services
{
    /// <summary>
    /// This class is responsible for all the REST communication with the endpoints
    /// </summary>
    public class AzureSqlServerCommunicationLinkCommunicator
    {
        /// <summary>
        /// The Sql client to be used by this end points communicator
        /// </summary>
        private static SqlManagementClient SqlClient { get; set; }

        /// <summary>
        /// Gets or set the Azure subscription
        /// </summary>
        private static AzureSubscription Subscription { get; set; }

        /// <summary>
        /// Gets or sets the Azure profile
        /// </summary>
        public AzureContext Context { get; set; }

        /// <summary>
        /// Creates a communicator for Azure Sql Elastic Pool
        /// </summary>
        /// <param name="profile"></param>
        /// <param name="subscription"></param>
        public AzureSqlServerCommunicationLinkCommunicator(AzureContext context)
        {
            Context = context;
            if (context.Subscription != Subscription)
            {
                Subscription = context.Subscription;
                SqlClient = null;
            }
        }

        /// <summary>
        /// Gets a server communication link
        /// </summary>
        public Management.Sql.Models.ServerCommunicationLink Get(string resourceGroupName, string serverName, string communicationLinkName, string clientRequestId)
        {
            return GetCurrentSqlClient(clientRequestId).CommunicationLinks.Get(resourceGroupName, serverName, communicationLinkName).ServerCommunicationLink;
        }

        /// <summary>
        /// Lists server communication links
        /// </summary>
        public IList<Management.Sql.Models.ServerCommunicationLink> List(string resourceGroupName, string serverName, string clientRequestId)
        {
            return GetCurrentSqlClient(clientRequestId).CommunicationLinks.List(resourceGroupName, serverName).ServerCommunicationLinks;
        }

        /// <summary>
        /// Creates or updates a server communication link
        /// </summary>
        public Management.Sql.Models.ServerCommunicationLink CreateOrUpdate(string resourceGroupName, string serverName, string communicationLinkName, string clientRequestId, ServerCommunicationLinkCreateOrUpdateParameters parameters)
        {
            var resp = GetCurrentSqlClient(clientRequestId).CommunicationLinks.CreateOrUpdate(resourceGroupName, serverName, communicationLinkName, parameters);
            return resp.ServerCommunicationLink;
        }

        /// <summary>
        /// Deletes a server communication link
        /// </summary>
        public void Remove(string resourceGroupName, string serverName, string communicationLinkName, string clientRequestId)
        {
            GetCurrentSqlClient(clientRequestId).CommunicationLinks.Delete(resourceGroupName, serverName, communicationLinkName);
        }

        /// <summary>
        /// Retrieve the SQL Management client for the currently selected subscription, adding the session and request
        /// id tracing headers for the current cmdlet invocation.
        /// </summary>
        /// <returns>The SQL Management client for the currently selected subscription.</returns>
        private SqlManagementClient GetCurrentSqlClient(String clientRequestId)
        {
            // Get the SQL management client for the current subscription
            if (SqlClient == null)
            {
                SqlClient = AzureSession.ClientFactory.CreateClient<SqlManagementClient>(Context, AzureEnvironment.Endpoint.ResourceManager);
            }
            SqlClient.HttpClient.DefaultRequestHeaders.Remove(Constants.ClientRequestIdHeaderName);
            SqlClient.HttpClient.DefaultRequestHeaders.Add(Constants.ClientRequestIdHeaderName, clientRequestId);
            return SqlClient;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.kie.workbench.screens</groupId>
    <artifactId>kie-wb-common-home</artifactId>
    <version>6.4.0-SNAPSHOT</version>
  </parent>

  <artifactId>kie-wb-common-home-api</artifactId>
  <packaging>jar</packaging>

  <name>Kie Workbench - Common - Home API</name>
  <description>Kie Workbench - Common - Home API</description>

  <dependencies>
    <dependency>
      <groupId>org.guvnor</groupId>
      <artifactId>guvnor-structure-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-bus</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.uberfire</groupId>
      <artifactId>uberfire-commons</artifactId>
    </dependency>

  </dependencies>

</project>


text:
import * as jspb from "./index";

import * as google_protobuf_compiler_plugin_pb from "./google/protobuf/compiler/plugin_pb";
import * as google_protobuf_any_pb from "./google/protobuf/any_pb";
import * as google_protobuf_api_pb from "./google/protobuf/api_pb";
import * as google_protobuf_descriptor_pb from "./google/protobuf/descriptor_pb";
import * as google_protobuf_duration_pb from "./google/protobuf/duration_pb";
import * as google_protobuf_empty_pb from "./google/protobuf/empty_pb";
import * as google_protobuf_field_mask_pb from "./google/protobuf/field_mask_pb";
import * as google_protobuf_source_context_pb from "./google/protobuf/source_context_pb";
import * as google_protobuf_struct_pb from "./google/protobuf/struct_pb";
import * as google_protobuf_timestamp_pb from "./google/protobuf/timestamp_pb";
import * as google_protobuf_type_pb from "./google/protobuf/type_pb";
import * as google_protobuf_wrappers_pb from "./google/protobuf/wrappers_pb";

/* This is a typescript version of a simple generated class from a proto file that is shown below. In order to make
 this ES5 JS file into TypeScript there have been quite a few modifications, but the same calls are made to the library
 classes.

 // FILE: simple.proto
 syntax = "proto3";

 package examplecom;

 message MySimple {
   string my_string = 1;
   bool my_bool = 2;
   repeated string some_labels = 3;
   google.protobuf.compiler.CodeGeneratorRequest some_code_generator_request = 4;
   google.protobuf.Any some_any = 5;
   google.protobuf.Method some_method = 6;
   google.protobuf.GeneratedCodeInfo some_generated_code_info = 7;
   google.protobuf.Duration some_duration = 8;
   google.protobuf.Empty some_empty = 9;
   google.protobuf.FieldMask some_field_mask = 10;
   google.protobuf.SourceContext some_source_context = 11;
   google.protobuf.Struct some_struct = 12;
   google.protobuf.Timestamp some_timestamp = 13;
   google.protobuf.Type some_type = 14;
   google.protobuf.DoubleValue some_double_value = 15;
 }
*/

class MySimple extends jspb.Message {
  constructor(opt_data?: any) {
    super(); // This isn't actually called in the JS version of this file, but it's required by TS
    jspb.Message.initialize(this, opt_data, 0, -1, MySimple.repeatedFields_, null);
  };

  static repeatedFields_ = [3];

  toObject(opt_includeInstance?: boolean): {} {
    return MySimple.toObject(opt_includeInstance || false, this);
  };

  static toObject(includeInstance: boolean, msg: MySimple): {} {
    const obj = {
      myString: jspb.Message.getFieldWithDefault(msg, 1, ""),
      myBool: jspb.Message.getFieldWithDefault(msg, 2, false),
      someLabelsList: jspb.Message.getField(msg, 3),
      someCodeGeneratorRequest: google_protobuf_compiler_plugin_pb.CodeGeneratorRequest.toObject(includeInstance, msg.getSomeCodeGeneratorRequest()),
      someAny: google_protobuf_any_pb.Any.toObject(includeInstance, msg.getSomeAny()),
      someMethod: google_protobuf_api_pb.Method.toObject(includeInstance, msg.getSomeMethod()),
      someGeneratedCodeInfo: google_protobuf_descriptor_pb.GeneratedCodeInfo.toObject(includeInstance, msg.getSomeGeneratedCodeInfo()),
      someDuration: google_protobuf_duration_pb.Duration.toObject(includeInstance, msg.getSomeDuration()),
      someEmpty: google_protobuf_empty_pb.Empty.toObject(includeInstance, msg.getSomeEmpty()),
      someFieldMask: google_protobuf_field_mask_pb.FieldMask.toObject(includeInstance, msg.getSomeFieldMask()),
      someSourceContext: google_protobuf_source_context_pb.SourceContext.toObject(includeInstance, msg.getSomeSourceContext()),
      someStruct: google_protobuf_struct_pb.Struct.toObject(includeInstance, msg.getSomeStruct()),
      someTimestamp: google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, msg.getSomeTimestamp()),
      someType: google_protobuf_type_pb.Type.toObject(includeInstance, msg.getSomeType()),
      someDoubleValue: google_protobuf_wrappers_pb.DoubleValue.toObject(includeInstance, msg.getSomeDoubleValue()),
    };

    if (includeInstance) {
      // This is commented out because it's not valid in TS, but it's a simple append to an object
      // obj['$jspbMessageInstance'] = msg;
    }
    return obj;
  };

  static deserializeBinary(bytes: Uint8Array): MySimple {
    const reader = new jspb.BinaryReader(bytes);
    const msg = new MySimple;
    return MySimple.deserializeBinaryFromReader(msg, reader);
  }

  static deserializeBinaryFromReader(msg: MySimple, reader: jspb.BinaryReader): MySimple {
    while (reader.nextField()) {
      if (reader.isEndGroup()) {
        break;
      }
      const field = reader.getFieldNumber();
      switch (field) {
        case 1:
          const value1 = reader.readString();
          msg.setMyString(value1);
          break;
        case 2:
          const value2 = reader.readBool();
          msg.setMyBool(value2);
          break;
        case 3:
          const value3 = reader.readString();
          msg.addSomeLabels(value3);
          break;
        case 4:
          const value4 = new google_protobuf_compiler_plugin_pb.CodeGeneratorRequest;
          reader.readMessage(value4, google_protobuf_compiler_plugin_pb.CodeGeneratorRequest.deserializeBinaryFromReader);
          msg.setSomeCodeGeneratorRequest(value4);
          break;
        case 5:
          const value5 = new google_protobuf_any_pb.Any;
          reader.readMessage(value5, google_protobuf_any_pb.Any.deserializeBinaryFromReader);
          msg.setSomeAny(value5);
          break;
        case 6:
          const value6 = new google_protobuf_api_pb.Method;
          reader.readMessage(value6, google_protobuf_api_pb.Method.deserializeBinaryFromReader);
          msg.setSomeMethod(value6);
          break;
        case 7:
          const value7 = new google_protobuf_descriptor_pb.GeneratedCodeInfo;
          reader.readMessage(value7, google_protobuf_descriptor_pb.GeneratedCodeInfo.deserializeBinaryFromReader);
          msg.setSomeGeneratedCodeInfo(value7);
          break;
        case 8:
          const value8 = new google_protobuf_duration_pb.Duration;
          reader.readMessage(value8, google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
          msg.setSomeDuration(value8);
          break;
        case 9:
          const value9 = new google_protobuf_empty_pb.Empty;
          reader.readMessage(value9, google_protobuf_empty_pb.Empty.deserializeBinaryFromReader);
          msg.setSomeEmpty(value9);
          break;
        case 10:
          const value10 = new google_protobuf_field_mask_pb.FieldMask;
          reader.readMessage(value10, google_protobuf_field_mask_pb.FieldMask.deserializeBinaryFromReader);
          msg.setSomeFieldMask(value10);
          break;
        case 11:
          const value11 = new google_protobuf_source_context_pb.SourceContext;
          reader.readMessage(value11, google_protobuf_source_context_pb.SourceContext.deserializeBinaryFromReader);
          msg.setSomeSourceContext(value11);
          break;
        case 12:
          const value12 = new google_protobuf_struct_pb.Struct;
          reader.readMessage(value12, google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
          msg.setSomeStruct(value12);
          break;
        case 13:
          const value13 = new google_protobuf_timestamp_pb.Timestamp;
          reader.readMessage(value13, google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
          msg.setSomeTimestamp(value13);
          break;
        case 14:
          const value14 = new google_protobuf_type_pb.Type;
          reader.readMessage(value14, google_protobuf_type_pb.Type.deserializeBinaryFromReader);
          msg.setSomeType(value14);
          break;
        case 15:
          const value15 = new google_protobuf_wrappers_pb.DoubleValue;
          reader.readMessage(value15, google_protobuf_wrappers_pb.DoubleValue.deserializeBinaryFromReader);
          msg.setSomeDoubleValue(value15);
          break;
        default:
          reader.skipField();
          break;
      }
    }
    return msg;
  }

  serializeBinary(): Uint8Array {
    const writer = new jspb.BinaryWriter();
    MySimple.serializeBinaryToWriter(this, writer);
    return writer.getResultBuffer();
  }

  static serializeBinaryToWriter(message: MySimple, writer: jspb.BinaryWriter) {
    const f1 = message.getMyString();
    if (f1.length > 0) {
      writer.writeString(
        1,
        f1
      );
    }
    const f2 = message.getMyBool();
    if (f2) {
      writer.writeBool(
        2,
        f2
      );
    }
    const f3 = message.getSomeLabelsList();
    if (f3.length > 0) {
      writer.writeRepeatedString(
        3,
        f3
      );
    }
    const f4 = message.getSomeCodeGeneratorRequest();
    if (f4 != null) {
      writer.writeMessage(
        4,
        f4,
        google_protobuf_compiler_plugin_pb.CodeGeneratorRequest.serializeBinaryToWriter
      );
    }
    const f5 = message.getSomeAny();
    if (f5 != null) {
      writer.writeMessage(
        5,
        f5,
        google_protobuf_any_pb.Any.serializeBinaryToWriter
      );
    }
    const f6 = message.getSomeMethod();
    if (f6 != null) {
      writer.writeMessage(
        6,
        f6,
        google_protobuf_api_pb.Method.serializeBinaryToWriter
      );
    }
    const f7 = message.getSomeGeneratedCodeInfo();
    if (f7 != null) {
      writer.writeMessage(
        7,
        f7,
        google_protobuf_descriptor_pb.GeneratedCodeInfo.serializeBinaryToWriter
      );
    }
    const f8 = message.getSomeDuration();
    if (f8 != null) {
      writer.writeMessage(
        8,
        f8,
        google_protobuf_duration_pb.Duration.serializeBinaryToWriter
      );
    }
    const f9 = message.getSomeEmpty();
    if (f9 != null) {
      writer.writeMessage(
        9,
        f9,
        google_protobuf_empty_pb.Empty.serializeBinaryToWriter
      );
    }
    const f10 = message.getSomeFieldMask();
    if (f10 != null) {
      writer.writeMessage(
        10,
        f10,
        google_protobuf_field_mask_pb.FieldMask.serializeBinaryToWriter
      );
    }
    const f11 = message.getSomeSourceContext();
    if (f11 != null) {
      writer.writeMessage(
        11,
        f11,
        google_protobuf_source_context_pb.SourceContext.serializeBinaryToWriter
      );
    }
    const f12 = message.getSomeStruct();
    if (f12 != null) {
      writer.writeMessage(
        12,
        f12,
        google_protobuf_struct_pb.Struct.serializeBinaryToWriter
      );
    }
    const f13 = message.getSomeTimestamp();
    if (f13 != null) {
      writer.writeMessage(
        13,
        f13,
        google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
      );
    }
    const f14 = message.getSomeType();
    if (f14 != null) {
      writer.writeMessage(
        14,
        f14,
        google_protobuf_type_pb.Type.serializeBinaryToWriter
      );
    }
    const f15 = message.getSomeDoubleValue();
    if (f15 != null) {
      writer.writeMessage(
        15,
        f15,
        google_protobuf_wrappers_pb.DoubleValue.serializeBinaryToWriter
      );
    }
  }

  getMyString(): string {
    return jspb.Message.getFieldWithDefault(this, 1, "");
  }

  setMyString(value: string) {
    jspb.Message.setField(this, 1, value);
  }

  getMyBool(): boolean {
    return jspb.Message.getFieldWithDefault(this, 2, false);
  }

  setMyBool(value: boolean) {
    jspb.Message.setField(this, 2, value);
  }

  getSomeLabelsList(): string[] {
    return jspb.Message.getField(this, 3) as string[];
  }

  setSomeLabelsList(value: Array<string>) {
    jspb.Message.setField(this, 3, value || []);
  }

  addSomeLabels(value: string, opt_index?: number) {
    jspb.Message.addToRepeatedField(this, 3, value, opt_index);
  }

  clearSomeLabelsList() {
    this.setSomeLabelsList([]);
  }

  getSomeCodeGeneratorRequest(): google_protobuf_compiler_plugin_pb.CodeGeneratorRequest {
    return jspb.Message.getWrapperField(this, google_protobuf_compiler_plugin_pb.CodeGeneratorRequest, 4);
  }

  setSomeCodeGeneratorRequest(value?: google_protobuf_compiler_plugin_pb.CodeGeneratorRequest) {
    jspb.Message.setWrapperField(this, 4, value);
  }

  clearSomeCodeGeneratorRequest() {
    this.setSomeCodeGeneratorRequest(undefined);
  }

  hasSomeCodeGeneratorRequest(): boolean {
    return jspb.Message.getField(this, 4) != null;
  }

  getSomeAny(): google_protobuf_any_pb.Any {
    return jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 5);
  }

  setSomeAny(value?: google_protobuf_any_pb.Any) {
    jspb.Message.setWrapperField(this, 5, value);
  }

  clearSomeAny() {
    this.setSomeAny(undefined);
  }

  hasSomeAny(): boolean {
    return jspb.Message.getField(this, 5) != null;
  }

  getSomeMethod(): google_protobuf_api_pb.Method {
    return jspb.Message.getWrapperField(this, google_protobuf_api_pb.Method, 6);
  }

  setSomeMethod(value?: google_protobuf_api_pb.Method) {
    jspb.Message.setWrapperField(this, 6, value);
  }

  clearSomeMethod() {
    this.setSomeMethod(undefined);
  }

  hasSomeMethod(): boolean {
    return jspb.Message.getField(this, 6) != null;
  }

  getSomeGeneratedCodeInfo(): google_protobuf_descriptor_pb.GeneratedCodeInfo {
    return jspb.Message.getWrapperField(this, google_protobuf_descriptor_pb.GeneratedCodeInfo, 7);
  }

  setSomeGeneratedCodeInfo(value?: google_protobuf_descriptor_pb.GeneratedCodeInfo) {
    jspb.Message.setWrapperField(this, 7, value);
  }

  clearSomeGeneratedCodeInfo() {
    this.setSomeGeneratedCodeInfo(undefined);
  }

  hasSomeGeneratedCodeInfo(): boolean {
    return jspb.Message.getField(this, 7) != null;
  }

  getSomeDuration(): google_protobuf_duration_pb.Duration {
    return jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 8);
  }

  setSomeDuration(value?: google_protobuf_duration_pb.Duration) {
    jspb.Message.setWrapperField(this, 8, value);
  }

  clearSomeDuration() {
    this.setSomeDuration(undefined);
  }

  hasSomeDuration(): boolean {
    return jspb.Message.getField(this, 8) != null;
  }

  getSomeEmpty(): google_protobuf_empty_pb.Empty {
    return jspb.Message.getWrapperField(this, google_protobuf_empty_pb.Empty, 9);
  }

  setSomeEmpty(value?: google_protobuf_empty_pb.Empty) {
    jspb.Message.setWrapperField(this, 9, value);
  }

  clearSomeEmpty() {
    this.setSomeEmpty(undefined);
  }

  hasSomeEmpty(): boolean {
    return jspb.Message.getField(this, 9) != null;
  }

  getSomeFieldMask(): google_protobuf_field_mask_pb.FieldMask {
    return jspb.Message.getWrapperField(this, google_protobuf_field_mask_pb.FieldMask, 10);
  }

  setSomeFieldMask(value?: google_protobuf_field_mask_pb.FieldMask) {
    jspb.Message.setWrapperField(this, 10, value);
  }

  clearSomeFieldMask() {
    this.setSomeFieldMask(undefined);
  }

  hasSomeFieldMask(): boolean {
    return jspb.Message.getField(this, 10) != null;
  }

  getSomeSourceContext(): google_protobuf_source_context_pb.SourceContext {
    return jspb.Message.getWrapperField(this, google_protobuf_source_context_pb.SourceContext, 11);
  }

  setSomeSourceContext(value?: google_protobuf_source_context_pb.SourceContext) {
    jspb.Message.setWrapperField(this, 11, value);
  }

  clearSomeSourceContext() {
    this.setSomeSourceContext(undefined);
  }

  hasSomeSourceContext(): boolean {
    return jspb.Message.getField(this, 11) != null;
  }

  getSomeStruct(): google_protobuf_struct_pb.Struct {
    return jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 12);
  }

  setSomeStruct(value?: google_protobuf_struct_pb.Struct) {
    jspb.Message.setWrapperField(this, 12, value);
  }

  clearSomeStruct() {
    this.setSomeStruct(undefined);
  }

  hasSomeStruct(): boolean {
    return jspb.Message.getField(this, 12) != null;
  }

  getSomeTimestamp(): google_protobuf_timestamp_pb.Timestamp {
    return jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 13);
  }

  setSomeTimestamp(value?: google_protobuf_timestamp_pb.Timestamp) {
    jspb.Message.setWrapperField(this, 13, value);
  }

  clearSomeTimestamp() {
    this.setSomeTimestamp(undefined);
  }

  hasSomeTimestamp(): boolean {
    return jspb.Message.getField(this, 13) != null;
  }

  getSomeType(): google_protobuf_type_pb.Type {
    return jspb.Message.getWrapperField(this, google_protobuf_type_pb.Type, 14);
  }

  setSomeType(value?: google_protobuf_type_pb.Type) {
    jspb.Message.setWrapperField(this, 14, value);
  }

  clearSomeType() {
    this.setSomeType(undefined);
  }

  hasSomeType(): boolean {
    return jspb.Message.getField(this, 14) != null;
  }

  getSomeDoubleValue(): google_protobuf_wrappers_pb.DoubleValue {
    return jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.DoubleValue, 15);
  }

  setSomeDoubleValue(value?: google_protobuf_wrappers_pb.DoubleValue) {
    jspb.Message.setWrapperField(this, 15, value);
  }

  clearSomeDoubleValue() {
    this.setSomeDoubleValue(undefined);
  }

  hasSomeDoubleValue(): boolean {
    return jspb.Message.getField(this, 15) != null;
  }
};


text:
'''
Support for DEB packages
'''
from __future__ import absolute_import

# Import python libs
import logging
import os
import re
import datetime

# Import salt libs
import salt.utils
from salt.exceptions import CommandExecutionError, SaltInvocationError

log = logging.getLogger(__name__)

# Define the module's virtual name
__virtualname__ = 'lowpkg'

def __virtual__():
    '''
    Confirm this module is on a Debian based system
    '''
    if __grains__['os_family'] == 'Debian':
        return __virtualname__
    return (False, 'The dpkg execution module cannot be loaded: '
            'only works on Debian family systems.')

def bin_pkg_info(path, saltenv='base'):
    '''
    .. versionadded:: 2015.8.0

    Parses RPM metadata and returns a dictionary of information about the
    package (name, version, etc.).

    path
        Path to the file. Can either be an absolute path to a file on the
        minion, or a salt fileserver URL (e.g. ``salt://path/to/file.rpm``).
        If a salt fileserver URL is passed, the file will be cached to the
        minion so that it can be examined.

    saltenv : base
        Salt fileserver envrionment from which to retrieve the package. Ignored
        if ``path`` is a local file path on the minion.

    CLI Example:

    .. code-block:: bash

        salt '*' lowpkg.bin_pkg_info /root/foo-1.2.3-1ubuntu1_all.deb
        salt '*' lowpkg.bin_pkg_info salt://foo-1.2.3-1ubuntu1_all.deb
    '''
    # If the path is a valid protocol, pull it down using cp.cache_file
    if __salt__['config.valid_fileproto'](path):
        newpath = __salt__['cp.cache_file'](path, saltenv)
        if not newpath:
            raise CommandExecutionError(
                'Unable to retrieve {0} from saltenv \'{1}\''
                .format(path, saltenv)
            )
        path = newpath
    else:
        if not os.path.exists(path):
            raise CommandExecutionError(
                '{0} does not exist on minion'.format(path)
            )
        elif not os.path.isabs(path):
            raise SaltInvocationError(
                '{0} does not exist on minion'.format(path)
            )

    cmd = ['dpkg', '-I', path]
    result = __salt__['cmd.run_all'](cmd, output_loglevel='trace')
    if result['retcode'] != 0:
        msg = 'Unable to get info for ' + path
        if result['stderr']:
            msg += ': ' + result['stderr']
        raise CommandExecutionError(msg)

    ret = {}
    for line in result['stdout'].splitlines():
        line = line.strip()
        if line.startswith('Package:'):
            ret['name'] = line.split()[-1]
        elif line.startswith('Version:'):
            ret['version'] = line.split()[-1]
        elif line.startswith('Architecture:'):
            ret['arch'] = line.split()[-1]

    missing = [x for x in ('name', 'version', 'arch') if x not in ret]
    if missing:
        raise CommandExecutionError(
            'Unable to get {0} for {1}'.format(', '.join(missing), path)
        )

    if __grains__.get('cpuarch', '') == 'x86_64':
        osarch = __grains__.get('osarch', '')
        arch = ret['arch']
        if arch != 'all' and osarch == 'amd64' and osarch != arch:
            ret['name'] += ':{0}'.format(arch)

    return ret

def unpurge(*packages):
    '''
    Change package selection for each package specified to 'install'

    CLI Example:

    .. code-block:: bash

        salt '*' lowpkg.unpurge curl
    '''
    if not packages:
        return {}
    old = __salt__['pkg.list_pkgs'](purge_desired=True)
    ret = {}
    __salt__['cmd.run'](
        ['dpkg', '--set-selections'],
        stdin=r'\n'.join(['{0} install'.format(x) for x in packages]),
        python_shell=False,
        output_loglevel='trace'
    )
    __context__.pop('pkg.list_pkgs', None)
    new = __salt__['pkg.list_pkgs'](purge_desired=True)
    return salt.utils.compare_dicts(old, new)

def list_pkgs(*packages):
    '''
    List the packages currently installed in a dict::

        {'<package_name>': '<version>'}

    External dependencies::

        Virtual package resolution requires aptitude. Because this function
        uses dpkg, virtual packages will be reported as not installed.

    CLI Example:

    .. code-block:: bash

        salt '*' lowpkg.list_pkgs
        salt '*' lowpkg.list_pkgs httpd
    '''
    pkgs = {}
    cmd = 'dpkg -l {0}'.format(' '.join(packages))
    out = __salt__['cmd.run_all'](cmd, python_shell=False)
    if out['retcode'] != 0:
        msg = 'Error:  ' + out['stderr']
        log.error(msg)
        return msg
    out = out['stdout']

    for line in out.splitlines():
        if line.startswith('ii '):
            comps = line.split()
            pkgs[comps[1]] = comps[2]
    return pkgs

def file_list(*packages):
    '''
    List the files that belong to a package. Not specifying any packages will
    return a list of _every_ file on the system's package database (not
    generally recommended).

    CLI Examples:

    .. code-block:: bash

        salt '*' lowpkg.file_list httpd
        salt '*' lowpkg.file_list httpd postfix
        salt '*' lowpkg.file_list
    '''
    errors = []
    ret = set([])
    pkgs = {}
    cmd = 'dpkg -l {0}'.format(' '.join(packages))
    out = __salt__['cmd.run_all'](cmd, python_shell=False)
    if out['retcode'] != 0:
        msg = 'Error:  ' + out['stderr']
        log.error(msg)
        return msg
    out = out['stdout']

    for line in out.splitlines():
        if line.startswith('ii '):
            comps = line.split()
            pkgs[comps[1]] = {'version': comps[2],
                              'description': ' '.join(comps[3:])}
        if 'No packages found' in line:
            errors.append(line)
    for pkg in pkgs:
        files = []
        cmd = 'dpkg -L {0}'.format(pkg)
        for line in __salt__['cmd.run'](cmd, python_shell=False).splitlines():
            files.append(line)
        fileset = set(files)
        ret = ret.union(fileset)
    return {'errors': errors, 'files': list(ret)}

def file_dict(*packages):
    '''
    List the files that belong to a package, grouped by package. Not
    specifying any packages will return a list of _every_ file on the system's
    package database (not generally recommended).

    CLI Examples:

    .. code-block:: bash

        salt '*' lowpkg.file_list httpd
        salt '*' lowpkg.file_list httpd postfix
        salt '*' lowpkg.file_list
    '''
    errors = []
    ret = {}
    pkgs = {}
    cmd = 'dpkg -l {0}'.format(' '.join(packages))
    out = __salt__['cmd.run_all'](cmd, python_shell=False)
    if out['retcode'] != 0:
        msg = 'Error:  ' + out['stderr']
        log.error(msg)
        return msg
    out = out['stdout']

    for line in out.splitlines():
        if line.startswith('ii '):
            comps = line.split()
            pkgs[comps[1]] = {'version': comps[2],
                              'description': ' '.join(comps[3:])}
        if 'No packages found' in line:
            errors.append(line)
    for pkg in pkgs:
        files = []
        cmd = 'dpkg -L {0}'.format(pkg)
        for line in __salt__['cmd.run'](cmd, python_shell=False).splitlines():
            files.append(line)
        ret[pkg] = files
    return {'errors': errors, 'packages': ret}

def _get_pkg_info(*packages):
    '''
    Return list of package information. If 'packages' parameter is empty,
    then data about all installed packages will be returned.

    :param packages: Specified packages.
    :return:
    '''

    if __grains__['os'] == 'Ubuntu' and __grains__['osrelease_info'] < (12, 4):
        bin_var = '${binary}'
    else:
        bin_var = '${Package}'

    ret = []
    cmd = "dpkg-query -W -f='package:" + bin_var + "\\n" \
          "revision:${binary:Revision}\\n" \
          "architecture:${Architecture}\\n" \
          "maintainer:${Maintainer}\\n" \
          "summary:${Summary}\\n" \
          "source:${source:Package}\\n" \
          "version:${Version}\\n" \
          "section:${Section}\\n" \
          "installed_size:${Installed-size}\\n" \
          "size:${Size}\\n" \
          "MD5:${MD5sum}\\n" \
          "SHA1:${SHA1}\\n" \
          "SHA256:${SHA256}\\n" \
          "origin:${Origin}\\n" \
          "homepage:${Homepage}\\n" \
          "======\\n" \
          "description:${Description}\\n" \
          "------\\n'"
    cmd += ' {0}'.format(' '.join(packages))
    cmd = cmd.strip()

    call = __salt__['cmd.run_all'](cmd, python_chell=False)
    if call['retcode']:
        raise CommandExecutionError("Error getting packages information: {0}".format(call['stderr']))

    for pkg_info in [elm for elm in re.split(r"----*", call['stdout']) if elm.strip()]:
        pkg_data = {}
        pkg_info, pkg_descr = re.split(r"====*", pkg_info)
        for pkg_info_line in [el.strip() for el in pkg_info.split(os.linesep) if el.strip()]:
            key, value = pkg_info_line.split(":", 1)
            if value:
                pkg_data[key] = value
            install_date = _get_pkg_install_time(pkg_data.get('package'))
            if install_date:
                pkg_data['install_date'] = install_date
        pkg_data['description'] = pkg_descr.split(":", 1)[-1]
        ret.append(pkg_data)

    return ret

def _get_pkg_license(pkg):
    '''
    Try to get a license from the package.
    Based on https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/

    :param pkg:
    :return:
    '''
    licenses = set()
    cpr = "/usr/share/doc/{0}/copyright".format(pkg)
    if os.path.exists(cpr):
        with salt.utils.fopen(cpr) as fp_:
            for line in fp_.read().split(os.linesep):
                if line.startswith("License:"):
                    licenses.add(line.split(":", 1)[1].strip())

    return ", ".join(sorted(licenses))

def _get_pkg_install_time(pkg):
    '''
    Return package install time, based on the /var/lib/dpkg/info/<package>.list

    :return:
    '''
    iso_time = None
    if pkg is not None:
        location = "/var/lib/dpkg/info/{0}.list".format(pkg)
        if os.path.exists(location):
            iso_time = datetime.datetime.utcfromtimestamp(int(os.path.getmtime(location))).isoformat() + "Z"

    return iso_time

def _get_pkg_ds_avail():
    '''
    Get the package information of the available packages, maintained by dselect.
    Note, this will be not very useful, if dselect isn't installed.

    :return:
    '''
    avail = "/var/lib/dpkg/available"
    if not salt.utils.which('dselect') or not os.path.exists(avail):
        return dict()

    # Do not update with dselect, just read what is.
    ret = dict()
    pkg_mrk = "Package:"
    pkg_name = "package"
    with salt.utils.fopen(avail) as fp_:
        for pkg_info in fp_.read().split(pkg_mrk):
            nfo = dict()
            for line in (pkg_mrk + pkg_info).split(os.linesep):
                line = line.split(": ", 1)
                if len(line) != 2:
                    continue
                key, value = line
                if value.strip():
                    nfo[key.lower()] = value
            if nfo.get(pkg_name):
                ret[nfo[pkg_name]] = nfo

    return ret

def info(*packages):
    '''
    Returns a detailed summary of package information for provided package names.
    If no packages are specified, all packages will be returned.

    .. versionadded:: 2015.8.1

    packages
        The names of the packages for which to return information.

    CLI example:

    .. code-block:: bash

        salt '*' lowpkg.info
        salt '*' lowpkg.info apache2 bash
    '''
    # Get the missing information from the /var/lib/dpkg/available, if it is there.
    # However, this file is operated by dselect which has to be installed.
    dselect_pkg_avail = _get_pkg_ds_avail()

    ret = dict()
    for pkg in _get_pkg_info(*packages):
        # Merge extra information from the dselect, if available
        for pkg_ext_k, pkg_ext_v in dselect_pkg_avail.get(pkg['package'], {}).items():
            if pkg_ext_k not in pkg:
                pkg[pkg_ext_k] = pkg_ext_v
        # Remove "technical" keys
        for t_key in ['installed_size', 'depends', 'recommends',
                      'provides', 'replaces', 'conflicts', 'bugs',
                      'description-md5', 'task']:
            if t_key in pkg:
                del pkg[t_key]

        lic = _get_pkg_license(pkg['package'])
        if lic:
            pkg['license'] = lic
        ret[pkg['package']] = pkg

    return ret


text:
package com.github.gcauchis.scalablepress4j.api;

import org.junit.jupiter.api.BeforeAll;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.github.gcauchis.scalablepress4j.ScalablePress4J;
import com.github.gcauchis.scalablepress4j.model.Design;
import com.github.gcauchis.scalablepress4j.model.DesignSide;
import com.github.gcauchis.scalablepress4j.model.DesignSides;
import com.github.gcauchis.scalablepress4j.model.Dimension;
import com.github.gcauchis.scalablepress4j.model.Position;
import com.github.gcauchis.scalablepress4j.model.PositionOffset;

/**
 * The Class AbstractApiTest.
 */
abstract class AbstractApiTest {

    /** The test api logger. */
    protected final Logger log = LoggerFactory.getLogger(getClass());

    /** The scalable press spring bean. */
    protected static ScalablePress4J scalablePress;

    /** The json object mapper. */
    protected final ObjectMapper objectMapper = new ObjectMapper();

    @BeforeAll
    static void initClass() {
        scalablePress = new ScalablePress4J();
        scalablePress.setBasicAuth(":test_UrGvePVORHqYm_PQ1VzD0Q");
    }

    /**
     * Builds the test design.
     *
     * @return the design
     */
    public Design buildTestDesign() {
        Design design = new Design();
        design.setName("Test");
        design.setType("dtg");
        DesignSides designSides = new DesignSides();
        DesignSide front = new DesignSide();
        front.setArtwork("https://raw.githubusercontent.com/gcauchis/ScalablePressWrapper/master/src/test/resources/lena_150dpi.png");
        Dimension dimension = new Dimension();
        dimension.setWidth(5);
        front.setDimensions(dimension);
        Position position = new Position();
        position.setHorizontal("C");
        PositionOffset positionOffset = new PositionOffset();
        positionOffset.setTop(2.5);
        position.setOffset(positionOffset);
        front.setPosition(position);
        front.setResize(true);
        designSides.setFront(front);
        design.setSides(designSides);
        return design;
    }

    /**
     * To json string.
     *
     * @param object the object
     * @return the string
     */
    public String toJsonString(Object object) {
        String result;
        if (object == null) {
            result = "null";
        } else {
            try {
                objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
                result = objectMapper.writeValueAsString(object);
            } catch (JsonProcessingException e) {
                result = object.toString();
            }
        }
        return result;
    }
}


text:
/**
 *
 */
package org.mford.gae.testAppv6;

import static org.junit.Assert.*;

import java.util.Date;
import java.util.List;
import java.util.logging.Logger;

import org.junit.Test;
import org.mford.gae.testAppv6.dao.impl.AnemometerDaoImpl;
import org.mford.gae.testAppv6.entity.AnemometerReading;
import org.mford.gae.testAppv6.processor.AnemometerReader;
import org.mford.gae.testAppv6.processor.impl.AnemometerReaderImpl;

/**
 * @author nick
 *
 */
public class AnemometerDaoImplTest {
	private static final Logger log = Logger.getLogger(AnemometerDaoImplTest.class.getName());

	/**
	 * test dao  by reading data for specific date
	 */
	@Test
	public void readDataTest() {
		AnemometerDaoImpl dao = new AnemometerDaoImpl();
		dao.setProcessor(new AnemometerReaderImpl());
		dao.setHostSite("http://www.weather-file.com/highcliffe/data/");
		try {
			List<AnemometerReading> list = dao.read("20131210");
			log.fine("lines read "+list.size());
			System.out.print(list.size());
			assertTrue(list.size()>0);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	/**
	 * test dao processor by reading todays data
	 */
	@Test()
	public void readByDateTest() {
		AnemometerDaoImpl dao = new AnemometerDaoImpl();
		dao.setProcessor(new AnemometerReaderImpl());
		dao.setHostSite("http://www.weather-file.com/highcliffe/data/");
		try {
			List<AnemometerReading> list = dao.read(new Date());
			log.fine("lines read "+list.size());
			System.out.print(list.size());
			assertTrue(list.size()>0);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	/**
	 * test reader
	 */
	@Test
	public void readerTest() {
		String val = "2013/12/06,00:00.00,276,288,300,7.97,9.61,11.48,600";
		AnemometerReader proc = new AnemometerReaderImpl();

		AnemometerReading s1;
		try {
			s1 = proc.readLine(1,val);
			assertNotNull(s1.getTimeStamp());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}


text:
/*
 * syslinux/boot.h
 *
 * SYSLINUX boot API invocation
 */

#ifndef _SYSLINUX_BOOT_H
#define _SYSLINUX_BOOT_H

#include <stdint.h>
#include <klibc/compiler.h>

int syslinux_run_command(const char *);
__noreturn syslinux_run_default(void);

void syslinux_local_boot(uint16_t flags);

void syslinux_final_cleanup(uint16_t flags);

void syslinux_chain_bootstrap(uint16_t flags, const void *bootstrap,
			      uint32_t bootstrap_len, uint32_t edx,
			      uint32_t esi, uint16_t ds);

#define IMAGE_TYPE_KERNEL	0
#define IMAGE_TYPE_LINUX	1
#define IMAGE_TYPE_BOOT		2
#define IMAGE_TYPE_BSS		3
#define IMAGE_TYPE_PXE		4
#define IMAGE_TYPE_FDIMAGE	5
#define IMAGE_TYPE_COMBOOT	6
#define IMAGE_TYPE_COM32	7
#define IMAGE_TYPE_CONFIG	8
void syslinux_run_kernel_image(const char *filename, const char *cmdline,
			       uint32_t ipappend_flags, uint32_t type);

#endif /* _SYSLINUX_BOOT_H */


text:
<?xml version="1.0"?>
<Runs Version="1" Minor="0">
	<Run Id="impl_1" LaunchDir="/home/streit/src/scala/J1Sc/vprj/vhdl/J1Sc/J1Sc/J1Sc.runs/impl_1" FlowId="Vivado_Implementation" FromStepId="write_bitstream" ToStepId="write_bitstream"/>
</Runs>


text:
//
//  XHEmotionCollectionViewCell.h
//  MessageDisplayExample
//
//  Created by HUAJIE-1 on 14-5-3.
//  Copyright (c) 2014年 曾宪华 开发团队(http://iyilunba.com ) 本人QQ:543413507 本人QQ群(142557668). All rights reserved.
//

#import <UIKit/UIKit.h>
#import "XHEmotionManager.h"

#define kXHEmotionCollectionViewCellIdentifier @"XHEmotionCollectionViewCellIdentifier"

@interface XHEmotionCollectionViewCell : UICollectionViewCell

/**
 *  需要显示和配置的gif表情对象
 */
@property (nonatomic, strong) XHEmotion *emotion;
@property (nonatomic, assign) EmotionType emotionType;

@end