text:
#ifndef GCC_MEM_STATS_H
#define GCC_MEM_STATS_H

/* Forward declaration.  */
template<typename Key, typename Value,
	 typename Traits = simple_hashmap_traits<default_hash_traits<Key>,
						 Value> >
class hash_map;

#define LOCATION_LINE_EXTRA_SPACE 30
#define LOCATION_LINE_WIDTH	  48

/* Memory allocation location.  */
struct mem_location
{
  /* Default constructor.  */
  inline
  mem_location () {}

  /* Constructor.  */
  inline
  mem_location (mem_alloc_origin origin, bool ggc,
		const char *filename = NULL, int line = 0,
		const char *function = NULL):
    m_filename (filename), m_function (function), m_line (line), m_origin
    (origin), m_ggc (ggc) {}

  /* Copy constructor.  */
  inline
  mem_location (mem_location &other): m_filename (other.m_filename),
    m_function (other.m_function), m_line (other.m_line),
    m_origin (other.m_origin), m_ggc (other.m_ggc) {}

  /* Compute hash value based on file name, function name and line in
     source code. As there is just a single pointer registered for every
     constant that points to e.g. the same file name, we can use hash
     of the pointer.  */
  hashval_t
  hash ()
  {
    inchash::hash hash;

    hash.add_ptr (m_filename);
    hash.add_ptr (m_function);
    hash.add_int (m_line);

    return hash.end ();
  }

  /* Return true if the memory location is equal to OTHER.  */
  int
  equal (mem_location &other)
  {
    return m_filename == other.m_filename && m_function == other.m_function
      && m_line == other.m_line;
  }

  /* Return trimmed filename for the location.  */
  inline const char *
  get_trimmed_filename ()
  {
    const char *s1 = m_filename;
    const char *s2;

    while ((s2 = strstr (s1, "gcc/")))
      s1 = s2 + 4;

    return s1;
  }

  inline char *
  to_string ()
  {
    unsigned l = strlen (get_trimmed_filename ()) + strlen (m_function)
      + LOCATION_LINE_EXTRA_SPACE;

    char *s = XNEWVEC (char, l);
    sprintf (s, "%s:%i (%s)", get_trimmed_filename (),
	     m_line, m_function);

    s[MIN (LOCATION_LINE_WIDTH, l - 1)] = '\0';

    return s;
  }

  /* Return display name associated to ORIGIN type.  */
  static const char *
  get_origin_name (mem_alloc_origin origin)
  {
    return mem_alloc_origin_names[(unsigned) origin];
  }

  /* File name of source code.  */
  const char *m_filename;
  /* Funcation name.  */
  const char *m_function;
  /* Line number in source code.  */
  int m_line;
  /* Origin type.  */
  mem_alloc_origin m_origin;
  /* Flag if used by GGC allocation.  */
  bool m_ggc;
};

/* Memory usage register to a memory location.  */
struct mem_usage
{
  /* Default constructor.  */
  mem_usage (): m_allocated (0), m_times (0), m_peak (0), m_instances (1) {}

  /* Constructor.  */
  mem_usage (size_t allocated, size_t times, size_t peak, size_t instances = 0):
    m_allocated (allocated), m_times (times), m_peak (peak),
    m_instances (instances) {}

  /* Register overhead of SIZE bytes.  */
  inline void
  register_overhead (size_t size)
  {
    m_allocated += size;
    m_times++;

    if (m_peak < m_allocated)
      m_peak = m_allocated;
  }

  /* Release overhead of SIZE bytes.  */
  inline void
  release_overhead (size_t size)
  {
    gcc_assert (size <= m_allocated);

    m_allocated -= size;
  }

  /* Sum the usage with SECOND usage.  */
  mem_usage
  operator+ (const mem_usage &second)
  {
    return mem_usage (m_allocated + second.m_allocated,
		      m_times + second.m_times,
		      m_peak + second.m_peak,
		      m_instances + second.m_instances);
  }

  /* Comparison operator.  */
  inline bool
  operator< (const mem_usage &second) const
  {
    return (m_allocated == second.m_allocated ?
	    (m_peak == second.m_peak ? m_times < second.m_times
	     : m_peak < second.m_peak) : m_allocated < second.m_allocated);
  }

  /* Compare wrapper used by qsort method.  */
  static int
  compare (const void *first, const void *second)
  {
    typedef std::pair<mem_location *, mem_usage *> mem_pair_t;

    const mem_pair_t f = *(const mem_pair_t *)first;
    const mem_pair_t s = *(const mem_pair_t *)second;

    return (*f.second) < (*s.second);
  }

  /* Dump usage coupled to LOC location, where TOTAL is sum of all rows.  */
  inline void
  dump (mem_location *loc, mem_usage &total) const
  {
    char *location_string = loc->to_string ();

    fprintf (stderr, "%-48s %10" PRIu64 ":%5.1f%%"
	     "%10" PRIu64 "%10" PRIu64 ":%5.1f%%%10s\n",
	     location_string, (uint64_t)m_allocated,
	     get_percent (m_allocated, total.m_allocated),
	     (uint64_t)m_peak, (uint64_t)m_times,
	     get_percent (m_times, total.m_times), loc->m_ggc ? "ggc" : "heap");

    free (location_string);
  }

  /* Dump footer.  */
  inline void
  dump_footer () const
  {
    print_dash_line ();
    fprintf (stderr, "%s%54" PRIu64 "%27" PRIu64 "\n", "Total",
	     (uint64_t)m_allocated, (uint64_t)m_times);
    print_dash_line ();
  }

  /* Return fraction of NOMINATOR and DENOMINATOR in percent.  */
  static inline float
  get_percent (size_t nominator, size_t denominator)
  {
    return denominator == 0 ? 0.0f : nominator * 100.0 / denominator;
  }

  /* Print line made of dashes.  */
  static inline void
  print_dash_line (size_t count = 140)
  {
    while (count--)
      fputc ('-', stderr);
    fputc ('\n', stderr);
  }

  /* Dump header with NAME.  */
  static inline void
  dump_header (const char *name)
  {
    fprintf (stderr, "%-48s %11s%16s%10s%17s\n", name, "Leak", "Peak",
	     "Times", "Type");
    print_dash_line ();
  }

  /* Current number of allocated bytes.  */
  size_t m_allocated;
  /* Number of allocations.  */
  size_t m_times;
  /* Peak allocation in bytes.  */
  size_t m_peak;
  /* Number of container instances.  */
  size_t m_instances;
};

/* Memory usage pair that connectes memory usage and number
   of allocated bytes.  */
template <class T>
struct mem_usage_pair
{
  mem_usage_pair (T *usage_, size_t allocated_): usage (usage_),
  allocated (allocated_) {}

  T *usage;
  size_t allocated;
};

/* Memory allocation description.  */
template <class T>
class mem_alloc_description
{
public:
  struct mem_location_hash : nofree_ptr_hash <mem_location>
  {
    static hashval_t
    hash (value_type l)
    {
	inchash::hash hstate;

	hstate.add_ptr ((const void *)l->m_filename);
	hstate.add_ptr (l->m_function);
	hstate.add_int (l->m_line);

	return hstate.end ();
    }

    static bool
    equal (value_type l1, value_type l2)
    {
      return l1->m_filename == l2->m_filename
	&& l1->m_function == l2->m_function
	&& l1->m_line == l2->m_line;
    }
  };

  /* Internal class type definitions.  */
  typedef hash_map <mem_location_hash, T *> mem_map_t;
  typedef hash_map <const void *, mem_usage_pair<T> > reverse_mem_map_t;
  typedef hash_map <const void *, std::pair<T *, size_t> > reverse_object_map_t;
  typedef std::pair <mem_location *, T *> mem_list_t;

  /* Default contructor.  */
  mem_alloc_description ();

  /* Default destructor.  */
  ~mem_alloc_description ();

  /* Returns true if instance PTR is registered by the memory description.  */
  bool
  contains_descriptor_for_instance (const void *ptr);

  /* Return descriptor for instance PTR.  */
  T *
  get_descriptor_for_instance (const void *ptr);

  /* Register memory allocation descriptor for container PTR which is
     described by a memory LOCATION.  */
  T *
  register_descriptor (const void *ptr, mem_location *location);

  /* Register memory allocation descriptor for container PTR.  ORIGIN identifies
     type of container and GGC identifes if the allocation is handled in GGC
     memory.  Each location is identified by file NAME, LINE in source code and
     FUNCTION name.  */
  T *
  register_descriptor (const void *ptr, mem_alloc_origin origin,
			  bool ggc, const char *name, int line,
			  const char *function);

  /* Register instance overhead identified by PTR pointer. Allocation takes
     SIZE bytes.  */
  T *
  register_instance_overhead (size_t size, const void *ptr);

  /* For containers (and GGC) where we want to track every instance object,
     we register allocation of SIZE bytes, identified by PTR pointer, belonging
     to USAGE descriptor.  */
  void
  register_object_overhead (T *usage, size_t size, const void *ptr);

  /* Release PTR pointer of SIZE bytes. If REMOVE_FROM_MAP is set to true,
     remove the instance from reverse map.  */
  void
  release_instance_overhead (void *ptr, size_t size,
				  bool remove_from_map = false);

  /* Release intance object identified by PTR pointer.  */
  void
  release_object_overhead (void *ptr);

  /* Get sum value for ORIGIN type of allocation for the descriptor.  */
  T
  get_sum (mem_alloc_origin origin);

  /* Get all tracked instances registered by the description. Items
     are filtered by ORIGIN type, LENGTH is return value where we register
     the number of elements in the list. If we want to process custom order,
     CMP comparator can be provided.  */
  mem_list_t *
  get_list (mem_alloc_origin origin, unsigned *length,
	    int (*cmp) (const void *first, const void *second) = NULL);

  /* Dump all tracked instances of type ORIGIN. If we want to process custom
     order, CMP comparator can be provided.  */
  void dump (mem_alloc_origin origin,
	     int (*cmp) (const void *first, const void *second) = NULL);

  /* Reverse object map used for every object allocation mapping.  */
  reverse_object_map_t *m_reverse_object_map;

private:
  /* Register overhead of SIZE bytes of ORIGIN type. PTR pointer is allocated
     in NAME source file, at LINE in source code, in FUNCTION.  */
  T *register_overhead (size_t size, mem_alloc_origin origin, const char *name,
			int line, const char *function, const void *ptr);

  /* Allocation location coupled to the description.  */
  mem_location m_location;

  /* Location to usage mapping.  */
  mem_map_t *m_map;

  /* Reverse pointer to usage mapping.  */
  reverse_mem_map_t *m_reverse_map;
};

/* Returns true if instance PTR is registered by the memory description.  */

template <class T>
inline bool
mem_alloc_description<T>::contains_descriptor_for_instance (const void *ptr)
{
  return m_reverse_map->get (ptr);
}

/* Return descriptor for instance PTR.  */

template <class T>
inline T*
mem_alloc_description<T>::get_descriptor_for_instance (const void *ptr)
{
  return m_reverse_map->get (ptr) ? (*m_reverse_map->get (ptr)).usage : NULL;
}

  /* Register memory allocation descriptor for container PTR which is
     described by a memory LOCATION.  */
