text:
POLYBAR_NS

namespace detail {
  template <typename Connection, typename... Extensions>
  class interfaces : public xpp::x::extension::interface<interfaces<Connection, Extensions...>, Connection>,
                     public Extensions::template interface<interfaces<Connection, Extensions...>, Connection>... {
   public:
    const Connection& connection() const {
      return static_cast<const Connection&>(*this);
    }
  };

  template <typename Derived, typename... Extensions>
  class connection_base : public xpp::core,
                          public xpp::generic::error_dispatcher,
                          public detail::interfaces<connection_base<Derived, Extensions...>, Extensions...>,
                          private xpp::x::extension,
                          private xpp::x::extension::error_dispatcher,
                          private Extensions...,
                          private Extensions::error_dispatcher... {
   public:
    explicit connection_base(xcb_connection_t* c, int s)
        : xpp::core(c)
        , interfaces<connection_base<Derived, Extensions...>, Extensions...>(*this)
        , Extensions(m_c.get())...
        , Extensions::error_dispatcher(static_cast<Extensions&>(*this).get())... {
      core::m_screen = s;
      m_root_window = screen_of_display(default_screen())->root;
    }

    virtual ~connection_base() {}

    void operator()(const shared_ptr<xcb_generic_error_t>& error) const {
      check<xpp::x::extension, Extensions...>(error);
    }

    template <typename Extension>
    const Extension& extension() const {
      return static_cast<const Extension&>(*this);
    }

    template <typename WindowType = xcb_window_t>
    WindowType root() const {
      using make = xpp::generic::factory::make<connection_base, xcb_window_t, WindowType>;
      return make()(*this, m_root_window);
    }

    shared_ptr<xcb_generic_event_t> wait_for_event() const {
      try {
        return core::wait_for_event();
      } catch (const shared_ptr<xcb_generic_error_t>& error) {
        check<xpp::x::extension, Extensions...>(error);
      }
      throw;  // re-throw exception
    }

    shared_ptr<xcb_generic_event_t> wait_for_special_event(xcb_special_event_t* se) const {
      try {
        return core::wait_for_special_event(se);
      } catch (const shared_ptr<xcb_generic_error_t>& error) {
        check<xpp::x::extension, Extensions...>(error);
      }
      throw;  // re-throw exception
    }

   private:
    xcb_window_t m_root_window;

    template <typename Extension, typename Next, typename... Rest>
    void check(const shared_ptr<xcb_generic_error_t>& error) const {
      check<Extension>(error);
      check<Next, Rest...>(error);
    }

    template <typename Extension>
    void check(const shared_ptr<xcb_generic_error_t>& error) const {
      using error_dispatcher = typename Extension::error_dispatcher;
      auto& dispatcher = static_cast<const error_dispatcher&>(*this);
      dispatcher(error);
    }
  };
}

class connection : public detail::connection_base<connection&, XPP_EXTENSION_LIST> {
 public:
  using base_type = detail::connection_base<connection&, XPP_EXTENSION_LIST>;

  using make_type = connection&;
  static make_type make(xcb_connection_t* conn = nullptr, int default_screen = 0);

  explicit connection(xcb_connection_t* c, int default_screen);
  ~connection();

  const connection& operator=(const connection& o) {
    return o;
  }

  static void pack_values(unsigned int mask, const unsigned int* src, unsigned int* dest);
  static void pack_values(unsigned int mask, const xcb_params_cw_t* src, unsigned int* dest);
  static void pack_values(unsigned int mask, const xcb_params_gc_t* src, unsigned int* dest);
  static void pack_values(unsigned int mask, const xcb_params_configure_window_t* src, unsigned int* dest);

  xcb_screen_t* screen(bool realloc = false);

  string id(xcb_window_t w) const;

  void ensure_event_mask(xcb_window_t win, unsigned int event);
  void clear_event_mask(xcb_window_t win);

  shared_ptr<xcb_client_message_event_t> make_client_message(xcb_atom_t type, xcb_window_t target) const;
  void send_client_message(const shared_ptr<xcb_client_message_event_t>& message, xcb_window_t target,
      unsigned int event_mask = 0xFFFFFF, bool propagate = false) const;

  xcb_visualtype_t* visual_type(xcb_screen_t* screen, int match_depth = 32);
  xcb_visualtype_t* visual_type_for_id(xcb_screen_t* screen, xcb_visualid_t visual_id);

  bool root_pixmap(xcb_pixmap_t* pixmap, int* depth, xcb_rectangle_t* rect);

  static string error_str(int error_code);

  void dispatch_event(const shared_ptr<xcb_generic_event_t>& evt) const;

  template <typename Event, unsigned int ResponseType>
  void wait_for_response(function<bool(const Event*)> check_event) {
    int fd = get_file_descriptor();
    shared_ptr<xcb_generic_event_t> evt{};
    while (!connection_has_error()) {
      fd_set fds;
      FD_ZERO(&fds);
      FD_SET(fd, &fds);

      if (!select(fd + 1, &fds, nullptr, nullptr, nullptr)) {
        continue;
      } else if ((evt = shared_ptr<xcb_generic_event_t>(xcb_poll_for_event(*this), free)) == nullptr) {
        continue;
      } else if (evt->response_type != ResponseType) {
        continue;
      } else if (check_event(reinterpret_cast<const Event*>(&*evt))) {
        break;
      }
    }
  }

  template <typename Sink>
  void attach_sink(Sink&& sink, registry::priority prio = 0) {
    m_registry.attach(prio, forward<Sink>(sink));
  }

  template <typename Sink>
  void detach_sink(Sink&& sink, registry::priority prio = 0) {
    m_registry.detach(prio, forward<Sink>(sink));
  }

 protected:
  registry m_registry{*this};
  xcb_screen_t* m_screen{nullptr};
};

POLYBAR_NS_END


text: export { default } from 'ember-tabella/components/ember-tabella/header-resize-handle';

redpajama_set_name: RedPajamaGithub


text:
package com.github.jinahya.verbose.rfc3986;

import static com.github.jinahya.verbose.rfc3986.Rfc3986Utilities.isRfc3986UnsafeCharacter;
import static com.github.jinahya.verbose.rfc3986.Rfc3986Utilities.requireRfc3986UnsafeCharacter;
import static java.lang.invoke.MethodHandles.lookup;
import java.util.logging.Logger;
import static java.util.logging.Logger.getLogger;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.Test;

/**
 *
 * @author Jin Kwon <jinahya_at_gmail.com>
 */
public class Rfc3986UtilitiesTest {

    private static final Logger logger
            = getLogger(lookup().lookupClass().getName());

    @Test
    public static void testIsRfc3986UnsafeCharacter() {
        Rfc3986Constants.RFC3986_UNRESERVED_CHARACTERS.forEach(
                d -> assertTrue(isRfc3986UnsafeCharacter(d))
        );
    }

    @Test
    public static void testRequireRfc3986UnsafeCharacter() {
        Rfc3986Constants.RFC3986_UNRESERVED_CHARACTERS.forEach(
                d -> requireRfc3986UnsafeCharacter(d)
        );
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for DM_CHUCVU_DANGController
/// </summary>
public class DM_CHUCVU_DANGController : LinqProvider
{
	public DM_CHUCVU_DANGController()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public List<DAL.DM_CHUCVU_DANG> GetByAll()
    {
        var rs = from t in dataContext.DM_CHUCVU_DANGs
                 select t;
        return rs.ToList();
    }

    public List<StoreComboObject> GetAll()
    {
        var rs = from t in dataContext.DM_CHUCVU_DANGs
                 select new StoreComboObject
                 {
                     MA = t.MA_CHUCVU_DANG,
                     TEN = t.TEN_CHUCVU_DANG
                 };
        return rs.OrderBy(t => t.TEN).ToList();
    }
}


text:
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class FailWebapp implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        throw new RuntimeException("fail");
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

    }
}


text:
title: Introducing The Top Six
date: '2020-07-31'
---

At the top of the homepage,
a few things have changed (for the eagle eyed' reader)!

This new top six space will be a slightly revolving piece
that highlights posts that new readers may find interesting.
These posts will help them get a better understanding of how I write,
What I write about,
and what the main focuses continue to be on this blog.

For folks who have been subscribed to the RSS feed for awhile,
This section might not be super relevant.
However, for folks who are new here,
this section will be invaluable versus wading through a sea of posts.

These changes mirror the ideas that were highlighted from a post
by Dave Parell titled:
__[The Ultimate Guide To Writing Online][write]__

With this, hopefully new readers never feel lost (completely) here.

[write]: https://www.perell.com/blog/the-ultimate-guide-to-writing-online


text:
/*      $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $    */
/*      $FreeBSD: src/include/getopt.h,v 1.1 2002/09/29 04:14:30 eric Exp $ */

/*-
 * Copyright (c) 2000 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Dieter Baron and Thomas Klausner.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _GETOPT_H_
#define _GETOPT_H_

#ifdef _WIN32
/* from <sys/cdefs.h> */
# ifdef  __cplusplus
#  define __BEGIN_DECLS  extern "C" {
#  define __END_DECLS    }
# else
#  define __BEGIN_DECLS
#  define __END_DECLS
# endif
# define __P(args)      args
#endif

/*#ifndef _WIN32
#include <sys/cdefs.h>
#include <unistd.h>
#endif*/

#ifdef _WIN32
# if !defined(GETOPT_API)
#  define GETOPT_API __declspec(dllimport)
# endif
#endif

/*
 * Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions
 */
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
#define no_argument        0
#define required_argument  1
#define optional_argument  2

struct option {
        /* name of long option */
        const char *name;
        /*
         * one of no_argument, required_argument, and optional_argument:
         * whether option takes an argument
         */
        int has_arg;
        /* if not NULL, set *flag to val when option found */
        int *flag;
        /* if flag not NULL, value to set *flag to; else return value */
        int val;
};

__BEGIN_DECLS
GETOPT_API int getopt_long __P((int, char * const *, const char *,
    const struct option *, int *));
__END_DECLS
#endif

#ifdef _WIN32
/* These are global getopt variables */
__BEGIN_DECLS

GETOPT_API extern int   opterr,   /* if error message should be printed */
                        optind,   /* index into parent argv vector */
                        optopt,   /* character checked for validity */
                        optreset; /* reset getopt */
GETOPT_API extern char* optarg;   /* argument associated with option */

/* Original getopt */
GETOPT_API int getopt __P((int, char * const *, const char *));

__END_DECLS
#endif

#endif /* !_GETOPT_H_ */


text:
package volumebinding

import (
	"context"
	"reflect"
	"testing"

	"github.com/google/go-cmp/cmp"
	"github.com/google/go-cmp/cmp/cmpopts"
	v1 "k8s.io/api/core/v1"
	storagev1 "k8s.io/api/storage/v1"
	"k8s.io/apimachinery/pkg/api/resource"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	utilfeature "k8s.io/apiserver/pkg/util/feature"
	"k8s.io/client-go/informers"
	"k8s.io/client-go/kubernetes/fake"
	"k8s.io/component-base/featuregate"
	featuregatetesting "k8s.io/component-base/featuregate/testing"
	pvutil "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/util"
	"k8s.io/kubernetes/pkg/controller/volume/scheduling"
	"k8s.io/kubernetes/pkg/features"
	"k8s.io/kubernetes/pkg/scheduler/apis/config"
	"k8s.io/kubernetes/pkg/scheduler/framework"
	"k8s.io/kubernetes/pkg/scheduler/framework/runtime"
	"k8s.io/utils/pointer"
)

var (
	immediate            = storagev1.VolumeBindingImmediate
	waitForFirstConsumer = storagev1.VolumeBindingWaitForFirstConsumer
	immediateSC          = &storagev1.StorageClass{
		ObjectMeta: metav1.ObjectMeta{
			Name: "immediate-sc",
		},
		VolumeBindingMode: &immediate,
	}
	waitSC = &storagev1.StorageClass{
		ObjectMeta: metav1.ObjectMeta{
			Name: "wait-sc",
		},
		VolumeBindingMode: &waitForFirstConsumer,
	}
	waitHDDSC = &storagev1.StorageClass{
		ObjectMeta: metav1.ObjectMeta{
			Name: "wait-hdd-sc",
		},
		VolumeBindingMode: &waitForFirstConsumer,
	}
)

func makeNode(name string) *v1.Node {
	return &v1.Node{
		ObjectMeta: metav1.ObjectMeta{
			Name: name,
			Labels: map[string]string{
				v1.LabelHostname: name,
			},
		},
	}
}

func mergeNodeLabels(node *v1.Node, labels map[string]string) *v1.Node {
	for k, v := range labels {
		node.Labels[k] = v
	}
	return node
}

func makePV(name string, className string) *v1.PersistentVolume {
	return &v1.PersistentVolume{
		ObjectMeta: metav1.ObjectMeta{
			Name: name,
		},
		Spec: v1.PersistentVolumeSpec{
			StorageClassName: className,
		},
		Status: v1.PersistentVolumeStatus{
			Phase: v1.VolumeAvailable,
		},
	}
}

func setPVNodeAffinity(pv *v1.PersistentVolume, keyValues map[string][]string) *v1.PersistentVolume {
	matchExpressions := make([]v1.NodeSelectorRequirement, 0)
	for key, values := range keyValues {
		matchExpressions = append(matchExpressions, v1.NodeSelectorRequirement{
			Key:      key,
			Operator: v1.NodeSelectorOpIn,
			Values:   values,
		})
	}
	pv.Spec.NodeAffinity = &v1.VolumeNodeAffinity{
		Required: &v1.NodeSelector{
			NodeSelectorTerms: []v1.NodeSelectorTerm{
				{
					MatchExpressions: matchExpressions,
				},
			},
		},
	}
	return pv
}

func setPVCapacity(pv *v1.PersistentVolume, capacity resource.Quantity) *v1.PersistentVolume {
	pv.Spec.Capacity = v1.ResourceList{
		v1.ResourceName(v1.ResourceStorage): capacity,
	}
	return pv
}

func makePVC(name string, boundPVName string, storageClassName string) *v1.PersistentVolumeClaim {
	pvc := &v1.PersistentVolumeClaim{
		ObjectMeta: metav1.ObjectMeta{
			Name:      name,
			Namespace: v1.NamespaceDefault,
		},
		Spec: v1.PersistentVolumeClaimSpec{
			StorageClassName: pointer.StringPtr(storageClassName),
		},
	}
	if boundPVName != "" {
		pvc.Spec.VolumeName = boundPVName
		metav1.SetMetaDataAnnotation(&pvc.ObjectMeta, pvutil.AnnBindCompleted, "true")
	}
	return pvc
}

func setPVCRequestStorage(pvc *v1.PersistentVolumeClaim, request resource.Quantity) *v1.PersistentVolumeClaim {
	pvc.Spec.Resources = v1.ResourceRequirements{
		Requests: v1.ResourceList{
			v1.ResourceName(v1.ResourceStorage): request,
		},
	}
	return pvc
}

func makePod(name string, pvcNames []string) *v1.Pod {
	p := &v1.Pod{
		ObjectMeta: metav1.ObjectMeta{
			Name:      name,
			Namespace: v1.NamespaceDefault,
		},
	}
	p.Spec.Volumes = make([]v1.Volume, 0)
	for _, pvcName := range pvcNames {
		p.Spec.Volumes = append(p.Spec.Volumes, v1.Volume{
			VolumeSource: v1.VolumeSource{
				PersistentVolumeClaim: &v1.PersistentVolumeClaimVolumeSource{
					ClaimName: pvcName,
				},
			},
		})
	}
	return p
}

func TestVolumeBinding(t *testing.T) {
	table := []struct {
		name                    string
		pod                     *v1.Pod
		nodes                   []*v1.Node
		pvcs                    []*v1.PersistentVolumeClaim
		pvs                     []*v1.PersistentVolume
		feature                 featuregate.Feature
		wantPreFilterStatus     *framework.Status
		wantStateAfterPreFilter *stateData
		wantFilterStatus        []*framework.Status
		wantScores              []int64
	}{
		{
			name: "pod has not pvcs",
			pod:  makePod("pod-a", nil),
			nodes: []*v1.Node{
				makeNode("node-a"),
			},
			wantStateAfterPreFilter: &stateData{
				skip: true,
			},
			wantFilterStatus: []*framework.Status{
				nil,
			},
			wantScores: []int64{
				0,
			},
		},
		{
			name: "all bound",
			pod:  makePod("pod-a", []string{"pvc-a"}),
			nodes: []*v1.Node{
				makeNode("node-a"),
			},
			pvcs: []*v1.PersistentVolumeClaim{
				makePVC("pvc-a", "pv-a", waitSC.Name),
			},
			pvs: []*v1.PersistentVolume{
				makePV("pv-a", waitSC.Name),
			},
			wantStateAfterPreFilter: &stateData{
				boundClaims: []*v1.PersistentVolumeClaim{
					makePVC("pvc-a", "pv-a", waitSC.Name),
				},
				claimsToBind:     []*v1.PersistentVolumeClaim{},
				podVolumesByNode: map[string]*scheduling.PodVolumes{},
			},
			wantFilterStatus: []*framework.Status{
				nil,
			},
			wantScores: []int64{
				0,
			},
		},
		{
			name: "PVC does not exist",
			pod:  makePod("pod-a", []string{"pvc-a"}),
			nodes: []*v1.Node{
				makeNode("node-a"),
			},
			pvcs:                []*v1.PersistentVolumeClaim{},
			wantPreFilterStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, `persistentvolumeclaim "pvc-a" not found`),
			wantFilterStatus: []*framework.Status{
				nil,
			},
			wantScores: []int64{
				0,
			},
		},
		{
			name: "Part of PVCs do not exist",
			pod:  makePod("pod-a", []string{"pvc-a", "pvc-b"}),
			nodes: []*v1.Node{
				makeNode("node-a"),
			},
			pvcs: []*v1.PersistentVolumeClaim{
				makePVC("pvc-a", "pv-a", waitSC.Name),
			},
			wantPreFilterStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, `persistentvolumeclaim "pvc-b" not found`),
			wantFilterStatus: []*framework.Status{
				nil,
			},
			wantScores: []int64{
				0,
			},
		},
		{
			name: "immediate claims not bound",
			pod:  makePod("pod-a", []string{"pvc-a"}),
			nodes: []*v1.Node{
				makeNode("node-a"),
			},
			pvcs: []*v1.PersistentVolumeClaim{
				makePVC("pvc-a", "", immediateSC.Name),
			},
			wantPreFilterStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, "pod has unbound immediate PersistentVolumeClaims"),
			wantFilterStatus: []*framework.Status{
				nil,
			},
			wantScores: []int64{
				0,
			},
		},
		{
			name: "unbound claims no matches",
			pod:  makePod("pod-a", []string{"pvc-a"}),
			nodes: []*v1.Node{
				makeNode("node-a"),
			},
			pvcs: []*v1.PersistentVolumeClaim{
				makePVC("pvc-a", "", waitSC.Name),
			},
			wantStateAfterPreFilter: &stateData{
				boundClaims: []*v1.PersistentVolumeClaim{},
				claimsToBind: []*v1.PersistentVolumeClaim{
					makePVC("pvc-a", "", waitSC.Name),
				},
				podVolumesByNode: map[string]*scheduling.PodVolumes{},
			},
			wantFilterStatus: []*framework.Status{
				framework.NewStatus(framework.UnschedulableAndUnresolvable, string(scheduling.ErrReasonBindConflict)),
			},
			wantScores: []int64{
				0,
			},
		},
		{
			name: "bound and unbound unsatisfied",
			pod:  makePod("pod-a", []string{"pvc-a", "pvc-b"}),
			nodes: []*v1.Node{
				mergeNodeLabels(makeNode("node-a"), map[string]string{
					"foo": "barbar",
				}),
			},
			pvcs: []*v1.PersistentVolumeClaim{
				makePVC("pvc-a", "pv-a", waitSC.Name),
				makePVC("pvc-b", "", waitSC.Name),
			},
			pvs: []*v1.PersistentVolume{
				setPVNodeAffinity(makePV("pv-a", waitSC.Name), map[string][]string{
					"foo": {"bar"},
				}),
			},
			wantStateAfterPreFilter: &stateData{
				boundClaims: []*v1.PersistentVolumeClaim{
					makePVC("pvc-a", "pv-a", waitSC.Name),
				},
				claimsToBind: []*v1.PersistentVolumeClaim{
					makePVC("pvc-b", "", waitSC.Name),
				},
				podVolumesByNode: map[string]*scheduling.PodVolumes{},
			},
			wantFilterStatus: []*framework.Status{
				framework.NewStatus(framework.UnschedulableAndUnresolvable, string(scheduling.ErrReasonNodeConflict), string(scheduling.ErrReasonBindConflict)),
			},
			wantScores: []int64{
				0,
			},
		},
		{
			name: "pvc not found",
			pod:  makePod("pod-a", []string{"pvc-a"}),
			nodes: []*v1.Node{
				makeNode("node-a"),
			},
			wantPreFilterStatus: framework.NewStatus(framework.UnschedulableAndUnresolvable, `persistentvolumeclaim "pvc-a" not found`),
			wantFilterStatus: []*framework.Status{
				nil,
			},
			wantScores: []int64{
				0,
			},
		},
		{
			name: "pv not found",
			pod:  makePod("pod-a", []string{"pvc-a"}),
			nodes: []*v1.Node{
				makeNode("node-a"),
			},
			pvcs: []*v1.PersistentVolumeClaim{
				makePVC("pvc-a", "pv-a", waitSC.Name),
			},
			wantPreFilterStatus: nil,
			wantStateAfterPreFilter: &stateData{
				boundClaims: []*v1.PersistentVolumeClaim{
					makePVC("pvc-a", "pv-a", waitSC.Name),
				},
				claimsToBind:     []*v1.PersistentVolumeClaim{},
				podVolumesByNode: map[string]*scheduling.PodVolumes{},
			},
			wantFilterStatus: []*framework.Status{
				framework.NewStatus(framework.UnschedulableAndUnresolvable, `pvc(s) bound to non-existent pv(s)`),
			},
			wantScores: []int64{
				0,
			},
		},
		{
			name: "local volumes with close capacity are preferred",
			pod:  makePod("pod-a", []string{"pvc-a"}),
			nodes: []*v1.Node{
				makeNode("node-a"),
				makeNode("node-b"),
				makeNode("node-c"),
			},
			pvcs: []*v1.PersistentVolumeClaim{
				setPVCRequestStorage(makePVC("pvc-a", "", waitSC.Name), resource.MustParse("50Gi")),
			},
			pvs: []*v1.PersistentVolume{
				setPVNodeAffinity(setPVCapacity(makePV("pv-a-0", waitSC.Name), resource.MustParse("200Gi")), map[string][]string{v1.LabelHostname: {"node-a"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-a-1", waitSC.Name), resource.MustParse("200Gi")), map[string][]string{v1.LabelHostname: {"node-a"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-b-0", waitSC.Name), resource.MustParse("100Gi")), map[string][]string{v1.LabelHostname: {"node-b"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-b-1", waitSC.Name), resource.MustParse("100Gi")), map[string][]string{v1.LabelHostname: {"node-b"}}),
			},
			feature:             features.VolumeCapacityPriority,
			wantPreFilterStatus: nil,
			wantStateAfterPreFilter: &stateData{
				boundClaims: []*v1.PersistentVolumeClaim{},
				claimsToBind: []*v1.PersistentVolumeClaim{
					setPVCRequestStorage(makePVC("pvc-a", "", waitSC.Name), resource.MustParse("50Gi")),
				},
				podVolumesByNode: map[string]*scheduling.PodVolumes{},
			},
			wantFilterStatus: []*framework.Status{
				nil,
				nil,
				framework.NewStatus(framework.UnschedulableAndUnresolvable, `node(s) didn't find available persistent volumes to bind`),
			},
			wantScores: []int64{
				25,
				50,
				0,
			},
		},
		{
			name: "local volumes with close capacity are preferred (multiple pvcs)",
			pod:  makePod("pod-a", []string{"pvc-0", "pvc-1"}),
			nodes: []*v1.Node{
				makeNode("node-a"),
				makeNode("node-b"),
				makeNode("node-c"),
			},
			pvcs: []*v1.PersistentVolumeClaim{
				setPVCRequestStorage(makePVC("pvc-0", "", waitSC.Name), resource.MustParse("50Gi")),
				setPVCRequestStorage(makePVC("pvc-1", "", waitHDDSC.Name), resource.MustParse("100Gi")),
			},
			pvs: []*v1.PersistentVolume{
				setPVNodeAffinity(setPVCapacity(makePV("pv-a-0", waitSC.Name), resource.MustParse("200Gi")), map[string][]string{v1.LabelHostname: {"node-a"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-a-1", waitSC.Name), resource.MustParse("200Gi")), map[string][]string{v1.LabelHostname: {"node-a"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-a-2", waitHDDSC.Name), resource.MustParse("200Gi")), map[string][]string{v1.LabelHostname: {"node-a"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-a-3", waitHDDSC.Name), resource.MustParse("200Gi")), map[string][]string{v1.LabelHostname: {"node-a"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-b-0", waitSC.Name), resource.MustParse("100Gi")), map[string][]string{v1.LabelHostname: {"node-b"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-b-1", waitSC.Name), resource.MustParse("100Gi")), map[string][]string{v1.LabelHostname: {"node-b"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-b-2", waitHDDSC.Name), resource.MustParse("100Gi")), map[string][]string{v1.LabelHostname: {"node-b"}}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-b-3", waitHDDSC.Name), resource.MustParse("100Gi")), map[string][]string{v1.LabelHostname: {"node-b"}}),
			},
			feature:             features.VolumeCapacityPriority,
			wantPreFilterStatus: nil,
			wantStateAfterPreFilter: &stateData{
				boundClaims: []*v1.PersistentVolumeClaim{},
				claimsToBind: []*v1.PersistentVolumeClaim{
					setPVCRequestStorage(makePVC("pvc-0", "", waitSC.Name), resource.MustParse("50Gi")),
					setPVCRequestStorage(makePVC("pvc-1", "", waitHDDSC.Name), resource.MustParse("100Gi")),
				},
				podVolumesByNode: map[string]*scheduling.PodVolumes{},
			},
			wantFilterStatus: []*framework.Status{
				nil,
				nil,
				framework.NewStatus(framework.UnschedulableAndUnresolvable, `node(s) didn't find available persistent volumes to bind`),
			},
			wantScores: []int64{
				38,
				75,
				0,
			},
		},
		{
			name: "zonal volumes with close capacity are preferred",
			pod:  makePod("pod-a", []string{"pvc-a"}),
			nodes: []*v1.Node{
				mergeNodeLabels(makeNode("zone-a-node-a"), map[string]string{
					"topology.kubernetes.io/region": "region-a",
					"topology.kubernetes.io/zone":   "zone-a",
				}),
				mergeNodeLabels(makeNode("zone-a-node-b"), map[string]string{
					"topology.kubernetes.io/region": "region-a",
					"topology.kubernetes.io/zone":   "zone-a",
				}),
				mergeNodeLabels(makeNode("zone-b-node-a"), map[string]string{
					"topology.kubernetes.io/region": "region-b",
					"topology.kubernetes.io/zone":   "zone-b",
				}),
				mergeNodeLabels(makeNode("zone-b-node-b"), map[string]string{
					"topology.kubernetes.io/region": "region-b",
					"topology.kubernetes.io/zone":   "zone-b",
				}),
				mergeNodeLabels(makeNode("zone-c-node-a"), map[string]string{
					"topology.kubernetes.io/region": "region-c",
					"topology.kubernetes.io/zone":   "zone-c",
				}),
				mergeNodeLabels(makeNode("zone-c-node-b"), map[string]string{
					"topology.kubernetes.io/region": "region-c",
					"topology.kubernetes.io/zone":   "zone-c",
				}),
			},
			pvcs: []*v1.PersistentVolumeClaim{
				setPVCRequestStorage(makePVC("pvc-a", "", waitSC.Name), resource.MustParse("50Gi")),
			},
			pvs: []*v1.PersistentVolume{
				setPVNodeAffinity(setPVCapacity(makePV("pv-a-0", waitSC.Name), resource.MustParse("200Gi")), map[string][]string{
					"topology.kubernetes.io/region": {"region-a"},
					"topology.kubernetes.io/zone":   {"zone-a"},
				}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-a-1", waitSC.Name), resource.MustParse("200Gi")), map[string][]string{
					"topology.kubernetes.io/region": {"region-a"},
					"topology.kubernetes.io/zone":   {"zone-a"},
				}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-b-0", waitSC.Name), resource.MustParse("100Gi")), map[string][]string{
					"topology.kubernetes.io/region": {"region-b"},
					"topology.kubernetes.io/zone":   {"zone-b"},
				}),
				setPVNodeAffinity(setPVCapacity(makePV("pv-b-1", waitSC.Name), resource.MustParse("100Gi")), map[string][]string{
					"topology.kubernetes.io/region": {"region-b"},
					"topology.kubernetes.io/zone":   {"zone-b"},
				}),
			},
			feature:             features.VolumeCapacityPriority,
			wantPreFilterStatus: nil,
			wantStateAfterPreFilter: &stateData{
				boundClaims: []*v1.PersistentVolumeClaim{},
				claimsToBind: []*v1.PersistentVolumeClaim{
					setPVCRequestStorage(makePVC("pvc-a", "", waitSC.Name), resource.MustParse("50Gi")),
				},
				podVolumesByNode: map[string]*scheduling.PodVolumes{},
			},
			wantFilterStatus: []*framework.Status{
				nil,
				nil,
				nil,
				nil,
				framework.NewStatus(framework.UnschedulableAndUnresolvable, `node(s) didn't find available persistent volumes to bind`),
				framework.NewStatus(framework.UnschedulableAndUnresolvable, `node(s) didn't find available persistent volumes to bind`),
			},
			wantScores: []int64{
				25,
				25,
				50,
				50,
				0,
				0,
			},
		},
	}

	for _, item := range table {
		t.Run(item.name, func(t *testing.T) {
			if item.feature != "" {
				defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, item.feature, true)()
			}
			ctx, cancel := context.WithCancel(context.Background())
			defer cancel()
			client := fake.NewSimpleClientset()
			informerFactory := informers.NewSharedInformerFactory(client, 0)
			opts := []runtime.Option{
				runtime.WithClientSet(client),
				runtime.WithInformerFactory(informerFactory),
			}
			fh, err := runtime.NewFramework(nil, nil, opts...)
			if err != nil {
				t.Fatal(err)
			}
			pl, err := New(&config.VolumeBindingArgs{
				BindTimeoutSeconds: 300,
			}, fh)
			if err != nil {
				t.Fatal(err)
			}

			t.Log("Feed testing data and wait for them to be synced")
			client.StorageV1().StorageClasses().Create(ctx, immediateSC, metav1.CreateOptions{})
			client.StorageV1().StorageClasses().Create(ctx, waitSC, metav1.CreateOptions{})
			client.StorageV1().StorageClasses().Create(ctx, waitHDDSC, metav1.CreateOptions{})
			for _, node := range item.nodes {
				client.CoreV1().Nodes().Create(ctx, node, metav1.CreateOptions{})
			}
			for _, pvc := range item.pvcs {
				client.CoreV1().PersistentVolumeClaims(pvc.Namespace).Create(ctx, pvc, metav1.CreateOptions{})
			}
			for _, pv := range item.pvs {
				client.CoreV1().PersistentVolumes().Create(ctx, pv, metav1.CreateOptions{})
			}

			t.Log("Start informer factory after initialization")
			informerFactory.Start(ctx.Done())

			t.Log("Wait for all started informers' cache were synced")
			informerFactory.WaitForCacheSync(ctx.Done())

			t.Log("Verify")

			p := pl.(*VolumeBinding)
			nodeInfos := make([]*framework.NodeInfo, 0)
			for _, node := range item.nodes {
				nodeInfo := framework.NewNodeInfo()
				nodeInfo.SetNode(node)
				nodeInfos = append(nodeInfos, nodeInfo)
			}
			state := framework.NewCycleState()

			t.Logf("Verify: call PreFilter and check status")
			gotPreFilterStatus := p.PreFilter(ctx, state, item.pod)
			if !reflect.DeepEqual(gotPreFilterStatus, item.wantPreFilterStatus) {
				t.Errorf("filter prefilter status does not match: %v, want: %v", gotPreFilterStatus, item.wantPreFilterStatus)
			}
			if !gotPreFilterStatus.IsSuccess() {
				// scheduler framework will skip Filter if PreFilter fails
				return
			}

			t.Logf("Verify: check state after prefilter phase")
			got, err := getStateData(state)
			if err != nil {
				t.Fatal(err)
			}
			stateCmpOpts := []cmp.Option{
				cmp.AllowUnexported(stateData{}),
				cmpopts.IgnoreFields(stateData{}, "Mutex"),
			}
			if diff := cmp.Diff(item.wantStateAfterPreFilter, got, stateCmpOpts...); diff != "" {
				t.Errorf("state got after prefilter does not match (-want,+got):\n%s", diff)
			}

			t.Logf("Verify: call Filter and check status")
			for i, nodeInfo := range nodeInfos {
				gotStatus := p.Filter(ctx, state, item.pod, nodeInfo)
				if !reflect.DeepEqual(gotStatus, item.wantFilterStatus[i]) {
					t.Errorf("filter status does not match for node %q, got: %v, want: %v", nodeInfo.Node().Name, gotStatus, item.wantFilterStatus)
				}
			}

			t.Logf("Verify: Score")
			for i, node := range item.nodes {
				score, status := p.Score(ctx, state, item.pod, node.Name)
				if !status.IsSuccess() {
					t.Errorf("Score expects success status, got: %v", status)
				}
				if score != item.wantScores[i] {
					t.Errorf("Score expects score %d for node %q, got: %d", item.wantScores[i], node.Name, score)
				}
			}
		})
	}
}


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