template <class T>
inline T*
mem_alloc_description<T>::register_descriptor (const void *ptr,
					       mem_location *location)
{
  T *usage = NULL;

  T **slot = m_map->get (location);
  if (slot)
    {
      delete location;
      usage = *slot;
      usage->m_instances++;
    }
  else
    {
      usage = new T ();
      m_map->put (location, usage);
    }

  if (!m_reverse_map->get (ptr))
    m_reverse_map->put (ptr, mem_usage_pair<T> (usage, 0));

  return usage;
}

/* Register memory allocation descriptor for container PTR.  ORIGIN identifies
   type of container and GGC identifes if the allocation is handled in GGC
   memory.  Each location is identified by file NAME, LINE in source code and
   FUNCTION name.  */

template <class T>
inline T*
mem_alloc_description<T>::register_descriptor (const void *ptr,
					       mem_alloc_origin origin,
					       bool ggc,
					       const char *filename,
					       int line,
					       const char *function)
{
  mem_location *l = new mem_location (origin, ggc, filename, line, function);
  return register_descriptor (ptr, l);
}

/* Register instance overhead identified by PTR pointer. Allocation takes
   SIZE bytes.  */

template <class T>
inline T*
mem_alloc_description<T>::register_instance_overhead (size_t size,
						      const void *ptr)
{
  mem_usage_pair <T> *slot = m_reverse_map->get (ptr);
  if (!slot)
    {
      /* Due to PCH, it can really happen.  */
      return NULL;
    }

  T *usage = (*slot).usage;
  usage->register_overhead (size);

  return usage;
}

/* For containers (and GGC) where we want to track every instance object,
   we register allocation of SIZE bytes, identified by PTR pointer, belonging
   to USAGE descriptor.  */

template <class T>
void
mem_alloc_description<T>::register_object_overhead (T *usage, size_t size,
						    const void *ptr)
{
  /* In case of GGC, it is possible to have already occupied the memory
     location.  */
  m_reverse_object_map->put (ptr, std::pair<T *, size_t> (usage, size));
}

/* Register overhead of SIZE bytes of ORIGIN type. PTR pointer is allocated
   in NAME source file, at LINE in source code, in FUNCTION.  */

template <class T>
inline T*
mem_alloc_description<T>::register_overhead (size_t size,
					     mem_alloc_origin origin,
					     const char *filename,
					     int line,
					     const char *function,
					     const void *ptr)
{
  T *usage = register_descriptor (ptr, origin, filename, line, function);
  usage->register_overhead (size);

  return usage;
}

/* Release PTR pointer of SIZE bytes.  */

template <class T>
inline void
mem_alloc_description<T>::release_instance_overhead (void *ptr, size_t size,
						     bool remove_from_map)
{
  mem_usage_pair<T> *slot = m_reverse_map->get (ptr);

  if (!slot)
    {
      /* Due to PCH, it can really happen.  */
      return;
    }

  mem_usage_pair<T> usage_pair = *slot;
  usage_pair.usage->release_overhead (size);

  if (remove_from_map)
    m_reverse_map->remove (ptr);
}

/* Release intance object identified by PTR pointer.  */

template <class T>
inline void
mem_alloc_description<T>::release_object_overhead (void *ptr)
{
  std::pair <T *, size_t> *entry = m_reverse_object_map->get (ptr);
  if (entry)
    {
      entry->first->release_overhead (entry->second);
      m_reverse_object_map->remove (ptr);
    }
}

/* Default contructor.  */

template <class T>
inline
mem_alloc_description<T>::mem_alloc_description ()
{
  m_map = new mem_map_t (13, false, false);
  m_reverse_map = new reverse_mem_map_t (13, false, false);
  m_reverse_object_map = new reverse_object_map_t (13, false, false);
}

/* Default destructor.  */

template <class T>
inline
mem_alloc_description<T>::~mem_alloc_description ()
{
  for (typename mem_map_t::iterator it = m_map->begin (); it != m_map->end ();
       ++it)
    {
      delete (*it).first;
      delete (*it).second;
    }

  delete m_map;
  delete m_reverse_map;
  delete m_reverse_object_map;
}

/* Get all tracked instances registered by the description. Items are filtered
   by ORIGIN type, LENGTH is return value where we register the number of
   elements in the list. If we want to process custom order, CMP comparator
   can be provided.  */

template <class T>
inline
typename mem_alloc_description<T>::mem_list_t *
mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length,
			int (*cmp) (const void *first, const void *second))
{
  /* vec data structure is not used because all vectors generate memory
     allocation info a it would create a cycle.  */
  size_t element_size = sizeof (mem_list_t);
  mem_list_t *list = XCNEWVEC (mem_list_t, m_map->elements ());
  unsigned i = 0;

  for (typename mem_map_t::iterator it = m_map->begin (); it != m_map->end ();
       ++it)
    if ((*it).first->m_origin == origin)
      list[i++] = std::pair<mem_location*, T*> (*it);

  qsort (list, i, element_size, cmp == NULL ? T::compare : cmp);
  *length = i;

  return list;
}

/* Get sum value for ORIGIN type of allocation for the descriptor.  */

template <class T>
inline T
mem_alloc_description<T>::get_sum (mem_alloc_origin origin)
{
  unsigned length;
  mem_list_t *list = get_list (origin, &length);
  T sum;

  for (unsigned i = 0; i < length; i++)
    sum = sum + *list[i].second;

  XDELETEVEC (list);

  return sum;
}

/* Dump all tracked instances of type ORIGIN. If we want to process custom
   order, CMP comparator can be provided.  */

template <class T>
inline void
mem_alloc_description<T>::dump (mem_alloc_origin origin,
				int (*cmp) (const void *first,
					    const void *second))
{
  unsigned length;

  fprintf (stderr, "\n");

  mem_list_t *list = get_list (origin, &length, cmp);
  T total = get_sum (origin);

  T::dump_header (mem_location::get_origin_name (origin));
  for (int i = length - 1; i >= 0; i--)
    list[i].second->dump (list[i].first, total);

  total.dump_footer ();

  XDELETEVEC (list);

  fprintf (stderr, "\n");
}

#endif // GCC_MEM_STATS_H


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

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:layout_margin="10dp"
        android:clickable="true"
        android:foreground="?android:attr/selectableItemBackground"
        card_view:cardCornerRadius="4dp"
        android:id="@+id/bProgressDialog"
        >

        <TextView
            android:layout_width="match_parent"
            android:gravity="center"
            android:layout_height="match_parent"
            android:text="Click this card to show G+ Progress Dialog"/>

    </android.support.v7.widget.CardView>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/bButterBar"
        android:text="Show Butter Bar"/>

    <ImageButton
        android:layout_height="70dp"
        android:layout_width="70dp"
        android:clickable="true"
        android:padding="20dp"
        android:layout_margin="10dp"
        android:scaleType="fitCenter"
        android:src="@drawable/add_fab"
        android:background="@drawable/fab_background"/>

    <android.support.v7.internal.widget.CompatTextView
        android:layout_width="wrap_content"
        android:id="@+id/tvSample"
        android:layout_height="wrap_content" />

    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <android.support.v7.internal.widget.TintEditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Android is Awesome"/>

    <android.support.v7.widget.SwitchCompat
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <android.support.v7.internal.widget.TintRadioButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

redpajama_set_name: RedPajamaGithub


text:
PayPal PHP SDK release notes
============================

v0.8.0
-----
* Invoicing API support added

v0.7.1
-----
* Added support for Reauthorization

v0.7.0
-----
* Added support for Auth and Capture APIs
* Types modified to match the API Spec
* Updated SDK to use namespace supported core library

v0.6.0
-----
* Adding support for dynamic configuration of SDK (Upgrading sdk-core-php dependency to V1.4.0)
* Deprecating the setCredential method and changing resource class methods to take an ApiContext argument instead of a OauthTokenCredential argument.

v0.5.0
-----
* Initial Release


text:
copyright:

  years: 2015, 2017
lastupdated: "2017-04-11"

---

{:new_window: target="_blank"}
{:shortdesc: .shortdesc}