namespace DotSpatial.Positioning.Gps.Nmea
{
    /// <summary>
     /// $GPGLL
     ///Geographic Position, Latitude / Longitude and time.
     ///http://aprs.gids.nl/nmea/#gll
     ///eg1. $GPGLL,3751.65,S,14507.36,E*77
     ///eg2. $GPGLL,4916.45,N,12311.12,W,225444,A
     ///            4916.46,N    Latitude 49 deg. 16.45 min. North
     ///            12311.12,W   Longitude 123 deg. 11.12 min. West
     ///            225444       Fix taken at 22:54:44 UTC
     ///            A            Data valid
     /// eg3. $GPGLL,5133.81,N,00042.25,W*75
     ///                1    2     3    4 5
     ///       1    5133.81   Current latitude
     ///       2    N         North/South
     ///       3    00042.25  Current longitude
     ///       4    W         East/West
     ///       5    *75       checksum
     /// $--GLL,lll.ll,a,yyyyy.yy,a,hhmmss.ss,A
     /// llll.ll = Latitude of location
     /// a = N or S
     /// yyyyy.yy = Longitude of location
     /// a = E or W
     /// hhmmss.ss = UTC of location
     /// A = status: A = valid data
    /// </summary>
    public sealed class GpgllSentence : NmeaSentence, IUtcTimeSentence, IPositionSentence, IFixStatusSentence
    {
        private TimeSpan _UtcTime;
        private Position _Position;
        private FixStatus _FixStatus;

        #region Constructors

        internal GpgllSentence(string sentence, string commandWord, string[] words, string validChecksum)
            : base(sentence, commandWord, words, validChecksum)
        { }

        /// <summary>
        /// Creates a GpgllSentence from the specified string
        /// </summary>
        /// <param name="sentence"></param>
        public GpgllSentence(string sentence)
            : base(sentence)
        { }

        /// <summary>
        /// Creates a GpgllSentence from the specified parameters
        /// </summary>
        /// <param name="position"></param>
        /// <param name="utcTime"></param>
        /// <param name="fixStatus"></param>
        public GpgllSentence(Position position, TimeSpan utcTime, FixStatus fixStatus)
        {
            // Build a sentence
            StringBuilder builder = new StringBuilder(128);

            #region Append the command word

            // Append the command word
            builder.Append("$GPGLL");

            #endregion

            // Append a comma
            builder.Append(',');

            #region Append the position

            // Append latitude in the format HHMM.MMMM.
            builder.Append(position.Latitude.ToString("HHMM.MMMM,I,", NmeaCultureInfo));
            // Append Longitude in the format HHHMM.MMMM.
            builder.Append(position.Longitude.ToString("HHHMM.MMMM,I,", NmeaCultureInfo));

            #endregion

            #region Append the UTC time

            builder.Append(utcTime.Hours.ToString("0#", NmeaCultureInfo));
            builder.Append(utcTime.Minutes.ToString("0#", NmeaCultureInfo));
            builder.Append(utcTime.Seconds.ToString("0#", NmeaCultureInfo));
            builder.Append(".");
            builder.Append(utcTime.Milliseconds.ToString("00#", NmeaCultureInfo));

            #endregion

            // Append a comma
            builder.Append(",");

            #region Append the fix status

            switch (fixStatus)
            {
                case FixStatus.Fix:
                    builder.Append("A");
                    break;
                default:
                    builder.Append("V");  // V = INvalid
                    break;
            }

            #endregion

            // Set this object's sentence
            SetSentence(builder.ToString());

            // Finally, append the checksum
            AppendChecksum();
        }

        #endregion

        #region Overrides

        protected override void OnSentenceChanged()
        {
            // Parse the basic sentence information
            base.OnSentenceChanged();

            // Cache the words
            string[] words = base.Words;
            int wordCount = words.Length;

            // Do we have enough words to make a lat/long location?
            if (wordCount >= 4 && words[0].Length != 0 && words[1].Length != 0 && words[2].Length != 0 && words[3].Length != 0)
            {
                #region Latitude

                string latitudeWord = words[0];
                int latitudeHours = int.Parse(latitudeWord.Substring(0, 2), NmeaCultureInfo);
                double latitudeDecimalMinutes = double.Parse(latitudeWord.Substring(2), NmeaCultureInfo);
                LatitudeHemisphere latitudeHemisphere =
                    words[1].Equals("N", StringComparison.OrdinalIgnoreCase) ? LatitudeHemisphere.North : LatitudeHemisphere.South;

                #endregion

                #region Longitude

                string longitudeWord = words[2];
                int longitudeHours = int.Parse(longitudeWord.Substring(0, 3), NmeaCultureInfo);
                double longitudeDecimalMinutes = double.Parse(longitudeWord.Substring(3), NmeaCultureInfo);
                LongitudeHemisphere longitudeHemisphere =
                    words[3].Equals("E", StringComparison.OrdinalIgnoreCase) ? LongitudeHemisphere.East : LongitudeHemisphere.West;

                #endregion

                #region Position

                _Position = new Position(
                                new Latitude(latitudeHours, latitudeDecimalMinutes, latitudeHemisphere),
                                new Longitude(longitudeHours, longitudeDecimalMinutes, longitudeHemisphere));

                #endregion
            }

            // Do we have enough data to process the UTC time?
            if (wordCount >= 5 && words[4].Length != 0)
            {
                #region UTC Time

                string utcTimeWord = words[4];
                int utcHours = int.Parse(utcTimeWord.Substring(0, 2), NmeaCultureInfo);
                int utcMinutes = int.Parse(utcTimeWord.Substring(2, 2), NmeaCultureInfo);
                int utcSeconds = int.Parse(utcTimeWord.Substring(4, 2), NmeaCultureInfo);
                int utcMilliseconds = 0;
                if (utcTimeWord.Length > 6)
                    utcMilliseconds = Convert.ToInt32(float.Parse(utcTimeWord.Substring(6), NmeaCultureInfo) * 1000, NmeaCultureInfo);

                // Build a TimeSpan for this value
                _UtcTime = new TimeSpan(0, utcHours, utcMinutes, utcSeconds, utcMilliseconds);

                #endregion
            }
            else
            {
                // The UTC time is invalid
                _UtcTime = TimeSpan.MinValue;
            }

            // Do we have enough data to get the fix status?
            if (wordCount >= 6 && words[5].Length != 0)
            {
                #region Fix Status

                // An "A" means a valid fix
                _FixStatus = words[5].Equals("A", StringComparison.OrdinalIgnoreCase) ? FixStatus.Fix : FixStatus.NoFix;

                #endregion
            }
            else
            {
                // The fix status is invalid
                _FixStatus = FixStatus.Unknown;
            }
        }

        #endregion

        #region IUtcDateTimeSentence Members

        public TimeSpan UtcTime
        {
            get { return _UtcTime; }
        }

        #endregion

        #region IPositionSentence Members

        public Position Position
        {
            get { return _Position; }
        }

        #endregion

        #region IFixStatusSentence Members

        public FixStatus FixStatus
        {
            get { return _FixStatus; }
        }

        #endregion
    }
}


text:
package org.wso2.carbon.identity.application.authentication.framework.cache;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.identity.application.authentication.framework.internal.FrameworkServiceDataHolder;
import org.wso2.carbon.identity.application.authentication.framework.store.SessionDataStore;
import org.wso2.carbon.identity.application.common.cache.BaseCache;
import org.wso2.carbon.identity.application.common.cache.CacheEntry;
import org.wso2.carbon.identity.application.common.cache.CacheKey;
import org.wso2.carbon.identity.core.util.IdentityTenantUtil;
import org.wso2.carbon.identity.core.util.IdentityUtil;
import org.wso2.carbon.user.api.UserStoreException;

/**
 * This cache keeps all parameters and headers which are directed towards authentication
 * framework. Whenever a request to authentication framework comes, The relevant component which
 * sends the request saves all required information to this cache, which are retrieved later from
 * authentication framework
 */