# Support des services
{: #services}

{{site.data.keyword.Bluemix}} simplifie l'implémentation, l'hébergement et la mise à l'échelle des services et des applications. Ainsi,
vous pouvez vous consacrer à la logique et à la conception de l'application.
{:shortdesc}

Plusieurs niveaux de support existent pour les services {{site.data.keyword.Bluemix_notm}}. Le tableau
suivant décrit les informations de support générales pour les services {{site.data.keyword.Bluemix_notm}} :

|Type	|Description	|Détails du support|
|:------|:--------------|:--------------|
|IBM	|Service fourni par IBM et généralement disponible.	|Les problèmes considérés comme un défaut d'un service fourni par IBM généralement disponible sont traités. Le support dépend de la gravité que vous définissez. Pour plus d'informations sur la gravité des tickets, voir [Contacter le service de support](/docs/support/index.html#contacting-bluemix-support){: new_window}.|
|Tiers	|Service fourni par une société autre qu'IBM.	|Le support des services de tiers est assuré par le fournisseur de service. Si IBM examine un problème et détermine qu'il s'agit d'un défaut d'un service de tiers, elle n'est pas obligée de fournir un correctif. IBM partagera son analyse avec le fournisseur de service de tiers si nécessaire.|
|Communauté	|Service fourni par une communauté open source.	|Le support des services de communauté est assuré par la communauté des développeurs {{site.data.keyword.Bluemix_notm}}. Si IBM examine un problème et détermine qu'il s'agit d'un défaut d'un service de communauté, elle n'est pas obligée de fournir un correctif.|
|Bêta	|Service qui n'est pas prêt pour la phase de production et qui se trouve au stade d'essai de développement. Un service bêta peut aider les équipes de développement et marketing à évaluer la valeur d'un service avant de le rendre généralement disponible.	|Les problèmes identifiés comme défauts dans un service bêta fourni par IBM sont pris en charge, mais IBM n'est pas obligée de fournir un correctif. De plus, le ticket de problème sera associé à une gravité de 3 ou 4 si applicable. Pour plus d'informations sur la gravité des tickets, voir [Contacter le support ![Icône de lien externe](../icons/launch-glyph.svg "Icône de lien externe")](/docs/support/index.html#contacting-bluemix-support){: new_window}.|
{: caption="Tableau 1. Informations de support des services Bluemix" caption-side="top"}

##Services expérimentaux
{: #experimental_services}

{{site.data.keyword.Bluemix_notm}}
propose également des services expérimentaux que vous pouvez essayer. Pour afficher tous les services expérimentaux, les conteneurs boilerplate et les
contextes d'exécution disponibles, connectez-vous à la console {{site.data.keyword.Bluemix_notm}}, cliquez sur **Catalogue**,
faites défiler le catalogue jusqu'à la fin, puis cliquez sur **Services expérimentaux
{{site.data.keyword.Bluemix_notm}}**.

Les services expérimentaux peuvent
être instables et faire l'objet de modifications entraînant leur incompatibilité avec les versions précédentes. L'utilisation de ces services dans des
environnements de production n'est pas recommandée. Le support des services expérimentaux est assuré par la communauté des développeurs {{site.data.keyword.Bluemix_notm}}. Si IBM examine un problème et
détermine qu'il s'agit d'un défaut d'un service expérimental, elle n'est pas obligée de fournir un correctif.


text:
title:  Kuri ni Vakasama
date:   25/05/2018
---

O ira na gonevuli ni Vola Tabu era sa raica rawa tiko na i sema e tiko vei rau na kaci e na Vakatakila 14:7, meda vakarokoroko Vua e bulia na lomalagi kei na vuravura, na wasawasa kei na veivurevure ni wai"), kei na i kava ni vunau ni Lako Yani 20:11. Na cavuti ni "veivurevure ni wai" e rawa ni sema ki na waluvu ne i Noa. Rawa ni o wilika na Creation, Catastrophe, and Calvary: Why a Global Flood Is Vital to the Doctrine of Atonement, p. 27; e vola o John Baldwin.

**Taro ni Veiwasei:**

`1. Na "koi keda kece" ena Aisea 53:6 e tukuni Vakaipiriu me cullanu ka tautauvata oqori kei "noda caka cala kece ga." E vukea vakacava oqori na vakasama ni sega ni rawa ni levu na i valavala ca mai na kena i wali?`

`2. Na cava tale e rawa nida vulica mai na i talanoa ni daubutako e na kauveilatai?`

**Toqa koto era na veivakasama ko vulica ena macawa oqo:**

`1.	Nai tukutuku ni Veilewai - Vakatakila 14:7`

`2.	Nai tukutuku ni Veibuli - Vakatakila 4:11, Same 95:6,7 Same 100:3`

`3. Nai tukutuku ni veilewai kei na veibuli - Dauvunau 11:1,6 12:13,14, Vakatakila 14:6-13`


text:
use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;

fn fisub_1() {
    run_test(&Instruction { mnemonic: Mnemonic::FISUB, operand1: Some(IndirectDisplaced(SI, 7739, Some(OperandSize::Dword), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[218, 164, 59, 30], OperandSize::Word)
}

fn fisub_2() {
    run_test(&Instruction { mnemonic: Mnemonic::FISUB, operand1: Some(Indirect(EAX, Some(OperandSize::Dword), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[218, 32], OperandSize::Dword)
}

fn fisub_3() {
    run_test(&Instruction { mnemonic: Mnemonic::FISUB, operand1: Some(IndirectScaledDisplaced(RBX, Eight, 1808013844, Some(OperandSize::Dword), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[218, 36, 221, 20, 26, 196, 107], OperandSize::Qword)
}

fn fisub_4() {
    run_test(&Instruction { mnemonic: Mnemonic::FISUB, operand1: Some(IndirectScaledIndexed(BX, DI, One, Some(OperandSize::Word), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[222, 33], OperandSize::Word)
}

fn fisub_5() {
    run_test(&Instruction { mnemonic: Mnemonic::FISUB, operand1: Some(IndirectScaledIndexedDisplaced(EBX, ECX, Four, 1059526679, Some(OperandSize::Word), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[222, 164, 139, 23, 24, 39, 63], OperandSize::Dword)
}

fn fisub_6() {
    run_test(&Instruction { mnemonic: Mnemonic::FISUB, operand1: Some(IndirectDisplaced(RDI, 1430712950, Some(OperandSize::Word), None)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[222, 167, 118, 242, 70, 85], OperandSize::Qword)
}


text:
/*
panel.css (part of editor.css)
================================

Panels are floating elements that can hold different types of contents.
The following are common uses of it:

	- The element that toolbar combos display when opening them.
	- The context menu.
	- The list of items displayed by "menu buttons" (e.g. scayt).
	- The panel shown when opening "panel buttons" (e.g. color buttons).

Panel contents are wrapped into an iframe, so it is possible to have additional
CSS loaded inside them (e.g. to have more accurate preview on the styles combo).

The following is a visual representation of the outer elements of a panel:

+-- .cke_panel(*) ---------------------+
| +-- IFRAME.cke_panel_frame --------+ |
| | +-- HTML.cke_panel_container --+ | |
| | | +-- .cke_panel_block ------+ | | |
| | | |                          | | | |
| | | |     (contents here)      | | | |
| | | |                          | | | |
| | | +--------------------------+ | | |
| | +------------------------------+ | |
| +----------------------------------+ |
+--------------------------------------+

(*) All kinds of panel share the above structure. Menu panels adds the
    .cke_menu_panel class to the outer element, while toolbar combos add the
	.cke_combopanel class.

This file also defines styles for panel lists (used by combos). For menu-like
panel contents and color panels check menu.css and colorpanel.css.
*/

/* The box that holds an IFRAME. It's inserted into a host document and positioned
   absolutely by the application. It floats above the host document/editor. */
.cke_panel
{
	/* Restore the loading hide */
	visibility: visible;

	border: 1px solid #8f8f73;
	background-color: #fff;

	width: 120px;
	height: 100px;

	overflow: hidden;

	border-radius: 3px;
}

/* This class represents panels which are used as context menus. */
.cke_menu_panel
{
	padding: 2px;
	margin: 0;
}

/* This class represents panels which are used by rich combos. */
.cke_combopanel
{
	border: 1px solid #8f8f73;
	border-top-left-radius: 0;
	width: 150px;
    height: 170px;
}

/* The IFRAME the panel is wrapped into. */
.cke_panel_frame
{
	width: 100%;
	height: 100%;

	/* Font */
	font-family: Arial, Verdana, sans-serif;
	font-size: 12px;

	overflow: auto;
	overflow-x: hidden;
}

/* The HTML document which is a direct descendant of the IFRAME */
.cke_panel_container
{
	overflow-y: auto;
	overflow-x: hidden;
}

/*
Here we start the definition of panel lists (e.g. combo panels). The following
is its visual representation:

+-- .cke_panel_block -----------------+
| +-- .cke_panel_grouptitle --------+ |
| |                                 | |
| +---------------------------------+ |
| +-- .cke_panel_list --------------+ |
| | +-- .cke_panel_listItem ------+ | |
| | | +-- a --------------------+ | | |
| | | | +-- span -------------+ | | | |
| | | | |                     | | | | |
| | | | +---------------------+ | | | |
| | | +-------------------------+ | | |
| | +-----------------------------+ | |
| | +-- .cke_panel_listItem ------+ | |
| | | +-- a --------------------+ | | |
| | | | +-- span -------------+ | | | |
| | | | |                     | | | | |
| | | | +---------------------+ | | | |
| | | +-------------------------+ | | |
| | +-----------------------------+ | |
| | ...                             | |
| +---------------------------------+ |
+-------------------------------------+
*/

/* The list of panel items. */
.cke_panel_list
{
	list-style-type: none;
	margin: 3px;
	padding: 0px;
	white-space: nowrap;
}

/* The item of .cke_panel_list */
.cke_panel_listItem
{
	margin: 0px;
}

/* The child of .cke_panel_listItem. These elements contain spans which are
   to display a real name of the property which is visible for an end-user. */
.cke_panel_listItem a
{
	padding: 2px;
	display: block;
	border: 1px solid #fff;
	color: inherit !important;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* IE6 */
* html .cke_panel_listItem a
{
	width : 100%;

	/* IE is not able to inherit the color, so we must force it to black */
	color: #000;
}

/* IE7 */
*:first-child+html .cke_panel_listItem a
{
	/* IE is not able to inherit the color, so we must force it to black */
	color: #000;
}

.cke_panel_listItem.cke_selected a
{
	border: 1px solid #ccc;
	background-color: #e9f5ff;
}

.cke_panel_listItem a:hover,
.cke_panel_listItem a:focus,
.cke_panel_listItem a:active
{
	border-color: #316ac5;
	background-color: #dff1ff;
}

.cke_hc .cke_panel_listItem.cke_selected a,
.cke_hc .cke_panel_listItem a:hover,
.cke_hc .cke_panel_listItem a:focus,
.cke_hc .cke_panel_listItem a:active
{
	border-width: 3px;
	padding: 0px;
}

/* The title of the entire panel which is visible on top of the list. */
.cke_panel_grouptitle
{
	font-size: 11px;
	font-family: 'Microsoft Sans Serif' , Tahoma, Arial, Verdana, Sans-Serif;
	font-weight: bold;
	white-space: nowrap;
	background-color: #dcdcdc;
	color: #000;
	margin:0px;
	padding:3px;
}

/* The following styles set defaults of the elements used by the Paragraph
   Format panel. */
.cke_panel_listItem p,
.cke_panel_listItem h1,
.cke_panel_listItem h2,
.cke_panel_listItem h3,
.cke_panel_listItem h4,
.cke_panel_listItem h5,
.cke_panel_listItem h6,
.cke_panel_listItem pre
{
	margin-top: 3px;
	margin-bottom: 3px;
}


text:
// (C) Copyright 2015 Moodle Pty Ltd.
//
// 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.

import { Injectable, Type } from '@angular/core';

import { AddonQbehaviourDeferredFeedbackHandler } from '@addons/qbehaviour/deferredfeedback/services/handlers/deferredfeedback';
import { CoreQuestionBehaviourHandler, CoreQuestionQuestionWithAnswers } from '@features/question/services/behaviour-delegate';
import { makeSingleton } from '@singletons';
import { CoreQuestionQuestionParsed, CoreQuestionsAnswers, CoreQuestionState } from '@features/question/services/question';
import { CoreQuestionHelper } from '@features/question/services/question-helper';
import { AddonQbehaviourDeferredCBMComponent } from '../../component/deferredcbm';
import { CoreQuestionDelegate } from '@features/question/services/question-delegate';

/**
 * Handler to support deferred CBM question behaviour.
 */
@Injectable({ providedIn: 'root' })
export class AddonQbehaviourDeferredCBMHandlerService implements CoreQuestionBehaviourHandler {

    name = 'AddonQbehaviourDeferredCBM';
    type = 'deferredcbm';

    /**
     * Determine a question new state based on its answer(s).
     *
     * @param component Component the question belongs to.
     * @param attemptId Attempt ID the question belongs to.
     * @param question The question.
     * @param componentId Component ID.
     * @param siteId Site ID. If not defined, current site.
     * @return New state (or promise resolved with state).
     */
    determineNewState(
        component: string,
        attemptId: number,
        question: CoreQuestionQuestionWithAnswers,
        componentId: string | number,
        siteId?: string,
    ): CoreQuestionState | Promise<CoreQuestionState> {
        // Depends on deferredfeedback.
        return AddonQbehaviourDeferredFeedbackHandler.determineNewStateDeferred(
            component,
            attemptId,
            question,
            componentId,
            siteId,
            this.isCompleteResponse.bind(this),
            this.isSameResponse.bind(this),
        );
    }

    /**
     * Handle a question behaviour.
     * If the behaviour requires a submit button, it should add it to question.behaviourButtons.
     * If the behaviour requires to show some extra data, it should return the components to render it.
     *
     * @param question The question.
     * @return Components (or promise resolved with components) to render some extra data in the question
     *         (e.g. certainty options). Don't return anything if no extra data is required.
     */
    handleQuestion(question: CoreQuestionQuestionParsed): void | Type<unknown>[] {
        if (CoreQuestionHelper.extractQbehaviourCBM(question)) {
            return [AddonQbehaviourDeferredCBMComponent];
        }
    }

    /**
     * Check if a response is complete.
     *
     * @param question The question.
     * @param answers Object with the question answers (without prefix).
     * @param component The component the question is related to.
     * @param componentId Component ID.
     * @return 1 if complete, 0 if not complete, -1 if cannot determine.
     */
    protected isCompleteResponse(
        question: CoreQuestionQuestionParsed,
        answers: CoreQuestionsAnswers,
        component: string,
        componentId: string | number,
    ): number {
        // First check if the question answer is complete.
        const complete = CoreQuestionDelegate.isCompleteResponse(question, answers, component, componentId);
        if (complete > 0) {
            // Answer is complete, check the user answered CBM too.
            return answers['-certainty'] ? 1 : 0;
        }

        return complete;
    }

    /**
     * Whether or not the handler is enabled on a site level.
     *
     * @return True or promise resolved with true if enabled.
     */
    async isEnabled(): Promise<boolean> {
        return true;
    }

    /**
     * Check if two responses are the same.
     *
     * @param question Question.
     * @param prevAnswers Object with the previous question answers.
     * @param prevBasicAnswers Object with the previous basic" answers (without sequencecheck, certainty, ...).
     * @param newAnswers Object with the new question answers.
     * @param newBasicAnswers Object with the previous basic" answers (without sequencecheck, certainty, ...).
     * @param component The component the question is related to.
     * @param componentId Component ID.
     * @return Whether they're the same.
     */
    protected isSameResponse(
        question: CoreQuestionQuestionParsed,
        prevAnswers: CoreQuestionsAnswers,
        prevBasicAnswers: CoreQuestionsAnswers,
        newAnswers: CoreQuestionsAnswers,
        newBasicAnswers: CoreQuestionsAnswers,
        component: string,
        componentId: string | number,
    ): boolean {
        // First check if the question answer is the same.
        const sameResponse = CoreQuestionDelegate.isSameResponse(
            question,
            prevBasicAnswers,
            newBasicAnswers,
            component,
            componentId,
        );

        if (sameResponse) {
            // Same response, check the CBM is the same too.
            return prevAnswers['-certainty'] == newAnswers['-certainty'];
        }

        return sameResponse;
    }

}

export const AddonQbehaviourDeferredCBMHandler = makeSingleton(AddonQbehaviourDeferredCBMHandlerService);


text:
ACCEPTED

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

#### Published in
Kew Bull. 57(3): 535 (2002)

#### Original name
Ascochyta ulicis-caledoniensis Punith., 2002

### Remarks
null


text:
package com.example.diary.opiekun;
import java.util.List;
import java.util.Map;
import com.example.diary.*;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;

public class OpiekunOcenaActivity extends Activity {
	TextView tv1;
	String rok_szkolny=null, semestr=null, id=null, idP=null, imieW;
	Intent i;
	List<Map<String, String>> result = null, przedmioty = null, getUczenId = null;
	int iloscO, iloscP;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_opiekun_ocena);
		tv1 = (TextView) findViewById(R.id.textView1);
		i = getIntent();
		imieW = getIntent().getExtras().getString("imieW");
		Log.d("imieW", imieW);
		rok_szkolny = getIntent().getExtras().getString("rok_szkolny");
		semestr = getIntent().getExtras().getString("obecny_semestr");
		tv1.setText("Oceny ucznia: "+imieW+"\nRok szkolny "+rok_szkolny+", semestr "+semestr+".");

		TableLayout oceny = (TableLayout) findViewById(R.id.tabelka);
		oceny.setStretchAllColumns(true);
		oceny.setColumnShrinkable(1, true);
		oceny.bringToFront();
		// tu zapytanie do bazy zwracaj¹ce najlepiej wszystkie dane ocen, i wpisywanie ich do odpowiednich
		// kratek

		getUczenId = Utilities.query(this, "getUczenId",imieW);
		 id = getUczenId.get(0).get("id_ucznia");
		przedmioty = Utilities.query(this, "getUczenPrzedmioty",id);
		int iloscP = przedmioty.size();
		for(int a=0;a<iloscP;a++){
			idP = przedmioty.get(a).get("id_przedmiotu");
			result = Utilities.query(this, "getUczenOceny",id,idP,rok_szkolny,semestr);
			iloscO = result.size();
			if(iloscO==0){

			}
			else {
				TableRow p1 = new TableRow(this);
				TextView p = new TextView(this);
				p.setText(przedmioty.get(a).get("nazwa"));
				p1.addView(p);
				oceny.addView(p1);
				TableRow p2 = new TableRow(this);

				for(int b=0;b<iloscO;b++){
					TextView o = new TextView(this);
					o.setId(b);
					o.setText(result.get(b).get("wartosc"));
					String cos = result.get(b).get("data") +", "+result.get(b).get("uwaga_oceny");
					o.setOnClickListener(new Listener(cos, getApplicationContext()));
					p2.addView(o);
				}
				oceny.addView(p2);
			}
		}
	}
}


text:
/* perfect-scrollbar v0.6.8 */
.ps-container {
	-ms-touch-action: none;
overflow: hidden !important; }
.ps-container.ps-active-x > .ps-scrollbar-x-rail,
.ps-container.ps-active-y > .ps-scrollbar-y-rail {
display: block; z-index: 100;}
.ps-container.ps-in-scrolling {
pointer-events: none; }
.ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
	background-color: #f8fbfd;
opacity: 1; }
.ps-container.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
background-color: #ccceee; }
.ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
	background-color: #f8fbfd;
opacity: 1; }
.ps-container.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
background-color: #ccceee; }
.ps-container > .ps-scrollbar-x-rail {
	display: none;
	position: absolute;
	/* please don't change 'position' */
	border-radius: 4px;
	opacity: 1;
	bottom: 3px;
	/* there must be 'bottom' for ps-scrollbar-x-rail */
height: 8px; }
.ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x {
	position: absolute;
	/* please don't change 'position' */
	background-color: #ccceee;
	-webkit-transition: background-color 0.2s linear;
	-moz-transition: background-color 0.2s linear;
	-o-transition: background-color 0.2s linear;
	transition: background-color 0.2s linear;
	bottom: 0;
	/* there must be 'bottom' for ps-scrollbar-x */
height: 8px; }
.ps-container > .ps-scrollbar-y-rail {
	display: block;
	position: absolute;
	/* please don't change 'position' */
	opacity: 1;
	right: 0;
	/* there must be 'right' for ps-scrollbar-y-rail */
	width: 5px;
background-color: #f8fbfd}
.ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y {
	position: absolute;
	/* please don't change 'position' */
	background-color: #ccceee;
	-webkit-transition: background-color 0.2s linear;
	-moz-transition: background-color 0.2s linear;
	-o-transition: background-color 0.2s linear;
	transition: background-color 0.2s linear;
	right: 0;
	opacity: 0.7;
	/* there must be 'right' for ps-scrollbar-y */
width: 5px; }
.ps-container:hover.ps-in-scrolling {
pointer-events: none; }
.ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail {
	background-color: #f8fbfd;
opacity: 1; }
.ps-container:hover.ps-in-scrolling.ps-x > .ps-scrollbar-x-rail > .ps-scrollbar-x {
background-color: #ccceee; }
.ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail {
	background-color: #f8fbfd;
opacity: 1; }
.ps-container:hover.ps-in-scrolling.ps-y > .ps-scrollbar-y-rail > .ps-scrollbar-y {
background-color: #ccceee; }
.ps-container:hover > .ps-scrollbar-x-rail,
.ps-container:hover > .ps-scrollbar-y-rail {
opacity: 1; }
.ps-container:hover > .ps-scrollbar-x-rail:hover {
	background-color: #f8fbfd;
opacity: 1; }
.ps-container:hover > .ps-scrollbar-x-rail:hover > .ps-scrollbar-x {
background-color: #ccceee; }
.ps-container:hover > .ps-scrollbar-y-rail:hover {
	background-color: #f8fbfd;
opacity: 1; }
/*    .ps-container:hover > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y {
background-color: #ccceee; }*/


text:
FROM centos:centos7

# Add the shibboleth repository
ADD http://download.opensuse.org/repositories/security://shibboleth/CentOS_7/security:shibboleth.repo /etc/yum.repos.d

RUN yum update
RUN yum -y install httpd shibboleth-embedded-ds
RUN yum clean all

# Run Apache in the foreground when running this container
ENTRYPOINT [ "/usr/sbin/httpd", "-D", "FOREGROUND" ]


text:
package org.sakaiproject.groupmanager.controller;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Optional;

import javax.inject.Inject;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import org.sakaiproject.authz.api.AuthzGroup.RealmLockMode;
import org.sakaiproject.authz.api.AuthzRealmLockException;
import org.sakaiproject.authz.api.Member;
import org.sakaiproject.groupmanager.constants.GroupManagerConstants;
import org.sakaiproject.groupmanager.form.GroupForm;
import org.sakaiproject.groupmanager.service.SakaiService;
import org.sakaiproject.site.api.Group;
import org.sakaiproject.site.api.Site;
import org.sakaiproject.site.api.SiteService;
import org.sakaiproject.site.util.SiteConstants;
import org.sakaiproject.site.util.SiteGroupHelper;
import org.sakaiproject.sitemanage.api.SiteHelper;
import org.sakaiproject.user.api.User;
import org.sakaiproject.util.comparator.UserSortNameComparator;

@Slf4j
@Controller
public class GroupController {

    @Inject
    private MessageSource messageSource;

    @Autowired
    private SakaiService sakaiService;

    @RequestMapping(value = "/group")
    public String showGroup(Model model,
    		@RequestParam(required=false) String groupId,
    		@RequestParam(required=false) String filterByGroupId,
    		@RequestParam(required=false) String currentTitle,
    		@RequestParam(required=false) String currentDescription ) {
        log.debug("showGroup called with groupId {}.", groupId);

        Optional<Site> siteOptional = sakaiService.getCurrentSite();
        if (!siteOptional.isPresent()) {
            return GroupManagerConstants.REDIRECT_MAIN_TEMPLATE;
        }

        Site site = siteOptional.get();

        // The form values which are optional.
        GroupForm groupForm = new GroupForm();
        groupForm.setGroupTitle(StringUtils.isNotBlank(currentTitle) ? currentTitle : StringUtils.EMPTY);
        groupForm.setGroupDescription(StringUtils.isNotBlank(currentDescription) ? currentDescription : StringUtils.EMPTY);
        groupForm.setJoinableSetName(StringUtils.EMPTY);
        groupForm.setJoinableSetNumOfMembers(String.valueOf(1));
        groupForm.setGroupAllowPreviewMembership(false);
        groupForm.setGroupUnjoinable(false);

        // The list of roles assigned to the group, only for existing groups.
        List<String> roleProviderList = new ArrayList<String>();
        // The list of members assigned to the group, only for existing groups.
        List<String> currentGroupMembers = new ArrayList<String>();
        // List of joinable sets that can be assigned to the group
        List<String> joinableSetList = new ArrayList<String>();
        // Full list of the site members.
        List<User> siteMemberList = new ArrayList<User>();
        // Group and Section lists for the group filter.
        List<Group> groupList = new ArrayList<Group>();
        List<Group> sectionList = new ArrayList<Group>();
        // Selected group as a filter, display the members of that group only.
        Group filterGroup = null;
        Optional<Group> optionalFilterGroup = sakaiService.findGroupById(filterByGroupId);
        if (StringUtils.isNotEmpty(filterByGroupId) && optionalFilterGroup.isPresent()) {
            filterGroup = optionalFilterGroup.get();
        }
        // Set the filtered group id in the form
        groupForm.setFilterByGroupId(optionalFilterGroup.isPresent() ? filterByGroupId : StringUtils.EMPTY);

        // The group exists so we should edit it
        if (StringUtils.isNotBlank(groupId)) {
            Optional<Group> optionalGroup = sakaiService.findGroupById(groupId);
            if (optionalGroup.isPresent()) {
                Group group = optionalGroup.get();
                if (RealmLockMode.ALL.equals(group.getRealmLock()) || RealmLockMode.MODIFY.equals(group.getRealmLock())) {
                    log.error("The user {} is trying to modify the locked group {}, returning to main.", sakaiService.getCurrentUserId(), groupId);
                    return GroupManagerConstants.REDIRECT_MAIN_TEMPLATE;
                }

                // After finding the group, assign all the existing values to the form.
                groupForm.setGroupId(groupId);
                groupForm.setGroupTitle(group.getTitle());
                groupForm.setGroupDescription(group.getDescription());
                groupForm.setGroupAllowViewMembership(group.getProperties().get(Group.GROUP_PROP_VIEW_MEMBERS) != null && Boolean.valueOf(group.getProperties().getProperty(Group.GROUP_PROP_VIEW_MEMBERS)).booleanValue());
                String roleProviderId = group.getProperties().getProperty(SiteConstants.GROUP_PROP_ROLE_PROVIDERID);
                // Get the roles currently assigned to the group.
                roleProviderList = StringUtils.isNotBlank(roleProviderId) ? (ArrayList<String>) SiteGroupHelper.unpack(roleProviderId) : new ArrayList<String>();

                // Add members to the membership selector only if they were not provided by a role.
                for (Member member : group.getMembers()) {
                    if (!roleProviderList.contains(member.getRole().getId())) {
                        currentGroupMembers.add(member.getUserId());
                    }
                }

                // Add the current members to the existing roles.
                roleProviderList.addAll(currentGroupMembers);
                // Set the list with the roles and the users in the form of an existing group.
                groupForm.setGroupMembers(roleProviderList);

                String joinableSet = group.getProperties().getProperty(Group.GROUP_PROP_JOINABLE_SET);
                if (StringUtils.isNotBlank(joinableSet)) {
                    groupForm.setJoinableSetName(joinableSet);
                    groupForm.setJoinableSetNumOfMembers(StringUtils.isNotBlank(group.getProperties().getProperty(Group.GROUP_PROP_JOINABLE_SET_MAX)) ? group.getProperties().getProperty(Group.GROUP_PROP_JOINABLE_SET_MAX) : String.valueOf(0));
                    groupForm.setGroupAllowPreviewMembership(Boolean.valueOf(group.getProperties().getProperty(Group.GROUP_PROP_JOINABLE_SET_PREVIEW)));
                    groupForm.setGroupUnjoinable(Boolean.valueOf(group.getProperties().getProperty(Group.GROUP_PROP_JOINABLE_UNJOINABLE)));
                }
            }
        }

        // Get all the joinable sets from all the site groups.
        site.getGroups().forEach(group -> {
            String joinableSet = group.getProperties().getProperty(Group.GROUP_PROP_JOINABLE_SET);
            if (StringUtils.isNotBlank(joinableSet) && !joinableSetList.contains(joinableSet)) {
                joinableSetList.add(joinableSet);
            }
        });
        Collections.sort(joinableSetList);

        // For every member of the site or the filtered group, add it to the selector except if they were provided by a role.
        for (Member member : filterGroup == null ? site.getMembers() : filterGroup.getMembers()) {
            if (!roleProviderList.contains(member.getRole().getId())) {
                Optional<User> memberUserOptional = sakaiService.getUser(member.getUserId());
                if (memberUserOptional.isPresent()) {
                    siteMemberList.add(memberUserOptional.get());
                }
            }
        }
        //Sort the members of the site by sort name.
        Collections.sort(siteMemberList, new UserSortNameComparator());

        // Filter by groups or sections
        site.getGroups().forEach(group -> {
            String wsetupCreated = group.getProperties().getProperty(Group.GROUP_PROP_WSETUP_CREATED);
            if (StringUtils.isNotBlank(wsetupCreated) && Boolean.valueOf(wsetupCreated)) {
                groupList.add(group);
            } else {
                sectionList.add(group);
            }
        });

        // Add the attributes to the model
        model.addAttribute("groupForm", groupForm);
        model.addAttribute("siteRoleList", site.getRoles());
        model.addAttribute("joinableSetList", joinableSetList);
        model.addAttribute("siteMemberList", siteMemberList);
        model.addAttribute("groupList", groupList);
        model.addAttribute("sectionList", sectionList);

        return GroupManagerConstants.GROUP_TEMPLATE;
    }

    @PostMapping(value = "/saveGroup")
    public String saveGroup(@ModelAttribute GroupForm groupForm, Model model) {
        log.debug("saveGroup called, saving a group with title {}", groupForm.getGroupTitle());

        Optional<Site> siteOptional = sakaiService.getCurrentSite();
        if (!siteOptional.isPresent()) {
            return GroupManagerConstants.REDIRECT_MAIN_TEMPLATE;
        }

        Site site = siteOptional.get();

        // Variable definition
        Locale userLocale = sakaiService.getCurrentUserLocale();
        String groupId = groupForm.getGroupId();
        String groupTitle = groupForm.getGroupTitle();
        String groupDescription = groupForm.getGroupDescription();
        String filterByGroupId = groupForm.getFilterByGroupId();
        String joinableSetName = groupForm.getJoinableSetName();
        // The group can be new or existing.
        Group group = null;
        List<Member> currentGroupMembers = null;
        List<String> selectedProviderIdList = new ArrayList<String>();
        List<String> addedGroupMemberList = new ArrayList<String>();

        //Ensure the group title is provided
        if (StringUtils.isBlank(groupTitle)) {
            model.addAttribute("errorMessage", messageSource.getMessage("groups.error.providetitle", null, userLocale));
            return showGroup(model, groupId, filterByGroupId, groupTitle, groupDescription);
        }

        //Ensure the group title is shorter than the maximum allowed
        if (groupTitle.length() > 99) {
            model.addAttribute("errorMessage", messageSource.getMessage("groups.error.titlelength", null, userLocale));
            return showGroup(model, groupId, filterByGroupId, groupTitle, groupDescription);
        }

        // If a joinable set is selected, validate the maximum number of members.
        if (StringUtils.isNoneBlank(joinableSetName, groupForm.getJoinableSetNumOfMembers())) {
            try {
                int joinableSetMaxMembers = Integer.parseInt(groupForm.getJoinableSetNumOfMembers());
                if (joinableSetMaxMembers <= 0 || joinableSetMaxMembers > 999) {
                    throw new NumberFormatException();
                }
            } catch (NumberFormatException  e) {
                model.addAttribute("errorMessage", messageSource.getMessage("groups.error.maxmembers", null, userLocale));
                return showGroup(model, groupId, filterByGroupId, groupTitle, groupDescription);
            }
        }

        //Ensure the group title is not in use by other groups.
        if (site.getGroups().stream().anyMatch(g -> !g.getId().equals(groupId) && groupTitle.equalsIgnoreCase(g.getTitle()))) {
            model.addAttribute("errorMessage", messageSource.getMessage("groups.error.sametitle", null, userLocale));
            return showGroup(model, groupId, filterByGroupId, groupTitle, groupDescription);
        }

        // If the group already exists, get it from the site and delete all the members.
        if (StringUtils.isNotBlank(groupId)) {
            group = site.getGroup(groupId);
            // Save the current members first
            currentGroupMembers = new ArrayList<Member>(group.getMembers());
            try {
                group.deleteMembers();
            } catch (AuthzRealmLockException e) {
                log.error("The members of the group {} cannot be deleted because the group is locked.", groupId);
            }
        }

        // If the group is new, create a new one.
        if (group == null) {
            group = site.addGroup();
            currentGroupMembers = new ArrayList<Member>();
            group.getProperties().addProperty(Group.GROUP_PROP_WSETUP_CREATED, Boolean.TRUE.toString());
        }

        // Set the title, description and properties of the group.
        group.setTitle(groupTitle);
        group.setDescription(groupForm.getGroupDescription());
        group.getProperties().addProperty(Group.GROUP_PROP_VIEW_MEMBERS, String.valueOf(groupForm.isGroupAllowViewMembership()));

        // Assign or delete the joinable set
        if (StringUtils.isNotBlank(joinableSetName)) {
            group.getProperties().addProperty(Group.GROUP_PROP_JOINABLE_SET, joinableSetName);
            group.getProperties().addProperty(Group.GROUP_PROP_JOINABLE_SET_MAX, groupForm.getJoinableSetNumOfMembers());
            group.getProperties().addProperty(Group.GROUP_PROP_JOINABLE_SET_PREVIEW, String.valueOf(groupForm.isGroupAllowPreviewMembership()));
            group.getProperties().addProperty(Group.GROUP_PROP_JOINABLE_UNJOINABLE, String.valueOf(groupForm.isGroupUnjoinable()));
        } else {
            group.getProperties().removeProperty(Group.GROUP_PROP_JOINABLE_SET);
            group.getProperties().removeProperty(Group.GROUP_PROP_JOINABLE_SET_MAX);
            group.getProperties().removeProperty(Group.GROUP_PROP_JOINABLE_SET_PREVIEW);
            group.getProperties().removeProperty(Group.GROUP_PROP_JOINABLE_UNJOINABLE);
        }

        // Assign roles or members to the groups.
        for (String selectedGroupMember : groupForm.getGroupMembers()) {
            // If the selected member is a role, add all the members of this role to the group
            if (site.getRoles().stream().anyMatch(s -> selectedGroupMember.equals(s.getId()))) {
                selectedProviderIdList.add(selectedGroupMember);
                for (String memberId : site.getUsersHasRole(selectedGroupMember)) {
                    Member member = site.getMember(memberId);
                    if (member != null) {
                        group.addMember(member.getUserId(), member.getRole().getId(), member.isActive(), false);
                        addedGroupMemberList.add(member.getUserId());
                    }
                }
            // If the selected member is not a role, add it as individual member.
            } else {
                Member member = site.getMember(selectedGroupMember);
                if (member != null) {
                    group.addMember(member.getUserId(), member.getRole().getId(), member.isActive(), false);
                    addedGroupMemberList.add(member.getUserId());
                }
            }
        }

        // Update the GROUP_PROP_ROLE_PROVIDERID property of the group with the selected roles.
        if (!selectedProviderIdList.isEmpty()) {
            group.getProperties().addProperty(SiteConstants.GROUP_PROP_ROLE_PROVIDERID, SiteGroupHelper.pack(selectedProviderIdList));
        } else {
            group.getProperties().removeProperty(SiteConstants.GROUP_PROP_ROLE_PROVIDERID);
        }

        sakaiService.saveSite(site);

        //Post Add and Remove events for each added/removed user.
        if (sakaiService.getBooleanProperty(SiteHelper.WSETUP_TRACK_USER_MEMBERSHIP_CHANGE, false)) {
            // Post an event for each individual member added
            for (String addedUserId : addedGroupMemberList) {
                if (currentGroupMembers.stream().noneMatch(member -> addedUserId.equals(member.getUserId()))) {
                    sakaiService.postEvent(SiteService.EVENT_USER_GROUP_MEMBERSHIP_ADD, addedUserId);
                }
            }

            // Post an event for each individual member removed
            currentGroupMembers.forEach(currentMember -> {
                if (!addedGroupMemberList.contains(currentMember.getUserId())) {
                    // an event for each individual member remove
                    sakaiService.postEvent(SiteService.EVENT_USER_GROUP_MEMBERSHIP_REMOVE, currentMember.getUserId());
                }
            });
        }

        return GroupManagerConstants.REDIRECT_MAIN_TEMPLATE;
    }

}


text:
arduino
=======

my arduino project


text:
(function() {
  'use strict';

  angular
  .module('App.controller')
  .controller('MainController', MainController);

  MainController.$inject = [
    '$log'
  ];

  function MainController($log){
    $log.debug('[MainController]');
  }

}());


text:
resque-delay-with-mongoid
---------------

Based on [resque-delay by Michael Rykov](https://github.com/rykov/resque-delay)

Adds support for mongoid backends.

Requires the resque gem.

Allows to call .send_later or .delay.method on objects ala DelayedJob

Installation
============

    $ gem install resque-delay-with-mongoid

Author
=====

K$ :: kdmny30@gmail.com


text:
drop table users if exists
go

drop procedure getusers if exists
go

create table users (
  id int,
  name varchar(20)
)
go

create procedure getusers()
modifies sql data
dynamic result sets 1
BEGIN ATOMIC
  declare cur cursor for select * from users order by id;
  open cur;
END
go

insert into users (id, name) values(1, 'User1')
go

insert into users (id, name) values(2, 'User1')
go

insert into users (id, name) values(3, 'User1')
go

insert into users (id, name) values(4, 'User1')
go

insert into users (id, name) values(5, 'User1')
go


text:
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>

async function languageChange() {
    return new Promise(resolve => window.onlanguagechange = resolve);
}

async function languageChangeEvent() {
    return new Promise(resolve => window.addEventListener('languagechange', resolve));
}

promise_test(async () => {
    var testValues = [
        { accept_languages: 'foo', languages: ['foo'] },
        { accept_languages: '', languages: ['en-US'] },
        { accept_languages: 'foo,bar', languages: [ 'foo' ] },
        { accept_languages: '  foo , bar ', languages: [ 'foo' ] },
        { accept_languages: '  foo ; bar ', languages: [ 'foo ; bar' ] },
        { accept_languages: '_foo_', languages: ['_foo_'] },
        { accept_languages: 'en_', languages: ['en-'] },
        { accept_languages: 'en__', languages: ['en-_'] },
        { accept_languages: 'en_US, fr_FR', languages: ['en-US'] },
        { accept_languages: 'en_US_CA', languages: ['en-US_CA'] },
    ];

    for (var i = 0; i < testValues.length; ++i) {
        var data = testValues[i];

        var languageChangePromise = languageChange();
        testRunner.setAcceptLanguages(data.accept_languages);
        await languageChangePromise;

        assert_equals(navigator.languages.length, 1);
        assert_equals(navigator.language, data.languages[0]);
        for (var j = 0; j < navigator.languages.length; ++j) {
            console.log(j);
            assert_equals(data.languages[j], navigator.languages[j]);
        }
    }
}, "Test that navigator.languages reflects the accept languages value.");

</script>
</body>
</html>


text:
package com.github.abarhub.filerw;

import com.github.abarhub.filerw.binary.FieldsListChamps2;
import com.github.abarhub.filerw.text.FieldsListChamps1;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;

import static org.junit.jupiter.api.Assertions.*;

class LineContentTest {

    @Nested
    class TestConstructeur {

        @Test
        void constructeur1() {
            // act
            LineContent<FieldsListChamps1> result = createLineContent(FieldsListChamps1.class);

            // assert
            assertNotNull(result);
        }

        @Test
        void constructeur2() {
            // act
            LineContent<FieldsListChamps2> result = createLineContent(FieldsListChamps2.class);

            // assert
            assertNotNull(result);
        }

        @Test
        void constructeur3() {
            // act
            IllegalArgumentException result = assertThrows(IllegalArgumentException.class,
                    () -> createLineContent((Class<Field>) null));

            // assert
            assertNotNull(result);
        }

        @Test
        void constructeur4() {
            // arrange
            List<FieldsListChamps1> liste = Tools.convClassEnum(FieldsListChamps1.class);

            // act
            LineContent<FieldsListChamps1> result = createLineContent(liste);

            // assert
            assertNotNull(result);
        }

        @Test
        void constructeur5() {
            // arrange
            List<FieldsListChamps1> liste = new ArrayList<>();

            // act
            IllegalArgumentException result = assertThrows(IllegalArgumentException.class,
                    () -> createLineContent(liste));

            // assert
            assertNotNull(result);
        }

        @Test
        void constructeur6() {
            // arrange
            List<FieldsListChamps1> liste = null;

            // act
            IllegalArgumentException result = assertThrows(IllegalArgumentException.class,
                    () -> createLineContent(liste));

            // assert
            assertNotNull(result);
        }
    }

    @Test
    void getFieldsList() {
        // arrange
        LineContent<FieldsListChamps1> lineContent = createLineContent();

        // act
        List<FieldsListChamps1> result = lineContent.getFieldsList();

        // assert
        assertNotNull(result);
        assertEquals(3, result.size());
        assertTrue(result.contains(FieldsListChamps1.Nom));
        assertTrue(result.contains(FieldsListChamps1.Prenom));
        assertTrue(result.contains(FieldsListChamps1.DateNaissance));
    }

    @Nested
    class TestHashCode {

        @Test
        void testHashCode1() {
            // arrange
            LineContent<FieldsListChamps1> lineContent = createLineContent();
            LineContent<FieldsListChamps2> lineContent2 = createLineContent2();

            // act
            int result = lineContent.hashCode();
            int result2 = lineContent2.hashCode();

            // assert
            assertNotEquals(result2, result);
        }

        @Test
        void testHashCode2() {
            // arrange
            LineContent<FieldsListChamps1> lineContent = createLineContent();
            LineContent<FieldsListChamps1> lineContent2 = createLineContent();

            // act
            int result = lineContent.hashCode();
            int result2 = lineContent2.hashCode();

            // assert
            assertEquals(result2, result);
        }

        @Test
        void testHashCode3() {
            // arrange
            LineContent<FieldsListChamps2> lineContent = createLineContent2();
            LineContent<FieldsListChamps2> lineContent2 = createLineContent2();

            // act
            int result = lineContent.hashCode();
            int result2 = lineContent2.hashCode();

            // assert
            assertEquals(result2, result);
        }
    }

    @Nested
    class TestEquals {

        @Test
        void testEquals() {
            // arrange
            LineContent<FieldsListChamps1> lineContent = createLineContent();
            LineContent<FieldsListChamps1> lineContent2 = createLineContent();

            // act
            boolean result = lineContent.equals(lineContent2);

            // assert
            assertTrue(result);
        }

        @Test
        void testEquals2() {
            // arrange
            LineContent<FieldsListChamps1> lineContent = createLineContent();
            LineContent<FieldsListChamps2> lineContent2 = createLineContent2();

            // act
            boolean result = lineContent.equals(lineContent2);

            // assert
            assertFalse(result);
        }

        @Test
        void testEquals3() {
            // arrange
            LineContent<FieldsListChamps1> lineContent = createLineContent();
            LineContent<FieldsListChamps2> lineContent2 = null;

            // act
            boolean result = lineContent.equals(lineContent2);

            // assert
            assertFalse(result);
        }

        @Test
        void testEquals4() {
            // arrange
            LineContent<FieldsListChamps1> lineContent = createLineContent();
            LineContent<FieldsListChamps1> lineContent2 = lineContent;

            // act
            boolean result = lineContent.equals(lineContent2);

            // assert
            assertTrue(result);
        }

        @Test
        void testEquals5() {
            // arrange
            LineContent<FieldsListChamps1> lineContent = createLineContent();

            // act
            boolean result = lineContent.equals("abc");

            // assert
            assertFalse(result);
        }
    }

    // tools

    private LineContent<FieldsListChamps1> createLineContent() {
        return createLineContent(FieldsListChamps1.class);
    }

    private LineContent<FieldsListChamps2> createLineContent2() {
        return createLineContent(FieldsListChamps2.class);
    }

    private <T extends Field> LineContent<T> createLineContent(Class<T> clazz) {
        return new LineContent<T>(clazz) {
            @Override
            public void show(PrintStream out) {

            }
        };
    }

    private <T extends Field> LineContent<T> createLineContent(List<T> fieldsList) {
        return new LineContent<T>(fieldsList) {
            @Override
            public void show(PrintStream out) {

            }
        };
    }
}


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="JpegDecoder.cs" company="OxyPlot">
//   Copyright (c) 2014 OxyPlot contributors
// </copyright>
// <summary>
//   Implements support for decoding jpeg images.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace OxyPlot
{
    using System;
    using System.IO;

    /// <summary>
    /// Implements support for decoding jpeg images.
    /// </summary>
    public class JpegDecoder : IImageDecoder
    {
        // http://en.wikipedia.org/wiki/Exchangeable_image_file_format
        // http://www.exif.org/Exif2-2.PDF
        // http://gvsoft.homedns.org/exif/exif-explanation.html
        // http://www.codeproject.com/Articles/43665/ExifLibrary-for-NET
        // http://www.codeproject.com/Articles/36342/ExifLib-A-Fast-Exif-Data-Extractor-for-NET-2-0
        // http://www.codeproject.com/Articles/27242/ExifTagCollection-An-EXIF-metadata-extraction-libr
        // http://www.codeproject.com/Articles/47486/Understanding-and-Reading-Exif-Data
        // https://drewnoakes.com/code/exif/

        /// <summary>
        /// Defines the EXIF tags.
        /// </summary>
        public enum ExifTags
        {
            // IFD0 items
            ImageWidth = 0x100,
            ImageLength = 0x101,
            BitsPerSample = 0x102,
            Compression = 0x103,
            PhotometricInterpretation = 0x106,
            ImageDescription = 0x10E,
            Make = 0x10F,
            Model = 0x110,
            StripOffsets = 0x111,
            Orientation = 0x112,
            SamplesPerPixel = 0x115,
            RowsPerStrip = 0x116,
            StripByteCounts = 0x117,
            XResolution = 0x11A,
            YResolution = 0x11B,
            PlanarConfiguration = 0x11C,
            ResolutionUnit = 0x128,
            TransferFunction = 0x12D,
            Software = 0x131,
            DateTime = 0x132,
            Artist = 0x13B,
            WhitePoint = 0x13E,
            PrimaryChromaticities = 0x13F,
            JPEGInterchangeFormat = 0x201,
            JPEGInterchangeFormatLength = 0x202,
            YCbCrCoefficients = 0x211,
            YCbCrSubSampling = 0x212,
            YCbCrPositioning = 0x213,
            ReferenceBlackWhite = 0x214,
            Copyright = 0x8298,

            // SubIFD items
            ExposureTime = 0x829A,
            FNumber = 0x829D,
            ExposureProgram = 0x8822,
            SpectralSensitivity = 0x8824,
            ISOSpeedRatings = 0x8827,
            OECF = 0x8828,
            ExifVersion = 0x9000,
            DateTimeOriginal = 0x9003,
            DateTimeDigitized = 0x9004,
            ComponentsConfiguration = 0x9101,
            CompressedBitsPerPixel = 0x9102,
            ShutterSpeedValue = 0x9201,
            ApertureValue = 0x9202,
            BrightnessValue = 0x9203,
            ExposureBiasValue = 0x9204,
            MaxApertureValue = 0x9205,
            SubjectDistance = 0x9206,
            MeteringMode = 0x9207,
            LightSource = 0x9208,
            Flash = 0x9209,
            FocalLength = 0x920A,
            SubjectArea = 0x9214,
            MakerNote = 0x927C,
            UserComment = 0x9286,
            SubsecTime = 0x9290,
            SubsecTimeOriginal = 0x9291,
            SubsecTimeDigitized = 0x9292,
            FlashpixVersion = 0xA000,
            ColorSpace = 0xA001,
            PixelXDimension = 0xA002,
            PixelYDimension = 0xA003,
            RelatedSoundFile = 0xA004,
            FlashEnergy = 0xA20B,
            SpatialFrequencyResponse = 0xA20C,
            FocalPlaneXResolution = 0xA20E,
            FocalPlaneYResolution = 0xA20F,
            FocalPlaneResolutionUnit = 0xA210,
            SubjectLocation = 0xA214,
            ExposureIndex = 0xA215,
            SensingMethod = 0xA217,
            FileSource = 0xA300,
            SceneType = 0xA301,
            CFAPattern = 0xA302,
            CustomRendered = 0xA401,
            ExposureMode = 0xA402,
            WhiteBalance = 0xA403,
            DigitalZoomRatio = 0xA404,
            FocalLengthIn35mmFilm = 0xA405,
            SceneCaptureType = 0xA406,
            GainControl = 0xA407,
            Contrast = 0xA408,
            Saturation = 0xA409,
            Sharpness = 0xA40A,
            DeviceSettingDescription = 0xA40B,
            SubjectDistanceRange = 0xA40C,
            ImageUniqueID = 0xA420,

            // GPS subifd items
            GPSVersionID = 0x0,
            GPSLatitudeRef = 0x1,
            GPSLatitude = 0x2,
            GPSLongitudeRef = 0x3,
            GPSLongitude = 0x4,
            GPSAltitudeRef = 0x5,
            GPSAltitude = 0x6,
            GPSTimestamp = 0x7,
            GPSSatellites = 0x8,
            GPSStatus = 0x9,
            GPSMeasureMode = 0xA,
            GPSDOP = 0xB,
            GPSSpeedRef = 0xC,
            GPSSpeed = 0xD,
            GPSTrackRef = 0xE,
            GPSTrack = 0xF,
            GPSImgDirectionRef = 0x10,
            GPSImgDirection = 0x11,
            GPSMapDatum = 0x12,
            GPSDestLatitudeRef = 0x13,
            GPSDestLatitude = 0x14,
            GPSDestLongitudeRef = 0x15,
            GPSDestLongitude = 0x16,
            GPSDestBearingRef = 0x17,
            GPSDestBearing = 0x18,
            GPSDestDistanceRef = 0x19,
            GPSDestDistance = 0x1A,
            GPSProcessingMethod = 0x1B,
            GPSAreaInformation = 0x1C,
            GPSDateStamp = 0x1D,
            GPSDifferential = 0x1E
        }

        /// <summary>
        /// Gets information about the image in the specified byte array.
        /// </summary>
        /// <param name="bytes">The image data.</param>
        /// <returns>An <see cref="OxyImageInfo" /> structure.</returns>
        /// <exception cref="System.FormatException">Invalid SOI
        /// or
        /// Invalid APP0 marker
        /// or
        /// Invalid marker
        /// or
        /// Invalid Exif identifier
        /// or
        /// Invalid TIFF identifier</exception>
        public OxyImageInfo GetImageInfo(byte[] bytes)
        {
            int width = -1;
            int height = -1;
            double dpix = double.NaN;
            double dpiy = double.NaN;
            int bitDepth = -1;

            // TODO: This code is not yet working.
            var ms = new MemoryStream(bytes);
            var inputReader = new BinaryReader(ms);
            var soi = inputReader.ReadBytes(2); // FFD8
            if (soi[0] != 0xFF || soi[1] != 0xD8)
            {
                throw new FormatException("Invalid SOI");
            }

            // APP0 marker
            var app0 = inputReader.ReadBytes(2); // FFE0
            if (app0[0] != 0xFF || app0[1] != 0xE0)
            {
                throw new FormatException("Invalid APP0 marker");
            }

            var length0 = inputReader.ReadUInt16();
            var identifier = inputReader.ReadString(4);
            var zero = inputReader.ReadByte();
            var version = inputReader.ReadBytes(2);

            var densityUnits = inputReader.ReadByte();
            var xdensity = inputReader.ReadUInt16();
            var ydensity = inputReader.ReadUInt16();

            // thumbnail
            var tw = inputReader.ReadByte();
            var th = inputReader.ReadByte();
            var td = inputReader.ReadBytes(3 * tw * th);

            while (true)
            {
                var ff = inputReader.ReadByte();
                if (ff != 0xFF)
                {
                    throw new FormatException("Invalid marker");
                }

                var marker = inputReader.ReadByte();
                var length = inputReader.ReadUInt16();
                switch (marker)
                {
                    case 0xE1: // APP1
                        var id = inputReader.ReadString(4); // Exif
                        if (id != "Exif")
                        {
                            throw new FormatException("Invalid Exif identifier");
                        }

                        var zeros = inputReader.ReadBytes(2);

                        // TIFF HEADER
                        var baseOffset = ms.Position;
                        var byteOrder = inputReader.ReadBytes(2);
                        var isLittleEndian = byteOrder[0] == 0x49 && byteOrder[1] == 0x49; // Intel
                        var tiffId = inputReader.ReadBytes(2); // 002A
                        if (tiffId[0] != 0x00 || tiffId[1] != 0x2A)
                        {
                            throw new FormatException("Invalid TIFF identifier");
                        }

                        uint exifIfdOffset = 0;

                        var offset = inputReader.ReadUInt32(isLittleEndian);
                        ms.Seek(offset - 8, SeekOrigin.Current);
                        var fieldCount = inputReader.ReadUInt16(isLittleEndian);
                        for (int i = 0; i < fieldCount; i++)
                        {
                            var tag = (ExifTags)inputReader.ReadUInt16(isLittleEndian);
                            var fieldType = inputReader.ReadUInt16(isLittleEndian);
                            var count = (int)inputReader.ReadUInt32(isLittleEndian);

                            var current = ms.Position;
                            var value = ReadValue(inputReader, ms, isLittleEndian, fieldType, count, baseOffset);

                            if ((uint)tag == 0x8769)
                            {
                                exifIfdOffset = (uint)value;
                            }

                            System.Diagnostics.Debug.WriteLine(tag + ":" + value);
                            ms.Position = current + 4;
                        }

                        ms.Position = baseOffset + exifIfdOffset;
                        fieldCount = inputReader.ReadUInt16(isLittleEndian);
                        for (int i = 0; i < fieldCount; i++)
                        {
                            var tag = (ExifTags)inputReader.ReadUInt16(isLittleEndian);
                            var fieldType = inputReader.ReadUInt16(isLittleEndian);
                            var count = (int)inputReader.ReadUInt32(isLittleEndian);

                            var current = ms.Position;
                            var value = ReadValue(inputReader, ms, isLittleEndian, fieldType, count, baseOffset);

                            if ((uint)tag == 0x8769)
                            {
                                exifIfdOffset = (uint)value;
                            }

                            System.Diagnostics.Debug.WriteLine(tag + ":" + value);
                            ms.Position = current + 4;
                        }

                        break;
                    default:
                        ms.Seek(length - 2, SeekOrigin.Current);
                        break;
                }
            }

#pragma warning disable CS0162 // Unreachable code detected
            // Analyzer isn't properly detecting break in infinite loop and therefore shows a warning.
            return new OxyImageInfo
            {
                Width = width,
                Height = height,
                DpiX = dpix,
                DpiY = dpiy,
                BitsPerPixel = bitDepth
            };
        }
#pragma warning restore CS0162 // Unreachable code detected

        private static object ReadValue(
            BinaryReader inputReader,
            MemoryStream ms,
            bool isLittleEndian,
            ushort fieldType,
            int count,
            long baseOffset)
        {
            switch (fieldType)
            {
                case 1:
                    {
                        var valueOrOffset = inputReader.ReadUInt32(isLittleEndian);

                        if (count == 1)
                        {
                            var value = inputReader.ReadByte();
                            var x = inputReader.ReadBytes(3);
                            return value;
                        }

                        if (count < 4)
                        {
                            var value = inputReader.ReadBytes(count);
                            if (count < 4)
                            {
                                var x = inputReader.ReadBytes(4 - count);
                            }

                            return value;
                        }

                        ms.Position = baseOffset + valueOrOffset;
                        return inputReader.ReadBytes(count);
                    }

                case 2:
                    {
                        if (count <= 4)
                        {
                            var value = inputReader.ReadString(count).Trim('\0');
                            if (count < 4)
                            {
                                inputReader.ReadBytes(4 - count);
                            }

                            return value;
                        }

                        var valueOrOffset = inputReader.ReadUInt32(isLittleEndian);
                        ms.Position = baseOffset + valueOrOffset;
                        return inputReader.ReadString(count).Trim('\0');
                    }

                case 3:
                    {
                        if (count == 1)
                        {
                            var value = inputReader.ReadUInt16(isLittleEndian);
                            var x = inputReader.ReadUInt16(isLittleEndian);
                            return value;
                        }

                        if (count == 2)
                        {
                            return inputReader.ReadUInt16Array(count, isLittleEndian);
                        }

                        var valueOrOffset = inputReader.ReadUInt32(isLittleEndian);
                        ms.Position = baseOffset + valueOrOffset;
                        return inputReader.ReadUInt16Array(count, isLittleEndian);
                    }
                case 4:
                    {
                        if (count == 1)
                        {
                            return inputReader.ReadUInt32(isLittleEndian);
                        }

                        var valueOrOffset = inputReader.ReadUInt32(isLittleEndian);
                        ms.Position = baseOffset + valueOrOffset;
                        return inputReader.ReadUInt32Array(count, isLittleEndian);
                    }

                case 5:
                    {
                        var valueOrOffset = inputReader.ReadUInt32(isLittleEndian);
                        ms.Position = baseOffset + valueOrOffset;
                        if (count == 1)
                        {
                            var nominator = inputReader.ReadUInt32(isLittleEndian);
                            var denominator = inputReader.ReadUInt32(isLittleEndian);
                            return (double)nominator / denominator;
                        }

                        throw new NotImplementedException();
                    }

                case 10:
                    {
                        var valueOrOffset = inputReader.ReadInt32(isLittleEndian);
                        ms.Position = baseOffset + valueOrOffset;
                        if (count == 1)
                        {
                            var nominator = inputReader.ReadInt32(isLittleEndian);
                            var denominator = inputReader.ReadInt32(isLittleEndian);
                            return (double)nominator / denominator;
                        }

                        throw new NotImplementedException();
                    }
            }

            throw new NotImplementedException();
        }

        /// <summary>
        /// Decodes an image from the specified stream.
        /// </summary>
        /// <param name="s">The stream.</param>
        /// <returns>The 32-bit pixel data.</returns>
        public OxyColor[,] Decode(byte[] bytes)
        {
            throw new NotImplementedException();
        }
    }
}


text:
using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Interop;
using System.Windows.Media.Imaging;
using AutoClicker.Model.Abstraction.Interface.Inputs;
using Size = System.Drawing.Size;

namespace AutoClicker.Model.Inputs
{
    internal class ScreenMaker : IScreenMaker
    {
        public BitmapSource GetBitmapSourceFromScreen()
        {
            var left = Screen.AllScreens.Min(screen => screen.Bounds.X);
            var top = Screen.AllScreens.Min(screen => screen.Bounds.Y);
            var right = Screen.AllScreens.Max(screen => screen.Bounds.X + screen.Bounds.Width);
            var bottom = Screen.AllScreens.Max(screen => screen.Bounds.Y + screen.Bounds.Height);
            var width = right - left;
            var height = bottom - top;

            using(var screenBmp = new Bitmap(width, height, PixelFormat.Format32bppArgb))
            {
                using(var bmpGraphics = Graphics.FromImage(screenBmp))
                {
                    bmpGraphics.CopyFromScreen(left, top, 0, 0, new Size(width, height));
                    return Imaging.CreateBitmapSourceFromHBitmap(screenBmp.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
                }
            }
        }

        public Bitmap GetBitmapFromScreen()
        {
            var screenLeft = SystemParameters.VirtualScreenLeft;
            var screenTop = SystemParameters.VirtualScreenTop;
            var screenWidth = SystemParameters.VirtualScreenWidth;
            var screenHeight = SystemParameters.VirtualScreenHeight;

            var bmp = new Bitmap((int)screenWidth, (int)screenHeight);
            using(var g = Graphics.FromImage(bmp))
            {
                g.CopyFromScreen((int)screenLeft, (int)screenTop, 0, 0, bmp.Size);
                return bmp;
            }
        }

        public BitmapSource GetBitmapSourceFromScreen(Rectangle rectangle)
        {
            using(var screenBmp = new Bitmap(rectangle.Width, rectangle.Height, PixelFormat.Format32bppArgb))
            {
                using(var bmpGraphics = Graphics.FromImage(screenBmp))
                {
                    bmpGraphics.CopyFromScreen(rectangle.X, rectangle.Y, 0, 0, new Size(rectangle.Width, rectangle.Height));
                    return Imaging.CreateBitmapSourceFromHBitmap(screenBmp.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
                }
            }
        }

        public Bitmap GetBitmapFromScreen(Rectangle rectangle)
        {
            try
            {
                var absWidth = Math.Abs(rectangle.Width);
                var absHeight = Math.Abs(rectangle.Height);
                if(absHeight <= 0 || absWidth <= 0)
                {
                    return null;
                }

                var bmp = new Bitmap(absWidth, absHeight);
                using (var g = Graphics.FromImage(bmp))
                {
                    g.CopyFromScreen(rectangle.X, rectangle.Y, 0, 0, bmp.Size);
                    return bmp;
                }
            }
            catch(Exception ex)
            {
#if DEBUG
                Debugger.Break();
#endif
                return null;
            }

        }
    }
}


text:
package com.example.android.sunshine;

import android.content.Context;
import android.database.Cursor;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.android.sunshine.utilities.SunshineDateUtils;
import com.example.android.sunshine.utilities.SunshineWeatherUtils;

/**
 * {@link ForecastAdapter} exposes a list of weather forecasts
 * from a {@link android.database.Cursor} to a {@link android.support.v7.widget.RecyclerView}.
 */
class ForecastAdapter extends RecyclerView.Adapter<ForecastAdapter.ForecastAdapterViewHolder> {

    /* The context we use to utility methods, app resources and layout inflaters */
    private final Context mContext;

    /*
     * Below, we've defined an interface to handle clicks on items within this Adapter. In the
     * constructor of our ForecastAdapter, we receive an instance of a class that has implemented
     * said interface. We store that instance in this variable to call the onClick method whenever
     * an item is clicked in the list.
     */
    final private ForecastAdapterOnClickHandler mClickHandler;

    /**
     * The interface that receives onClick messages.
     */
    public interface ForecastAdapterOnClickHandler {
//      COMPLETED (36) Refactor onClick to accept a long as its parameter rather than a String
        void onClick(long date);
    }

    private Cursor mCursor;

    /**
     * Creates a ForecastAdapter.
     *
     * @param context Used to talk to the UI and app resources
     * @param clickHandler The on-click handler for this adapter. This single handler is called
     *                     when an item is clicked.
     */
    public ForecastAdapter(@NonNull Context context, ForecastAdapterOnClickHandler clickHandler) {
        mContext = context;
        mClickHandler = clickHandler;
    }

    /**
     * This gets called when each new ViewHolder is created. This happens when the RecyclerView
     * is laid out. Enough ViewHolders will be created to fill the screen and allow for scrolling.
     *
     * @param viewGroup The ViewGroup that these ViewHolders are contained within.
     * @param viewType  If your RecyclerView has more than one type of item (like ours does) you
     *                  can use this viewType integer to provide a different layout. See
     *                  {@link android.support.v7.widget.RecyclerView.Adapter#getItemViewType(int)}
     *                  for more details.
     * @return A new ForecastAdapterViewHolder that holds the View for each list item
     */
    @Override
    public ForecastAdapterViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {

        View view = LayoutInflater
                .from(mContext)
                .inflate(R.layout.forecast_list_item, viewGroup, false);

        view.setFocusable(true);

        return new ForecastAdapterViewHolder(view);
    }

    /**
     * OnBindViewHolder is called by the RecyclerView to display the data at the specified
     * position. In this method, we update the contents of the ViewHolder to display the weather
     * details for this particular position, using the "position" argument that is conveniently
     * passed into us.
     *
     * @param forecastAdapterViewHolder The ViewHolder which should be updated to represent the
     *                                  contents of the item at the given position in the data set.
     * @param position                  The position of the item within the adapter's data set.
     */
    @Override
    public void onBindViewHolder(ForecastAdapterViewHolder forecastAdapterViewHolder, int position) {
        mCursor.moveToPosition(position);

        /*******************
         * Weather Summary *
         *******************/
        /* Read date from the cursor */
        long dateInMillis = mCursor.getLong(MainActivity.INDEX_WEATHER_DATE);
        /* Get human readable string using our utility method */
        String dateString = SunshineDateUtils.getFriendlyDateString(mContext, dateInMillis, false);
        /* Use the weatherId to obtain the proper description */
        int weatherId = mCursor.getInt(MainActivity.INDEX_WEATHER_CONDITION_ID);
        String description = SunshineWeatherUtils.getStringForWeatherCondition(mContext, weatherId);
        /* Read high temperature from the cursor (in degrees celsius) */
        double highInCelsius = mCursor.getDouble(MainActivity.INDEX_WEATHER_MAX_TEMP);
        /* Read low temperature from the cursor (in degrees celsius) */
        double lowInCelsius = mCursor.getDouble(MainActivity.INDEX_WEATHER_MIN_TEMP);

        String highAndLowTemperature =
                SunshineWeatherUtils.formatHighLows(mContext, highInCelsius, lowInCelsius);

        String weatherSummary = dateString + " - " + description + " - " + highAndLowTemperature;

        forecastAdapterViewHolder.weatherSummary.setText(weatherSummary);
    }

    /**
     * This method simply returns the number of items to display. It is used behind the scenes
     * to help layout our Views and for animations.
     *
     * @return The number of items available in our forecast
     */
    @Override
    public int getItemCount() {
        if (null == mCursor) return 0;
        return mCursor.getCount();
    }

    /**
     * Swaps the cursor used by the ForecastAdapter for its weather data. This method is called by
     * MainActivity after a load has finished, as well as when the Loader responsible for loading
     * the weather data is reset. When this method is called, we assume we have a completely new
     * set of data, so we call notifyDataSetChanged to tell the RecyclerView to update.
     *
     * @param newCursor the new cursor to use as ForecastAdapter's data source
     */
    void swapCursor(Cursor newCursor) {
        mCursor = newCursor;
        notifyDataSetChanged();
    }

    /**
     * A ViewHolder is a required part of the pattern for RecyclerViews. It mostly behaves as
     * a cache of the child views for a forecast item. It's also a convenient place to set an
     * OnClickListener, since it has access to the adapter and the views.
     */
    class ForecastAdapterViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
        final TextView weatherSummary;

        ForecastAdapterViewHolder(View view) {
            super(view);

            weatherSummary = (TextView) view.findViewById(R.id.tv_weather_data);

            view.setOnClickListener(this);
        }

        /**
         * This gets called by the child views during a click. We fetch the date that has been
         * selected, and then call the onClick handler registered with this adapter, passing that
         * date.
         *
         * @param v the View that was clicked
         */
        @Override
        public void onClick(View v) {
            int adapterPosition = getAdapterPosition();
//          COMPLETED (37) Instead of passing the String for the clicked item, pass the date from the cursor
            mCursor.moveToPosition(adapterPosition);
            long dateInMillis = mCursor.getLong(MainActivity.INDEX_WEATHER_DATE);
            mClickHandler.onClick(dateInMillis);
        }
    }
}