public class AuthenticationRequestCache extends
        BaseCache<AuthenticationRequestCacheKey, AuthenticationRequestCacheEntry> {

    private static Log log = LogFactory.getLog(AuthenticationRequestCache.class);
    private static final String AUTHENTICATION_REQUEST_CACHE_NAME = "AuthenticationRequestCache";
    private static volatile AuthenticationRequestCache instance;
    private boolean enableRequestScopeCache = false;

    private AuthenticationRequestCache(String cacheName) {
        super(cacheName);
        if (IdentityUtil.getProperty("JDBCPersistenceManager.SessionDataPersist.Temporary") != null) {
            enableRequestScopeCache = Boolean.parseBoolean(IdentityUtil.getProperty("JDBCPersistenceManager.SessionDataPersist.Temporary"));
        }
    }

    public static AuthenticationRequestCache getInstance() {
        if (instance == null) {
            synchronized (AuthenticationRequestCache.class) {
                if (instance == null) {
                    instance = new AuthenticationRequestCache(AUTHENTICATION_REQUEST_CACHE_NAME);
                }
            }
        }
        return instance;
    }

    public void addToCache(AuthenticationRequestCacheKey key, AuthenticationRequestCacheEntry entry){
        super.addToCache(key,entry);
        if(enableRequestScopeCache){
            int tenantId = MultitenantConstants.INVALID_TENANT_ID;
            String tenantDomain = entry.getAuthenticationRequest().getTenantDomain();
            if (tenantDomain != null) {
                tenantId = IdentityTenantUtil.getTenantId(tenantDomain);
            }
            SessionDataStore.getInstance().storeSessionData(key.getResultId(),AUTHENTICATION_REQUEST_CACHE_NAME,
                    entry, tenantId);
        }
    }

    public AuthenticationRequestCacheEntry getValueFromCache(AuthenticationRequestCacheKey key){
        AuthenticationRequestCacheEntry entry = super.getValueFromCache(key);
        if(entry == null && enableRequestScopeCache){
            entry = (AuthenticationRequestCacheEntry) SessionDataStore.getInstance().
                    getSessionData(key.getResultId(), AUTHENTICATION_REQUEST_CACHE_NAME);
        }
        return entry;
    }

    public void clearCacheEntry(AuthenticationRequestCacheKey key){
        super.clearCacheEntry(key);
        if (enableRequestScopeCache) {
            SessionDataStore.getInstance().clearSessionData(key.getResultId(), AUTHENTICATION_REQUEST_CACHE_NAME);
        }
    }
}


text:
#include <cc7tests/detail/StringUtils.h>
#include <sstream>
#include <memory>
#include <stdlib.h>

namespace cc7
{
namespace tests
{
namespace detail
{

	std::string FormattedString(const char * format, ...)
	{
		va_list ap;
		va_start(ap, format);
		int expected_size = vsnprintf(NULL, 0, format, ap);
		va_end(ap);
		if (CC7_CHECK(expected_size >= 0, "vsnprintf() encoding error occured: %d", expected_size)) {
			std::unique_ptr<char[]> buffer;
			buffer.reset(new char[expected_size + 1]);
			va_start(ap, format);
			int processed_size = vsnprintf(&buffer[0], expected_size + 1, format, ap);
			va_end(ap);
			if (CC7_CHECK(expected_size == processed_size, "vsnprintf() different exp. and processed size: %d vs %d", expected_size, processed_size)) {
				return std::string(buffer.get());
			}
		}
		return std::string();
	}

	std::vector<std::string> & SplitString(const std::string & str, char delim, std::vector<std::string> & elems)
	{
		std::stringstream ss(str);
		std::string item;
		while (std::getline(ss, item, delim)) {
			if (!item.empty()) {
				elems.push_back(item);
			}
		}
		return elems;
	}

	std::vector<std::string> SplitString(const std::string & str, char delimiter)
	{
		std::vector<std::string> elements;
		SplitString(str, delimiter, elements);
		return elements;
	}

} // cc7::tests::detail
} // cc7::tests
} // cc7


text:
var fs = require('fs');
var walk = function(dir, done) {
  var results = [];
  fs.readdir(dir, function(err, list) {
    if (err) done(err);
    var pending = list.length;
    if (!pending)  done(null, results);
    list.forEach(function(file) {
      file = dir + '/' + file;
      fs.stat(file, function(err, stat) {
        if (stat && stat.isDirectory()) {
          walk(file, function(err, res) {
            results = results.concat(res);
            if (!--pending) done(null, results);
          });
        } else {
          results.push(file);
          if (!--pending) done(null, results);
        }
      });
    });
  });
};
var imgDir = process.cwd()+'/public/modules/core/years/2006/';
console.log("Image dir is "+imgDir);
walk(imgDir, function(nowt,list){
   console.log(list);
});


text:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { NgxSlackModule } from 'ngx-slack';

import { AppComponent } from './app.component';

@NgModule({
  imports:      [
    BrowserModule,
    HttpModule,
    NgxSlackModule.initializeApp('https://hooks.slack.com/services/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'),
  ],
  declarations: [ AppComponent ],
  bootstrap:    [ AppComponent ]
})
export class AppModule { }


text:
<?php
namespace Corma\Test\Fixtures\Repository;

use Corma\Repository\ObjectRepository;
use Corma\Util\PagedQuery;

class ExtendedDataObjectRepository extends ObjectRepository
{
    /**
     * @throws \Doctrine\DBAL\Exception
     */
    public function causeUniqueConstraintViolation()
    {
        $this->db->insert($this->getTableName(), ['id'=>999, $this->db->quoteIdentifier('myColumn')=>'value', $this->db->quoteIdentifier('isDeleted')=>0]);
        $this->db->insert($this->getTableName(), ['id'=>999, $this->db->quoteIdentifier('myColumn')=>'value', $this->db->quoteIdentifier('isDeleted')=>0]);
    }

    public function findAllPaged(): PagedQuery
    {
        $qb = $this->queryHelper->buildSelectQuery($this->getTableName());
        return $this->pagedQuery($qb, 5);
    }

    public function findAllSeekPaged(): PagedQuery
    {
        $qb = $this->queryHelper->buildSelectQuery($this->getTableName(), 'main.*', [], ['myColumn'=>'ASC']);
        return $this->pagedQuery($qb, 5, 'seek');
    }

    public function findAllInvalidPaged(): PagedQuery
    {
        $qb = $this->queryHelper->buildSelectQuery($this->getTableName(), 'main.*', [], ['myColumn'=>'ASC']);
        return $this->pagedQuery($qb, 5, 'invalid');
    }
}


text:
module Smithers
  module ConfigurationItems
    class Publishers
      class JUnit
        include LoggingHelper::LogToTerminal
        include Attributes::Mixin::Method
        extend Plugin::Registrar::Registrant

        register :job_publishers, :junit, self.inspect

        attr_reader :job, :configuration_block

        def initialize(job, parent, &block)
          @job = job
          @configuration_block = block

          set_defaults
        end

        attr_method({
          result_glob_path: 'production/**/.build/test-results/*.xml'
        })

        def configure
          instance_exec(&configuration_block)

          job.configuration['publishers'].deep_merge!({
            'hudson.tasks.junit.JUnitResultArchiver' => {
              'testResults'       => result_glob_path,
              'keepLongStdio'     => true,
              'healthScaleFactor' => '1.0'
            }
          })
        end

      end
    end
  end
end


text:
ver:0.0.2.alpha
last modified: 23.07.17

contributors:
Marcel Marchewka
Yunus Öztürk
Milosz Sobieraj
Irina Solovyeva

* Aktuelle .war-Datei ist unter diesem Link zu finden -> http://www101.zippyshare.com/v/5JqMetLK/file.html
* Ergebnisse zu ALEX sind unter diesem Link zu finden ->
+	BILD: http://svgur.com/i/2Jm.svg
+	SYMBOLS: https://raw.githubusercontent.com/nansquill/BlackBoxJPA/master/Result.alex.symbols.json
* Dokumetation -> https://onedrive.live.com/?authkey=%21AIJPPVWjgCAPYZw&cid=FE4CE451B615D619&id=FE4CE451B615D619%213137&parId=FE4CE451B615D619%212955&action=locate
* Screenshots:
+ Pic1: ![alt Pic1](https://raw.githubusercontent.com/nansquill/BlackBoxJPA/master/screen1.png)
+ Pic2: ![alt Pic2](https://raw.githubusercontent.com/nansquill/BlackBoxJPA/master/Screen2.png)
+ Pic3: ![alt Pic3](https://raw.githubusercontent.com/nansquill/BlackBoxJPA/master/Screen3.png)
+ Pic4: ![alt Pic4](https://raw.githubusercontent.com/nansquill/BlackBoxJPA/master/Screen4.png)

#aktuelle Bugs:
+ Unsupported Media Type (415 response) -> Rest api kann die korrekten Abfragen über POST/PUT nicht bearbeiten, Lösungsweg: header hinzufügen mit 'content-type':'application/json'
+ EntityNotManaged wenn die Nachricht editiert wird

# 0.0.2-alpha released:
+ Add new entities (if needed) (blackbox-persistence)
+ Extend REST-Interface with CRUD-classes (blackbox-business)
+ Update web interface (blackbox-presentation)
+ Create Unit test cases (blackbox-test)

# 0.0.1-SNAPSHOT released
+ :8080/blackbox -> web application
+ :8080/rest/{messages|types|persons)/ -> REST Interface

# DESCRIPTION

A small project that exposes rudimentary (RESTful) web services.

-----------
Structure:

The application follows a basic 3 layer structure, separating the persistence, business and presentation layer.

* persistence: A maven module to manage the database entities of the application.

Similar to examples 04 and 05, some configuration can be found in the persistence.xml file. A noteworthy difference:
Since we don't want to manually manage the persistence provider but use the one provided by the application server, some
settings have to applied to the application server, rather than the application. In detail: the database connection is
configured in the blackbox-ds.xml (in the blackbox-presentation module) and configured to be available under the jndi
name 'java:jboss/datasources/blackbox'. In the persistence.xml, this jndi name is configured as the source of our
entity manager.

* business: A maven module containing the RESTful application interface.

The MessageCRUD is an exemplary class for handling resource requests using the tools of the JAX-RS specification presented
in the lecture. The 'conf' package holds additional configurations, such as the activator for the JAX-RS subsystem and
a provider for the JSON (de-)serialization library 'Jackson'. Additionally an EJB Startup Bean is provided, that allows
to create some dummy data during the application startup.

* presentation: A maven module for the web resources accessed by the users browser:

The dart sourcecode is located under 'src/main/dart'. It is a variant of the angular-quickstart (see
https://github.com/angular-examples/quickstart) with some extensions to show the communication with the REST-backend.
Namely, components for posting messages and viewing the latest messages have been added, as well as a Dart-DAO for encapsulating
the data of the backend.

The dart-compiler is configured in the pom.xml using the dart-maven-plugin. For this plugin to work, it is necessary to
provide a path to the dart-sdk. In the given example, this is configured via a build property, which is defined the
parent pom.xml. Currently this value is hardcorded and may have to be changed according to your setup to work properly.
For a more flexible configuration that can be shared across multiple developers, an environment variable
(e.g. ${env.DART_SDK}) may be used, which each developer can set for himself/herself accordingly.

After successfully building the example app and deploying it in an application server, the application should be
available under http://localhost:8080/blackbox.

Attention: If you use the wildfly-swarm plugin to run your application, note that the wildfly-swarm:run goal is prone to
errors. The wildfly-swarm:package goal (or rather the resulting ...-swarm.jar) should work fine.

* test: A module containing test resources for the RESTful application interface.

By default, the module is not part of the build lifecycle, since it requires the application to be already running,
which is not the case during the build lifecycle. It holds a small test case that fetches data over the REST api and
validates the content of the response. It can be activated by activating the "withTest" profile.

-----------
Deployment:

Using only classes and annotations of the Java EE 7 API, the application should run in any Java EE 7 compliant
application server. However, some configurations are specific to the Wildfly application server, which is the suggested
application server for this application. While other application servers are possible (e.g. Glassfish) they may need
additional configuration.

For using the Wildfly application server, you have two possible deployment configurations:

The manual way:

* Download the Wildfly Application Server 10.1 Full Profile (http://wildfly.org/downloads/) and extract the archive to a
location of your choice.
* Copy your web archive (located in blackbox-presentation/target/blackbox-presentation-0.0.1.SNAPSHOT.war) to
$WILDFLY_HOME/standalone/deployments/
* Run $WILDFLY_HOME/bin/standalone.sh (or .bat if on windows) to start your application server.

Using the wildfly-swarm maven plugin:

* After 'mvn install'ing your application, switch to the blackbox-presentation directory and execute the 'package' goal
of the 'wildfly-swarm' plugin (mvn wildfly-swarm:package).
* Wait (a lot to download) until this steps succeeds.
* You can either directly start the target/blackbox-...-swarm.jar (via java -jar) or
* Run mvn wildfly-swarm:run to start the application server.

------------

Once the application server successfully started, the provided message resources should be available under
'http://localhost:8080/blackbox/message' etc.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.interfaces;
using umbraco.cms.businesslogic.media;
using umbraco.cms.businesslogic;
using umbraco.cms.businesslogic.property;
using System.Data;
using Umbraco.Core;
using umbraco.MacroEngines.Library;
using Umbraco.Web;
using Umbraco.Web.umbraco.presentation;

namespace umbraco.MacroEngines
{
    public class DynamicBackingItem
    {
        internal INode content;
        internal ExamineBackedMedia media;
        public DynamicBackingItemType Type;

        public DynamicBackingItem(INode iNode)
        {
            this.content = iNode;
            this.Type = DynamicBackingItemType.Content;
        }
        public DynamicBackingItem(ExamineBackedMedia media)
        {
            this.media = media;
            this.Type = DynamicBackingItemType.Media;
        }
        public DynamicBackingItem(int Id)
        {
            var n = CompatibilityHelper.ConvertToNode(UmbracoContext.Current.ContentCache.GetById(Id));

            this.content = n;
            this.Type = DynamicBackingItemType.Content;
            if (n.Id == 0 && Id != 0)
            {
                this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
                this.Type = DynamicBackingItemType.Media;
                if (this.media == null)
                {
                    this.Type = DynamicBackingItemType.Content;
                }
                return;
            }

        }
        public DynamicBackingItem(int Id, DynamicBackingItemType Type)
        {
            if (Type == DynamicBackingItemType.Media)
            {
                this.media = ExamineBackedMedia.GetUmbracoMedia(Id);
                this.Type = Type;
            }
            else
            {
                this.content = CompatibilityHelper.ConvertToNode(UmbracoContext.Current.ContentCache.GetById(Id));
                this.Type = Type;
            }
        }

        public DynamicBackingItem(CMSNode node)
        {
            this.content = (INode)node;
            this.Type = DynamicBackingItemType.Content;
        }

        public bool IsNull()
        {
            return (content == null && media == null);
        }
        public List<DynamicBackingItem> ChildrenAsList
        {
            get
            {
                if (IsNull()) return null;
                if (Type == DynamicBackingItemType.Content)
                {
                    var children = content.ChildrenAsList;
                    if (children != null)
                    {
                        return children.ConvertAll(c => new DynamicBackingItem(c));
                    }
                }
                else
                {
                    var children = media.ChildrenAsList.Value;
                    if (children != null)
                    {
                        return children.ConvertAll(m => new DynamicBackingItem(m));
                    }
                }
                return new List<DynamicBackingItem>();
            }
        }

        public PropertyResult GetProperty(string alias)
        {
            if (IsNull()) return null;
            if (Type == DynamicBackingItemType.Content)
            {
                return GetPropertyInternal(alias, content);
            }
            else
            {
                return GetPropertyInternal(alias, media);
            }
        }

        private PropertyResult GetPropertyInternal(string alias, INode content)
        {
            bool propertyExists = false;
            var prop = content.GetProperty(alias, out propertyExists);
            if (prop != null)
            {
                return new PropertyResult(prop) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
            }
            else
            {
                if (alias.Substring(0, 1).ToUpper() == alias.Substring(0, 1) && !propertyExists)
                {
                    prop = content.GetProperty(alias.Substring(0, 1).ToLower() + alias.Substring((1)), out propertyExists);
                    if (prop != null)
                    {
                        return new PropertyResult(prop) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
                    }
                    else
                    {
                        //reflect
                        object result = null;
                        try
                        {
                            result = content.GetType().InvokeMember(alias,
                                                      System.Reflection.BindingFlags.GetProperty |
                                                      System.Reflection.BindingFlags.Instance |
                                                      System.Reflection.BindingFlags.Public,
                                                      null,
                                                      content,
                                                      null);
                        }
                        catch (MissingMethodException)
                        {

                        }
                        if (result != null)
                        {
                            return new PropertyResult(alias, string.Format("{0}", result)) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
                        }
                    }
                }
            }
            return null;
        }
        private PropertyResult GetPropertyInternal(string alias, ExamineBackedMedia content)
        {
            bool propertyExists = false;
            var prop = content.GetProperty(alias, out propertyExists);
            if (prop != null)
            {
                return new PropertyResult(prop) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
            }
            else
            {
                if (alias.Substring(0, 1).ToUpper() == alias.Substring(0, 1) && !propertyExists)
                {
                    prop = content.GetProperty(alias.Substring(0, 1).ToLower() + alias.Substring((1)), out propertyExists);
                    if (prop != null)
                    {
                        return new PropertyResult(prop) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
                    }
                    else
                    {
                        object result = null;
                        try
                        {
                            result = content.GetType().InvokeMember(alias,
                                                      System.Reflection.BindingFlags.GetProperty |
                                                      System.Reflection.BindingFlags.Instance |
                                                      System.Reflection.BindingFlags.Public,
                                                      null,
                                                      content,
                                                      null);
                        }
                        catch (MissingMethodException)
                        {
                        }
                        if (result != null)
                        {
                            return new PropertyResult(alias, string.Format("{0}", result)) { ContextAlias = content.NodeTypeAlias, ContextId = content.Id };
                        }
                    }
                }
            }
            return null;
        }
        public PropertyResult GetProperty(string alias, out bool propertyExists)
        {
            if (IsNull())
            {
                propertyExists = false;
                return null;
            }
            PropertyResult property = null;
            IProperty innerProperty = null;
            if (Type == DynamicBackingItemType.Content)
            {
                innerProperty = content.GetProperty(alias, out propertyExists);
                if (innerProperty != null)
                {
                    property = new PropertyResult(innerProperty);
                    property.ContextAlias = content.NodeTypeAlias;
                    property.ContextId = content.Id;
                }
            }
            else
            {
                string[] internalProperties = new string[] {
                    "id", "nodeName", "updateDate", "writerName", "path", "nodeTypeAlias",
                    "parentID", "__NodeId", "__IndexType", "__Path", "__NodeTypeAlias",
                    "__nodeName", Constants.Conventions.Media.Bytes, Constants.Conventions.Media.Extension, Constants.Conventions.Media.File, Constants.Conventions.Media.Width,
                    Constants.Conventions.Media.Height
                };
                if (media.WasLoadedFromExamine && !internalProperties.Contains(alias) && !media.Values.ContainsKey(alias))
                {
                    //examine doesn't load custom properties
                    innerProperty = media.LoadCustomPropertyNotFoundInExamine(alias, out propertyExists);
                    if (innerProperty != null)
                    {
                        property = new PropertyResult(innerProperty);
                        property.ContextAlias = media.NodeTypeAlias;
                        property.ContextId = media.Id;
                    }
                }
                else
                {
                    innerProperty = media.GetProperty(alias, out propertyExists);
                    if (innerProperty != null)
                    {
                        property = new PropertyResult(innerProperty);
                        property.ContextAlias = media.NodeTypeAlias;
                        property.ContextId = media.Id;
                    }
                }
            }
            return property;
        }

        public PropertyResult GetProperty(string alias, bool recursive)
        {
            bool propertyExists = false;
            return GetProperty(alias, recursive, out propertyExists);
        }
        public PropertyResult GetProperty(string alias, bool recursive, out bool propertyExists)
        {
            if (!recursive)
            {
                return GetProperty(alias, out propertyExists);
            }
            if (IsNull())
            {
                propertyExists = false;
                return null;
            }
            DynamicBackingItem context = this;
            PropertyResult prop = this.GetProperty(alias, out propertyExists);
            while (prop == null || string.IsNullOrEmpty(prop.Value))
            {
                context = context.Parent;
                if (context == null) break;
                prop = context.GetProperty(alias, out propertyExists);
            }
            if (prop != null)
            {
                return prop;
            }
            return null;
        }
        public string GetPropertyValue(string alias)
        {
            var prop = GetProperty(alias);
            if (prop != null) return prop.Value;
            return null;
        }
        public string GetPropertyValue(string alias, bool recursive)
        {
            var prop = GetProperty(alias, recursive);
            if (prop != null) return prop.Value;
            return null;
        }
        public List<IProperty> PropertiesAsList
        {
            get
            {
                if (IsNull()) return null;
                if (Type == DynamicBackingItemType.Content)
                {
                    return content.PropertiesAsList;
                }
                else
                {
                    return media.PropertiesAsList;
                }
            }
        }
        public DataTable ChildrenAsTable()
        {
            if (IsNull()) return null;
            if (Type == DynamicBackingItemType.Content)
            {
                return content.ChildrenAsTable();
            }
            else
            {
                //sorry
                return null;
            }

        }
        public DataTable ChildrenAsTable(string nodeTypeAlias)
        {
            if (IsNull()) return null;
            if (Type == DynamicBackingItemType.Content)
            {
                return content.ChildrenAsTable(nodeTypeAlias);
            }
            else
            {
                //sorry
                return null;
            }

        }
        public int Level
        {
            get { if (IsNull()) return 0; return Type == DynamicBackingItemType.Content ? content.Level : media.Level; }
        }

        public int Id
        {
            get { if (IsNull()) return 0; return Type == DynamicBackingItemType.Content ? content.Id : media.Id; }
        }

        public string NodeTypeAlias
        {
            get { if (IsNull()) return null; return Type == DynamicBackingItemType.Content ? content.NodeTypeAlias : media.NodeTypeAlias; }
        }

        public DynamicBackingItem Parent
        {
            get
            {
                if (IsNull()) return null;
                if (Type == DynamicBackingItemType.Content)
                {
                    var parent = content.Parent;
                    if (parent != null)
                    {

                        return new DynamicBackingItem(parent);
                    }

                }
                else
                {
                    var parent = media.Parent;
                    if (parent != null && parent.Value != null)
                    {
                        return new DynamicBackingItem(parent.Value);
                    }
                }
                return null;
            }
        }
        public DateTime CreateDate
        {
            get { if (IsNull()) return DateTime.MinValue; return Type == DynamicBackingItemType.Content ? content.CreateDate : media.CreateDate; }
        }
        public DateTime UpdateDate
        {
            get { if (IsNull()) return DateTime.MinValue; return Type == DynamicBackingItemType.Content ? content.UpdateDate : media.UpdateDate; }
        }

        public string WriterName
        {
            get { if (IsNull()) return null; return Type == DynamicBackingItemType.Content ? content.WriterName : null; }
        }

        public string Name
        {
            get { if (IsNull()) return null; return Type == DynamicBackingItemType.Content ? content.Name : media.Name; }
        }
        public string nodeName
        {
            get { return Name; }
        }
        public string pageName
        {
            get { return Name; }
        }
        public Guid Version
        {
            get { if (IsNull()) return Guid.Empty; return Type == DynamicBackingItemType.Content ? content.Version : media.Version; }
        }

        public string Url
        {
            get { if (IsNull()) return null; return Type == DynamicBackingItemType.Content ? content.Url : media.Url; }
        }

        public string NiceUrl
        {
            get { if (IsNull()) return null; return Type == DynamicBackingItemType.Content ? content.NiceUrl : media.NiceUrl; }
        }

        public string UrlName
        {
            get { if (IsNull()) return null; return Type == DynamicBackingItemType.Content ? content.UrlName : null; }
        }

        public int template
        {
            get { if (IsNull()) return 0; return Type == DynamicBackingItemType.Content ? content.template : 0; }
        }

        public int SortOrder
        {
            get { if (IsNull()) return 0; return Type == DynamicBackingItemType.Content ? content.SortOrder : media.SortOrder; }
        }

        public string CreatorName
        {
            get { if (IsNull()) return null; return Type == DynamicBackingItemType.Content ? content.CreatorName : media.CreatorName; }
        }

        public int WriterID
        {
            get { if (IsNull()) return 0; return Type == DynamicBackingItemType.Content ? content.WriterID : 0; }
        }

        public int CreatorID
        {
            get { if (IsNull()) return 0; return Type == DynamicBackingItemType.Content ? content.CreatorID : media.CreatorID; }
        }

        public string Path
        {
            get { if (IsNull()) return null; return Type == DynamicBackingItemType.Content ? content.Path : media.Path; }
        }

        public List<DynamicBackingItem> GetChildrenAsList
        {
            get
            {
                if (Type == DynamicBackingItemType.Content)
                {
                    List<INode> children = content.ChildrenAsList;
                    //testing
                    if (children.Count == 0 && content.Id == 0)
                    {
                        return new List<DynamicBackingItem>(new DynamicBackingItem[] { this });
                    }
                    return children.ConvertAll(n => new DynamicBackingItem(n));
                }
                else
                {
                    List<ExamineBackedMedia> children = media.ChildrenAsList.Value;
                    //testing
                    if (children.Count == 0 && content.Id == 0)
                    {
                        return new List<DynamicBackingItem>(new DynamicBackingItem[] { this });
                    }
                    return children.ConvertAll(n => new DynamicBackingItem(n));
                }
            }
        }

    }
}


text:
package org.springframework.beans.support;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.BeansException;

/**
 * PropertyComparator performs a comparison of two beans,
 * using the specified bean property via a BeanWrapper.
 * @author Juergen Hoeller
 * @author Jean-Pierre Pawlak
 * @since 19.05.2003
 */
public class PropertyComparator implements Comparator {

	protected final Log logger = LogFactory.getLog(getClass());

	private final SortDefinition sortDefinition;

	private final Map cachedBeanWrappers = new HashMap();

	public PropertyComparator(SortDefinition sortDefinition) {
		this.sortDefinition = sortDefinition;
	}

	public int compare(Object o1, Object o2) {
		Object v1 = getPropertyValue(o1);
		Object v2 = getPropertyValue(o2);
		if (this.sortDefinition.isIgnoreCase() && (v1 instanceof String) && (v2 instanceof String)) {
			v1 = ((String) v1).toLowerCase();
			v2 = ((String) v2).toLowerCase();
		}
		int result;

		// Put a null property at the end of the sort.
		try {
			if (v1 != null) {
				if (v2 != null) {
					result = ((Comparable) v1).compareTo(v2);
				}
				else {
					result = -1;
				}
			}
			else {
				if (v2 != null) {
					result = 1;
				}
				else {
					result = 0;
				}
			}
		}
		catch (RuntimeException ex) {
			if (logger.isWarnEnabled()) {
				logger.warn("Could not sort objects [" + o1 + "] and [" + o2 + "]", ex);
			}
			return 0;
		}
		return (this.sortDefinition.isAscending() ? result : -result);
	}

	/**
	 * Get the SortDefinition's property value for the given object.
	 * @param obj the object to get the property value for
	 * @return the property value
	 */
	private Object getPropertyValue(Object obj) {
		BeanWrapper bw = (BeanWrapper) this.cachedBeanWrappers.get(obj);
		if (bw == null) {
			bw = new BeanWrapperImpl(obj);
			this.cachedBeanWrappers.put(obj, bw);
		}

		// If a nested property cannot be read, simply return null
		// (similar to JSTL EL). If the property doesn't exist in the
		// first place, let the exception through.
		try {
			return bw.getPropertyValue(this.sortDefinition.getProperty());
		}
		catch (BeansException ex) {
			logger.info("PropertyComparator could not access property - treating as null for sorting", ex);
			return null;
		}
	}

	/**
	 * Sort the given List according to the given sort definition.
	 *
Note: Contained objects have to provide the given property
	 * in the form of a bean property, i.e. a getXXX method.
	 * @param source the input List
	 * @param sortDefinition the parameters to sort by
	 * @throws java.lang.IllegalArgumentException in case of a missing propertyName
	 */
	public static void sort(List source, SortDefinition sortDefinition) throws BeansException {
		Collections.sort(source, new PropertyComparator(sortDefinition));
	}

	/**
	 * Sort the given source according to the given sort definition.
	 *
Note: Contained objects have to provide the given property
	 * in the form of a bean property, i.e. a getXXX method.
	 * @param source input source
	 * @param sortDefinition the parameters to sort by
	 * @throws java.lang.IllegalArgumentException in case of a missing propertyName
	 */
	public static void sort(Object[] source, SortDefinition sortDefinition) throws BeansException {
		Arrays.sort(source, new PropertyComparator(sortDefinition));
	}

}


text:
using System;
using System.Xml;

namespace Mono.Addins
{
	/// <summary>
	/// An extension node which specifies a type.
	/// </summary>
	/// <remarks>
	/// This class is a kind of Mono.Addins.ExtensionNode which can be used to register
	/// types in an extension point. This is a very common case: a host application
	/// defines an interface, and add-ins create classes that implement that interface.
	/// The host will define an extension point which will use TypeExtensionNode as node
	/// type. Add-ins will register the classes they implement in that extension point.
	///
	/// When the nodes of an extension point are of type TypeExtensionNode it is then
	/// possible to use query methods such as AddinManager.GetExtensionObjects(string),
	/// which will get all nodes in the provided extension path and will create an object
	/// for each node.
	///
	/// When declaring extension nodes in an add-in manifest, the class names can be
	/// specified using the 'class' or 'type' attribute. If none of those attributes is
	/// provided, the class name will be taken from the 'id' attribute.
	///
	/// TypeExtensionNode is the default extension type used when no type is provided
	/// in the definition of an extension point.
	/// </remarks>
	[ExtensionNode ("Type", Description="Specifies a class that will be used to create an extension object.")]
	[NodeAttribute ("class", typeof(Type), false, ContentType = ContentType.Class, Description="Name of the class. If a value is not provided, the class name will be taken from the 'id' attribute")]
	public class TypeExtensionNode: InstanceExtensionNode
	{
		string typeName;
		Type type;

		/// <summary>
		/// Reads the extension node data
		/// </summary>
		/// <param name='elem'>
		/// The element containing the extension data
		/// </param>
		/// <remarks>
		/// This method can be overriden to provide a custom method for reading extension node data from an element.
		/// The default implementation reads the attributes if the element and assigns the values to the fields
		/// and properties of the extension node that have the corresponding [NodeAttribute] decoration.
		/// </remarks>
		internal protected override void Read (NodeElement elem)
		{
			base.Read (elem);
			typeName = elem.GetAttribute ("type");
			if (typeName.Length == 0)
				typeName = elem.GetAttribute ("class");
			if (typeName.Length == 0)
				typeName = elem.GetAttribute ("id");
		}

		/// <summary>
		/// Creates a new extension object
		/// </summary>
		/// <returns>
		/// The extension object
		/// </returns>
		public override object CreateInstance ()
		{
			return Activator.CreateInstance (Type);
		}

		/// <summary>
		/// Type of the object that this node creates
		/// </summary>
		public Type Type {
			get {
				if (type == null) {
					if (typeName.Length == 0)
						throw new InvalidOperationException ("Type name not specified.");
					type = Addin.GetType (typeName, true);
				}
				return type;
			}
		}
	}

	/// <summary>
	/// An extension node which specifies a type with custom extension metadata
	/// </summary>
	/// <remarks>
	/// This is the default type for type extension nodes bound to a custom extension attribute.
	/// </remarks>
	public class TypeExtensionNode<T>: TypeExtensionNode where T:CustomExtensionAttribute
	{
		T data;

		/// <summary>
		/// The custom attribute containing the extension metadata
		/// </summary>
		[NodeAttribute]
		public T Data {
			get { return data; }
			internal set { data = value; }
		}
	}
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <title>La sentencia mientras/hacer</title>

La sentencia  mientras /hacer

      Desde el principio, siempre se nos ha dicho la esquina exacta de inicio.
      Nosotros queremos programar Karel para que se adapte mejor a su mundo. La
      sentencia mientras/hacer nos permite repetir pasos mientras se cumple una
      condición, y esto nos va a permitir programar a Karel para que ¡no sea un
      chico tan rígido!. La sentencia mientras/hacer tiene la
      forma siguiente:

...

    mientras xxx hacer inicio

   yyy

fin ;

...

      donde xxx debe ser una condición (una de las funciones booleanas listadas
      anteriormente), y yyy representa cualquier número de sentencias de Karel.
      El ejercicio 1 podría haberse escrito de la siguiente manera:

...

    mientras frente-libre hacer inicio

   avanza ;

fin ;

...

      Esto soluciona el problema de caminar de nuevo a  la 1ªCalle, sin
      importar como de lejos se encuentre de esta Calle.

      Ejercicio 6: La tarea de Karel es dejar zumbadores a lo
      largo de una pista de carreras. Un ejemplo de dicha pista es la de la
      siguiente imagen. Karel debe dar una vuelta completa y depositar un
      zumbador en cada esquina a lo largo del camino. Guarda el programa con el
      nombre <tt>pistaCarreras.txt</tt>. Tu solución debe usar sentencias
      mientras/hacer. Construye el mundo inicial de la
      siguiente imagen con el nombre <tt>pistaCarreras.mdo</tt>. Asegurate de
      poner dentro de la mochila suficientes zumbadores para todas las esquinas.
      El ejemplo requiere 22 zumbadores. Karel debe empezar en cualquier
      intersección de la pista.

      Asegúrate de que tu programa funciona en el mundo anterior, y después
      prueba tu programa modificando el mundo inicial. También, intenta iniciar
      a Karel desde diferentes intersecciones a lo largo del camino. ¿Realiza
      Karel su tarea correctamente en todos los casos?

La sentencia  mientras /hacer

Regresar


text:
/* ###
 * IP: GHIDRA
 *
 * 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.
 */
package ghidra.feature.fid.db;

/**
 * A class to represent the types of relations stored in the FID database.
 */
public enum RelationType {
	/**
	 * Direct call means that the inferior (callee) function exists in
	 * the same program as the superior (caller).
	 */
	DIRECT_CALL,
	/**
	 * An intralibrary call is between two functions that are in different programs but in the same library.
	 * The relation was discovered by linking on the name
	 */
	INTRA_LIBRARY_CALL,

	/**
	 * An interlibrary call is between two functions in entirely different libraries.
	 */
	INTER_LIBRARY_CALL
}


text:
package alien4cloud.rest.cloud;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import alien4cloud.model.cloud.CloudResourceMatcherConfig;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class CloudResourceMatcherDTO {

    private CloudResourceMatcherConfig matcherConfig;

    private String[] paaSImageIds;

    private String[] paaSFlavorIds;

    private String[] paaSNetworkTemplateIds;
}


text:
<?php

namespace PhpSsrs\ReportingService2010;

class ServerInfoHeader
{

  /**
   *
   * @var string $ReportServerVersionNumber
   * @access public
   */
  public $ReportServerVersionNumber = null;

  /**
   *
   * @var string $ReportServerEdition
   * @access public
   */
  public $ReportServerEdition = null;

  /**
   *
   * @var string $ReportServerVersion
   * @access public
   */
  public $ReportServerVersion = null;

  /**
   *
   * @var string $ReportServerDateTime
   * @access public
   */
  public $ReportServerDateTime = null;

  /**
   *
   * @var TimeZoneInformation $ReportServerTimeZoneInfo
   * @access public
   */
  public $ReportServerTimeZoneInfo = null;

  /**
   *
   * @param string $ReportServerVersionNumber
   * @param string $ReportServerEdition
   * @param string $ReportServerVersion
   * @param string $ReportServerDateTime
   * @param TimeZoneInformation $ReportServerTimeZoneInfo
   * @access public
   */
  public function __construct($ReportServerVersionNumber = null, $ReportServerEdition = null, $ReportServerVersion = null, $ReportServerDateTime = null, $ReportServerTimeZoneInfo = null)
  {
    $this->ReportServerVersionNumber = $ReportServerVersionNumber;
    $this->ReportServerEdition = $ReportServerEdition;
    $this->ReportServerVersion = $ReportServerVersion;
    $this->ReportServerDateTime = $ReportServerDateTime;
    $this->ReportServerTimeZoneInfo = $ReportServerTimeZoneInfo;
  }

}


text:
package com.github.takezoe.xlsbeans.publicfield;

import com.github.takezoe.xlsbeans.annotation.HorizontalRecords;
import com.github.takezoe.xlsbeans.annotation.Sheet;

import java.util.List;

@Sheet(name = "Language")
public class PublicFieldLanguageList {

  @HorizontalRecords(tableLabel = "Programming Languages", recordClass = PublicFieldLanguage.class)
  public List<PublicFieldLanguage> langs;

  @HorizontalRecords(tableLabel = "IDE for Languages", recordClass = PublicFieldLanguageIDE.class)
  public List<PublicFieldLanguageIDE> ides;

}


text:
require 'thor'

module Dockland
  class CLI < Thor

    desc 'info', 'Show info'
    def info
      remote = Dockland.dokku_remote
      puts "Remote : #{remote[:username]}@#{remote[:host]}:#{remote[:app_name]}"
      puts "Host   : #{remote[:host]}"
      puts "AppName: #{remote[:app_name]}"
    end

    def help
      puts Dockland.dokku_exec( 'help' )
    end

    def method_missing(*args)
      command, *opt = args

      puts Dockland.dokku_exec( command.to_s, opt.join(' ') )
    end

  end
end


text:
update associado
set idcidade = 1
where idassociado = 1;

update associado
set idcidade = 32
where idassociado = 3;


text:
<?php

# note, do not translate [CONTENT]

$lan = array(
  "No such template" => "Ikke en sådan skabelon",
  "Images stored" => "Billeder gemt",
  "No images found" => "Ingen billeder fundet",
  "Image" => "Billede",
  "not full URL" => "ikke hel URL",
  "does not exist" => "findes ikke",
  "Not a full URL:" => "Ikke en hel URL:",
  "No Title" => "Ingen titel",
  "Template does not contain the [CONTENT] placeholder" => "Skabelon indeholder ikke [CONTENT] pladsholder",
  "Template saved" => "Skabelon gemt",
  "Images" => "Billeder",
  "Below is the list of images used in your template. If an image is currently unavailable, please upload it to the database." => "Nedenfor er en liste over billeder anvendt i din skabelon. Hvis et billede ikke er tilgængeligt, så upload det til databasen.",
  "This includes all images, also fully referenced ones, so you may choose not to upload some. If you upload images, they will be included in the emails that use this template." => "Det gælder alle billeder, også dem med hele referencer, så du kan vælge ikke at uploade nogle af dem. Hvis du uploader billeder, vil de blive inkluderet i de emails, der benytter denne skabelon.",
  "Image name:" => "Billed navn:",
  "times used" => "antal gange benyttet",
  "Template does not contain local images" => "Skabelon indeholder ingen lokale billeder",
  "Some errors were found, template NOT saved!" => "Nogle fejl blev fundet, skabelon IKKE gemt!",
  "List of Templates" => "Skabelon oversigt",
  'Title of this template' => 'Titel på denne skabelon',
  'Content of the template.' => 'Skabelon indhold.',
  'The content should at least have [CONTENT] somewhere.' => 'Indholdet skal mindst indeholde [CONTENT] et eller andet sted.',
  'Check that all links have a full URL' => 'Tjek at alle links har en hel URL',
  'Check that all images have a full URL' => 'Tjek at alle billeder har en hel URL',
  'Check that all external images exist' => 'Tjek at alle eksterne billeder findes',
  'Save Changes' => 'Gem ændringer',
  'Save Images' => 'Gem billeder',

  # added 2.10.0
  'You can upload a template file or paste the text in the box below' => 'Du kan uploade en skabelon fil eller indsætte teksten i boksen nedenfor',
  'Template file.' => 'Skabelon fil.',

);
?>


text:
package com.thoughtworks.studios.mingle.hg.cmdline;

import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.util.Arrays;

public class LinePipeRunnableTest {

  @Test
  public void pipeWorks() throws Exception {
    String content = "expected\ntext\n";
    ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes());

    TestLineHandler testLineHandler = new TestLineHandler();
    PipeRunnable pipeRunnable = new LinePipeRunnable(in, testLineHandler);
    pipeRunnable.run();
    String[] expectedLines = new String[]{"expected", "text"};
    testLineHandler.assertLinesEqual(Arrays.asList(expectedLines));
  }
}


text:
package com.taotao.manager.service;

import com.taotao.manager.pojo.ItemDesc;

public interface ItemDescService extends BaseService<ItemDesc> {

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<sem:triples uri="http://www.lds.org/vrl/specific-people/scientists-and-academics/dusenberry-wilson-howard-1841-1925" xmlns:sem="http://marklogic.com/semantics">
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/specific-people/scientists-and-academics/dusenberry-wilson-howard-1841-1925</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#prefLabel</sem:predicate>
    <sem:object datatype="xsd:string" xml:lang="eng">Dusenberry, Wilson Howard 1841-1925</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/specific-people/scientists-and-academics/dusenberry-wilson-howard-1841-1925</sem:subject>
    <sem:predicate>http://www.w3.org/2004/02/skos/core#inScheme</sem:predicate>
    <sem:object datatype="sem:iri">http://www.lds.org/concept-scheme/vrl</sem:object>
  </sem:triple>
  <sem:triple>
    <sem:subject>http://www.lds.org/vrl/specific-people/scientists-and-academics/dusenberry-wilson-howard-1841-1925</sem:subject>
    <sem:predicate>http://www.lds.org/core#entityType</sem:predicate>
    <sem:object datatype="sem:iri">http://www.schema.org/Place</sem:object>
  </sem:triple>
</sem:triples>