text:
package persistentvolume

import (
	"fmt"
	"strconv"
	"time"

	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/api/meta"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/wait"
	"k8s.io/apimachinery/pkg/watch"
	"k8s.io/client-go/tools/cache"
	"k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/v1"
	storage "k8s.io/kubernetes/pkg/apis/storage/v1beta1"
	"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
	unversionedcore "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/core/v1"
	"k8s.io/kubernetes/pkg/client/record"
	"k8s.io/kubernetes/pkg/cloudprovider"
	"k8s.io/kubernetes/pkg/controller"
	"k8s.io/kubernetes/pkg/util/goroutinemap"
	"k8s.io/kubernetes/pkg/util/workqueue"
	vol "k8s.io/kubernetes/pkg/volume"

	"github.com/golang/glog"
)

// This file contains the controller base functionality, i.e. framework to
// process PV/PVC added/updated/deleted events. The real binding, provisioning,
// recycling and deleting is done in pv_controller.go

// ControllerParameters contains arguments for creation of a new
// PersistentVolume controller.
type ControllerParameters struct {
	KubeClient                             clientset.Interface
	SyncPeriod                             time.Duration
	AlphaProvisioner                       vol.ProvisionableVolumePlugin
	VolumePlugins                          []vol.VolumePlugin
	Cloud                                  cloudprovider.Interface
	ClusterName                            string
	VolumeSource, ClaimSource, ClassSource cache.ListerWatcher
	EventRecorder                          record.EventRecorder
	EnableDynamicProvisioning              bool
}

// NewController creates a new PersistentVolume controller
func NewController(p ControllerParameters) *PersistentVolumeController {
	eventRecorder := p.EventRecorder
	if eventRecorder == nil {
		broadcaster := record.NewBroadcaster()
		broadcaster.StartRecordingToSink(&unversionedcore.EventSinkImpl{Interface: p.KubeClient.Core().Events("")})
		eventRecorder = broadcaster.NewRecorder(v1.EventSource{Component: "persistentvolume-controller"})
	}

	controller := &PersistentVolumeController{
		volumes:           newPersistentVolumeOrderedIndex(),
		claims:            cache.NewStore(cache.DeletionHandlingMetaNamespaceKeyFunc),
		kubeClient:        p.KubeClient,
		eventRecorder:     eventRecorder,
		runningOperations: goroutinemap.NewGoRoutineMap(true /* exponentialBackOffOnError */),
		cloud:             p.Cloud,
		enableDynamicProvisioning:     p.EnableDynamicProvisioning,
		clusterName:                   p.ClusterName,
		createProvisionedPVRetryCount: createProvisionedPVRetryCount,
		createProvisionedPVInterval:   createProvisionedPVInterval,
		alphaProvisioner:              p.AlphaProvisioner,
		claimQueue:                    workqueue.NewNamed("claims"),
		volumeQueue:                   workqueue.NewNamed("volumes"),
	}

	controller.volumePluginMgr.InitPlugins(p.VolumePlugins, controller)
	if controller.alphaProvisioner != nil {
		if err := controller.alphaProvisioner.Init(controller); err != nil {
			glog.Errorf("PersistentVolumeController: error initializing alpha provisioner plugin: %v", err)
		}
	}

	volumeSource := p.VolumeSource
	if volumeSource == nil {
		volumeSource = &cache.ListWatch{
			ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
				return p.KubeClient.Core().PersistentVolumes().List(options)
			},
			WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
				return p.KubeClient.Core().PersistentVolumes().Watch(options)
			},
		}
	}
	controller.volumeSource = volumeSource

	claimSource := p.ClaimSource
	if claimSource == nil {
		claimSource = &cache.ListWatch{
			ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
				return p.KubeClient.Core().PersistentVolumeClaims(metav1.NamespaceAll).List(options)
			},
			WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
				return p.KubeClient.Core().PersistentVolumeClaims(metav1.NamespaceAll).Watch(options)
			},
		}
	}
	controller.claimSource = claimSource

	classSource := p.ClassSource
	if classSource == nil {
		classSource = &cache.ListWatch{
			ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
				return p.KubeClient.Storage().StorageClasses().List(options)
			},
			WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
				return p.KubeClient.Storage().StorageClasses().Watch(options)
			},
		}
	}
	controller.classSource = classSource

	controller.volumeInformer, controller.volumeController = cache.NewIndexerInformer(
		volumeSource,
		&v1.PersistentVolume{},
		p.SyncPeriod,
		cache.ResourceEventHandlerFuncs{
			AddFunc:    func(obj interface{}) { controller.enqueueWork(controller.volumeQueue, obj) },
			UpdateFunc: func(oldObj, newObj interface{}) { controller.enqueueWork(controller.volumeQueue, newObj) },
			DeleteFunc: func(obj interface{}) { controller.enqueueWork(controller.volumeQueue, obj) },
		},
		cache.Indexers{"accessmodes": accessModesIndexFunc},
	)
	controller.claimInformer, controller.claimController = cache.NewInformer(
		claimSource,
		&v1.PersistentVolumeClaim{},
		p.SyncPeriod,
		cache.ResourceEventHandlerFuncs{
			AddFunc:    func(obj interface{}) { controller.enqueueWork(controller.claimQueue, obj) },
			UpdateFunc: func(oldObj, newObj interface{}) { controller.enqueueWork(controller.claimQueue, newObj) },
			DeleteFunc: func(obj interface{}) { controller.enqueueWork(controller.claimQueue, obj) },
		},
	)

	// This is just a cache of StorageClass instances, no special actions are
	// needed when a class is created/deleted/updated.
	controller.classes = cache.NewStore(cache.DeletionHandlingMetaNamespaceKeyFunc)
	controller.classReflector = cache.NewReflector(
		classSource,
		&storage.StorageClass{},
		controller.classes,
		p.SyncPeriod,
	)
	return controller
}

// initializeCaches fills all controller caches with initial data from etcd in
// order to have the caches already filled when first addClaim/addVolume to
// perform initial synchronization of the controller.
func (ctrl *PersistentVolumeController) initializeCaches(volumeSource, claimSource cache.ListerWatcher) {
	volumeListObj, err := volumeSource.List(metav1.ListOptions{})
	if err != nil {
		glog.Errorf("PersistentVolumeController can't initialize caches: %v", err)
		return
	}
	volumeList, ok := volumeListObj.(*v1.PersistentVolumeList)
	if !ok {
		glog.Errorf("PersistentVolumeController can't initialize caches, expected list of volumes, got: %#v", volumeListObj)
		return
	}
	for _, volume := range volumeList.Items {
		// Ignore template volumes from kubernetes 1.2
		deleted := ctrl.upgradeVolumeFrom1_2(&volume)
		if !deleted {
			clone, err := api.Scheme.DeepCopy(&volume)
			if err != nil {
				glog.Errorf("error cloning volume %q: %v", volume.Name, err)
				continue
			}
			volumeClone := clone.(*v1.PersistentVolume)
			ctrl.storeVolumeUpdate(volumeClone)
		}
	}

	claimListObj, err := claimSource.List(metav1.ListOptions{})
	if err != nil {
		glog.Errorf("PersistentVolumeController can't initialize caches: %v", err)
		return
	}
	claimList, ok := claimListObj.(*v1.PersistentVolumeClaimList)
	if !ok {
		glog.Errorf("PersistentVolumeController can't initialize caches, expected list of claims, got: %#v", claimListObj)
		return
	}
	for _, claim := range claimList.Items {
		clone, err := api.Scheme.DeepCopy(&claim)
		if err != nil {
			glog.Errorf("error cloning claim %q: %v", claimToClaimKey(&claim), err)
			continue
		}
		claimClone := clone.(*v1.PersistentVolumeClaim)
		ctrl.storeClaimUpdate(claimClone)
	}
	glog.V(4).Infof("controller initialized")
}

// enqueueWork adds volume or claim to given work queue.
func (ctrl *PersistentVolumeController) enqueueWork(queue workqueue.Interface, obj interface{}) {
	// Beware of "xxx deleted" events
	if unknown, ok := obj.(cache.DeletedFinalStateUnknown); ok && unknown.Obj != nil {
		obj = unknown.Obj
	}
	objName, err := controller.KeyFunc(obj)
	if err != nil {
		glog.Errorf("failed to get key from object: %v", err)
		return
	}
	glog.V(5).Infof("enqueued %q for sync", objName)
	queue.Add(objName)
}

func (ctrl *PersistentVolumeController) storeVolumeUpdate(volume interface{}) (bool, error) {
	return storeObjectUpdate(ctrl.volumes.store, volume, "volume")
}

func (ctrl *PersistentVolumeController) storeClaimUpdate(claim interface{}) (bool, error) {
	return storeObjectUpdate(ctrl.claims, claim, "claim")
}

// updateVolume runs in worker thread and handles "volume added",
// "volume updated" and "periodic sync" events.
func (ctrl *PersistentVolumeController) updateVolume(volume *v1.PersistentVolume) {
	if deleted := ctrl.upgradeVolumeFrom1_2(volume); deleted {
		// volume deleted
		return
	}

	// Store the new volume version in the cache and do not process it if this
	// is an old version.
	new, err := ctrl.storeVolumeUpdate(volume)
	if err != nil {
		glog.Errorf("%v", err)
	}
	if !new {
		return
	}

	err = ctrl.syncVolume(volume)
	if err != nil {
		if errors.IsConflict(err) {
			// Version conflict error happens quite often and the controller
			// recovers from it easily.
			glog.V(3).Infof("could not sync volume %q: %+v", volume.Name, err)
		} else {
			glog.Errorf("could not sync volume %q: %+v", volume.Name, err)
		}
	}
}

// deleteVolume runs in worker thread and handles "volume deleted" event.
func (ctrl *PersistentVolumeController) deleteVolume(volume *v1.PersistentVolume) {
	_ = ctrl.volumes.store.Delete(volume)
	glog.V(4).Infof("volume %q deleted", volume.Name)

	if volume.Spec.ClaimRef == nil {
		return
	}
	// sync the claim when its volume is deleted. Explicitly syncing the
	// claim here in response to volume deletion prevents the claim from
	// waiting until the next sync period for its Lost status.
	claimKey := claimrefToClaimKey(volume.Spec.ClaimRef)
	glog.V(5).Infof("deleteVolume[%s]: scheduling sync of claim %q", volume.Name, claimKey)
	ctrl.claimQueue.Add(claimKey)
}

// updateClaim runs in worker thread and handles "claim added",
// "claim updated" and "periodic sync" events.
func (ctrl *PersistentVolumeController) updateClaim(claim *v1.PersistentVolumeClaim) {
	// Store the new claim version in the cache and do not process it if this is
	// an old version.
	new, err := ctrl.storeClaimUpdate(claim)
	if err != nil {
		glog.Errorf("%v", err)
	}
	if !new {
		return
	}
	err = ctrl.syncClaim(claim)
	if err != nil {
		if errors.IsConflict(err) {
			// Version conflict error happens quite often and the controller
			// recovers from it easily.
			glog.V(3).Infof("could not sync claim %q: %+v", claimToClaimKey(claim), err)
		} else {
			glog.Errorf("could not sync volume %q: %+v", claimToClaimKey(claim), err)
		}
	}
}

// deleteClaim runs in worker thread and handles "claim deleted" event.
func (ctrl *PersistentVolumeController) deleteClaim(claim *v1.PersistentVolumeClaim) {
	_ = ctrl.claims.Delete(claim)
	glog.V(4).Infof("claim %q deleted", claimToClaimKey(claim))

	// sync the volume when its claim is deleted.  Explicitly sync'ing the
	// volume here in response to claim deletion prevents the volume from
	// waiting until the next sync period for its Release.
	volumeName := claim.Spec.VolumeName
	glog.V(5).Infof("deleteClaim[%s]: scheduling sync of volume %q", claimToClaimKey(claim), volumeName)
	ctrl.volumeQueue.Add(volumeName)
}

// Run starts all of this controller's control loops
func (ctrl *PersistentVolumeController) Run(stopCh <-chan struct{}) {
	glog.V(1).Infof("starting PersistentVolumeController")
	ctrl.initializeCaches(ctrl.volumeSource, ctrl.claimSource)
	go ctrl.volumeController.Run(stopCh)
	go ctrl.claimController.Run(stopCh)
	go ctrl.classReflector.RunUntil(stopCh)
	go wait.Until(ctrl.volumeWorker, time.Second, stopCh)
	go wait.Until(ctrl.claimWorker, time.Second, stopCh)

	<-stopCh

	ctrl.claimQueue.ShutDown()
	ctrl.volumeQueue.ShutDown()
}

// volumeWorker processes items from volumeQueue. It must run only once,
// syncVolume is not assured to be reentrant.
func (ctrl *PersistentVolumeController) volumeWorker() {
	workFunc := func() bool {
		keyObj, quit := ctrl.volumeQueue.Get()
		if quit {
			return true
		}
		defer ctrl.volumeQueue.Done(keyObj)
		key := keyObj.(string)
		glog.V(5).Infof("volumeWorker[%s]", key)

		volumeObj, found, err := ctrl.volumeInformer.GetByKey(key)
		if err != nil {
			glog.V(2).Infof("error getting volume %q from informer: %v", key, err)
			return false
		}

		if found {
			// The volume still exists in informer cache, the event must have
			// been add/update/sync
			volume, ok := volumeObj.(*v1.PersistentVolume)
			if !ok {
				glog.Errorf("expected volume, got %+v", volumeObj)
				return false
			}
			ctrl.updateVolume(volume)
			return false
		}

		// The volume is not in informer cache, the event must have been
		// "delete"
		volumeObj, found, err = ctrl.volumes.store.GetByKey(key)
		if err != nil {
			glog.V(2).Infof("error getting volume %q from cache: %v", key, err)
			return false
		}
		if !found {
			// The controller has already processed the delete event and
			// deleted the volume from its cache
			glog.V(2).Infof("deletion of volume %q was already processed", key)
			return false
		}
		volume, ok := volumeObj.(*v1.PersistentVolume)
		if !ok {
			glog.Errorf("expected volume, got %+v", volumeObj)
			return false
		}
		ctrl.deleteVolume(volume)
		return false
	}
	for {
		if quit := workFunc(); quit {
			glog.Infof("volume worker queue shutting down")
			return
		}
	}
}

// claimWorker processes items from claimQueue. It must run only once,
// syncClaim is not reentrant.
func (ctrl *PersistentVolumeController) claimWorker() {
	workFunc := func() bool {
		keyObj, quit := ctrl.claimQueue.Get()
		if quit {
			return true
		}
		defer ctrl.claimQueue.Done(keyObj)
		key := keyObj.(string)
		glog.V(5).Infof("claimWorker[%s]", key)

		claimObj, found, err := ctrl.claimInformer.GetByKey(key)
		if err != nil {
			glog.V(2).Infof("error getting claim %q from informer: %v", key, err)
			return false
		}

		if found {
			// The claim still exists in informer cache, the event must have
			// been add/update/sync
			claim, ok := claimObj.(*v1.PersistentVolumeClaim)
			if !ok {
				glog.Errorf("expected claim, got %+v", claimObj)
				return false
			}
			ctrl.updateClaim(claim)
			return false
		}

		// The claim is not in informer cache, the event must have been "delete"
		claimObj, found, err = ctrl.claims.GetByKey(key)
		if err != nil {
			glog.V(2).Infof("error getting claim %q from cache: %v", key, err)
			return false
		}
		if !found {
			// The controller has already processed the delete event and
			// deleted the claim from its cache
			glog.V(2).Infof("deletion of claim %q was already processed", key)
			return false
		}
		claim, ok := claimObj.(*v1.PersistentVolumeClaim)
		if !ok {
			glog.Errorf("expected claim, got %+v", claimObj)
			return false
		}
		ctrl.deleteClaim(claim)
		return false
	}
	for {
		if quit := workFunc(); quit {
			glog.Infof("claim worker queue shutting down")
			return
		}
	}
}

const (
	// these pair of constants are used by the provisioner in Kubernetes 1.2.
	pvProvisioningRequiredAnnotationKey    = "volume.experimental.kubernetes.io/provisioning-required"
	pvProvisioningCompletedAnnotationValue = "volume.experimental.kubernetes.io/provisioning-completed"
)

// upgradeVolumeFrom1_2 updates PV from Kubernetes 1.2 to 1.3 and newer. In 1.2,
// we used template PersistentVolume instances for dynamic provisioning. In 1.3
// and later, these template (and not provisioned) instances must be removed to
// make the controller to provision a new PV.
// It returns true if the volume was deleted.
// TODO: remove this function when upgrade from 1.2 becomes unsupported.
func (ctrl *PersistentVolumeController) upgradeVolumeFrom1_2(volume *v1.PersistentVolume) bool {
	annValue, found := volume.Annotations[pvProvisioningRequiredAnnotationKey]
	if !found {
		// The volume is not template
		return false
	}
	if annValue == pvProvisioningCompletedAnnotationValue {
		// The volume is already fully provisioned. The new controller will
		// ignore this annotation and it will obey its ReclaimPolicy, which is
		// likely to delete the volume when appropriate claim is deleted.
		return false
	}
	glog.V(2).Infof("deleting unprovisioned template volume %q from Kubernetes 1.2.", volume.Name)
	err := ctrl.kubeClient.Core().PersistentVolumes().Delete(volume.Name, nil)
	if err != nil {
		glog.Errorf("cannot delete unprovisioned template volume %q: %v", volume.Name, err)
	}
	// Remove from local cache
	err = ctrl.volumes.store.Delete(volume)
	if err != nil {
		glog.Errorf("cannot remove volume %q from local cache: %v", volume.Name, err)
	}

	return true
}

// setClaimProvisioner saves
// claim.Annotations[annStorageProvisioner] = class.Provisioner
func (ctrl *PersistentVolumeController) setClaimProvisioner(claim *v1.PersistentVolumeClaim, class *storage.StorageClass) (*v1.PersistentVolumeClaim, error) {
	if val, ok := claim.Annotations[annDynamicallyProvisioned]; ok && val == class.Provisioner {
		// annotation is already set, nothing to do
		return claim, nil
	}

	// The volume from method args can be pointing to watcher cache. We must not
	// modify these, therefore create a copy.
	clone, err := api.Scheme.DeepCopy(claim)
	if err != nil {
		return nil, fmt.Errorf("Error cloning pv: %v", err)
	}
	claimClone, ok := clone.(*v1.PersistentVolumeClaim)
	if !ok {
		return nil, fmt.Errorf("Unexpected claim cast error : %v", claimClone)
	}
	metav1.SetMetaDataAnnotation(&claimClone.ObjectMeta, annStorageProvisioner, class.Provisioner)
	newClaim, err := ctrl.kubeClient.Core().PersistentVolumeClaims(claim.Namespace).Update(claimClone)
	if err != nil {
		return newClaim, err
	}
	_, err = ctrl.storeClaimUpdate(newClaim)
	if err != nil {
		return newClaim, err
	}
	return newClaim, nil
}

// Stateless functions

func getClaimStatusForLogging(claim *v1.PersistentVolumeClaim) string {
	bound := metav1.HasAnnotation(claim.ObjectMeta, annBindCompleted)
	boundByController := metav1.HasAnnotation(claim.ObjectMeta, annBoundByController)

	return fmt.Sprintf("phase: %s, bound to: %q, bindCompleted: %v, boundByController: %v", claim.Status.Phase, claim.Spec.VolumeName, bound, boundByController)
}

func getVolumeStatusForLogging(volume *v1.PersistentVolume) string {
	boundByController := metav1.HasAnnotation(volume.ObjectMeta, annBoundByController)
	claimName := ""
	if volume.Spec.ClaimRef != nil {
		claimName = fmt.Sprintf("%s/%s (uid: %s)", volume.Spec.ClaimRef.Namespace, volume.Spec.ClaimRef.Name, volume.Spec.ClaimRef.UID)
	}
	return fmt.Sprintf("phase: %s, bound to: %q, boundByController: %v", volume.Status.Phase, claimName, boundByController)
}

// isVolumeBoundToClaim returns true, if given volume is pre-bound or bound
// to specific claim. Both claim.Name and claim.Namespace must be equal.
// If claim.UID is present in volume.Spec.ClaimRef, it must be equal too.
func isVolumeBoundToClaim(volume *v1.PersistentVolume, claim *v1.PersistentVolumeClaim) bool {
	if volume.Spec.ClaimRef == nil {
		return false
	}
	if claim.Name != volume.Spec.ClaimRef.Name || claim.Namespace != volume.Spec.ClaimRef.Namespace {
		return false
	}
	if volume.Spec.ClaimRef.UID != "" && claim.UID != volume.Spec.ClaimRef.UID {
		return false
	}
	return true
}

// storeObjectUpdate updates given cache with a new object version from Informer
// callback (i.e. with events from etcd) or with an object modified by the
// controller itself. Returns "true", if the cache was updated, false if the
// object is an old version and should be ignored.
func storeObjectUpdate(store cache.Store, obj interface{}, className string) (bool, error) {
	objName, err := controller.KeyFunc(obj)
	if err != nil {
		return false, fmt.Errorf("Couldn't get key for object %+v: %v", obj, err)
	}
	oldObj, found, err := store.Get(obj)
	if err != nil {
		return false, fmt.Errorf("Error finding %s %q in controller cache: %v", className, objName, err)
	}

	objAccessor, err := meta.Accessor(obj)
	if err != nil {
		return false, err
	}

	if !found {
		// This is a new object
		glog.V(4).Infof("storeObjectUpdate: adding %s %q, version %s", className, objName, objAccessor.GetResourceVersion())
		if err = store.Add(obj); err != nil {
			return false, fmt.Errorf("Error adding %s %q to controller cache: %v", className, objName, err)
		}
		return true, nil
	}

	oldObjAccessor, err := meta.Accessor(oldObj)
	if err != nil {
		return false, err
	}

	objResourceVersion, err := strconv.ParseInt(objAccessor.GetResourceVersion(), 10, 64)
	if err != nil {
		return false, fmt.Errorf("Error parsing ResourceVersion %q of %s %q: %s", objAccessor.GetResourceVersion(), className, objName, err)
	}
	oldObjResourceVersion, err := strconv.ParseInt(oldObjAccessor.GetResourceVersion(), 10, 64)
	if err != nil {
		return false, fmt.Errorf("Error parsing old ResourceVersion %q of %s %q: %s", oldObjAccessor.GetResourceVersion(), className, objName, err)
	}

	// Throw away only older version, let the same version pass - we do want to
	// get periodic sync events.
	if oldObjResourceVersion > objResourceVersion {
		glog.V(4).Infof("storeObjectUpdate: ignoring %s %q version %s", className, objName, objAccessor.GetResourceVersion())
		return false, nil
	}

	glog.V(4).Infof("storeObjectUpdate updating %s %q with version %s", className, objName, objAccessor.GetResourceVersion())
	if err = store.Update(obj); err != nil {
		return false, fmt.Errorf("Error updating %s %q in controller cache: %v", className, objName, err)
	}
	return true, nil
}


text:
namespace mozart { namespace boostenv {

#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS

////////////////////
// PipeConnection //
////////////////////

PipeConnection::PipeConnection(BoostEnvironment& env, VMIdentifier vm):
  BaseSocketConnection(env, vm) {
}

#endif // BOOST_ASIO_HAS_LOCAL_SOCKETS

} }

#endif

#endif // MOZART_BOOSTENVPIPE_H

redpajama_set_name: RedPajamaGithub


text:
package boofcv.struct.image;

/**
 * @author Peter Abeles
 */
public class TestImageSInt8 extends StandardImageIntegerTests {
	public TestImageSInt8() {
		super(true);
	}

	@Override
	public ImageSingleBand createImage(int width, int height) {
		return new ImageSInt8(width, height);
	}

	@Override
	public Number randomNumber() {
		return (byte)(rand.nextInt(255)-126);
	}
}


text:
We love pull requests!

To report a bug or simply help Neighbor.ly help communities, take a look through the following guide.

## Reporting bugs and opening issues

To report a bug or open an issue, please follow the steps below:

1. **Find the correct repository.** Neighbor.ly is split across multiple repositories, each containing a different service. If you know the bug only applies to one service/gem, please open an issue in that repository (a list is available [here](https://github.com/neighborly/neighborly#other-repositories)). For general bugs and issues that span more than one service/gem, please open an issue in the [neighborly/neighborly](https://github.com/neighborly/neighborly) repository.
2. **Check if there is an existing issue.** If an issues already exists, please add
   any more information that you have, or give it a "+1" in the comments.
3. **Make sure that is related to Neighbor.ly.** If you open an issue that is not related to Neighbor.ly (e.g. a problem associated with git) we will simply close it.

When submitting an issue please describe the issue as clearly as possible, including how to reproduce the bug, which situations it appears in, what you expected to happen, and what actually happened. Screenshots for front-end issues are also very helpful.

## Pull Requests

See [our guides](https://github.com/neighborly/guides) to get things done, programming well, and following our patterns. Make sure your code follows our [style guide](https://github.com/neighborly/guides/tree/master/style) as well.

Add tests for your changes. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, we need a test! **We will not accept pull requests of features without tests.**

Again, we love pull requests, so don't be afraid to go ahead and change something or add a new feature. If they make sense, we're happy to work with you to get your changes merged into Neighbor.ly .

If you have an idea for a change, please discuss it in the open first, either by opening an issue, or by joining us in our [development chat room](https://www.hipchat.com/gWUYj8qfh).

Looking for something to work on? Take a look at our [open issues](https://github.com/neighborly/neighborly/issues?state=open).

## Developer Chat Room

To ask a question in real-time or to get a feel for what's going on, please drop into our [development chat room](https://www.hipchat.com/gWUYj8qfh). If no one is online, you can still leave a message and we'll reply as soon as we return.

## Security

Please do not publish security vulnerabilities publicly until we've had a chance to address them. All security related issues/patches should be sent directly to security@neighbor.ly where we will attempt to address them quickly. If you're unsure whether something is a security issue or not, please be cautious and contact us at security@neighbor.ly first.

And in case we didn't emphasize it enough: **we love tests!**


text:
using System.IO;
using System.Threading.Tasks;

namespace netcore_blog.Code.Services
{
    public interface IFiles
    {
        Task<string> ReadIndexAsync();
        Task<string> ReadPostAsync(string slug);
    }

    public class Files : IFiles
    {
        private readonly string _indexPath;

        public string _postsPath { get; }

        public Files(string webRootPath)
        {
            _indexPath = Path.Join(webRootPath, "content", "index.json");
            _postsPath = Path.Join(webRootPath, "content", "posts");
        }

        public async Task<string> ReadIndexAsync()
        {
            return await File.ReadAllTextAsync(_indexPath);
        }

        public async Task<string> ReadPostAsync(string slug)
        {
            return await File.ReadAllTextAsync(Path.Join(_postsPath, $"{slug}.md"));
        }
    }
}


text:
package org.terasology.reflection.reflect;

/**
 * Providers the ability to construct an instance of a type.
 *

 * These types must provide a default constructor, which will be invoked.
 *
 * @param <T> The type of the class to construct instances of
 * @author Immortius
 */
public interface ObjectConstructor<T> {

    /**
     * @return A new instance of the object type
     */
    T construct();
}


text:
.class public abstract Landroid/animation/AnimatorListenerAdapter;
.super Ljava/lang/Object;
.source "AnimatorListenerAdapter.java"

# interfaces
.implements Landroid/animation/Animator$AnimatorListener;

# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 24
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onAnimationCancel(Landroid/animation/Animator;)V
    .locals 0
    .parameter "animation"

    .prologue
    .line 31
    return-void
.end method

.method public onAnimationEnd(Landroid/animation/Animator;)V
    .locals 0
    .parameter "animation"

    .prologue
    .line 38
    return-void
.end method

.method public onAnimationRepeat(Landroid/animation/Animator;)V
    .locals 0
    .parameter "animation"

    .prologue
    .line 45
    return-void
.end method

.method public onAnimationStart(Landroid/animation/Animator;)V
    .locals 0
    .parameter "animation"

    .prologue
    .line 52
    return-void
.end method


text:
package org.fseek.simon.swing.filetree;

import java.awt.EventQueue;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.Transferable;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JTree;
import javax.swing.TransferHandler;
import javax.swing.UIManager;
import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreePath;
import org.fseek.simon.swing.filetree.dnd.interfaces.IFileDragDropSupport;
import org.fseek.simon.swing.filetree.impl.AddChildsThread;
import org.fseek.simon.swing.filetree.impl.DefaultFavoritesHandler;
import org.fseek.simon.swing.filetree.impl.DefaultLinkTreeNode;
import org.fseek.simon.swing.filetree.impl.IconQueue;
import org.fseek.simon.swing.filetree.interfaces.FavoritesChangedListener;
import org.fseek.simon.swing.filetree.interfaces.FavoritesHandler;
import org.fseek.simon.swing.filetree.interfaces.FileListener;
import org.fseek.simon.swing.filetree.interfaces.IconChangedListener;
import org.fseek.simon.swing.filetree.interfaces.LinkTreeNode;
import org.fseek.simon.swing.filetree.ui.FileTreePopupMenu;
import org.fseek.simon.swing.filetree.ui.HideRowTreeUI;
import org.fseek.simon.swing.filetree.ui.IconTreeCellRenderer;
import org.fseek.simon.swing.util.UtilBox;
import org.fseek.thedeath.os.VirtuaDirectory;
import org.fseek.thedeath.os.interfaces.IFileSystem;
import org.fseek.thedeath.os.interfaces.IOSIcons;
import org.fseek.thedeath.os.util.Debug;
import org.fseek.thedeath.os.util.FileSystemUtil;
import org.fseek.thedeath.os.util.OSUtil;

public class FileTree extends JTree implements IFileDragDropSupport
{
    private boolean finishedBuildTree = false;
    private boolean showFiles = true;
    private boolean showHidden = true;
    private boolean simpleIcons = false;

    private ArrayList<FileListener> selectionListener;
    private ArrayList<FileListener> clickListener;
    private FavoritesHandler favoriteHandler;

    //important nodes
    private DefaultLinkTreeNode biblioNode;
    private DefaultLinkTreeNode favoNode;
    private DefaultLinkTreeNode computerNode;

    private File selectedFile;

    private IconChangedListener iconChanged;

    public FileTree() {
        this(true, true);
    }

    public FileTree(boolean showFiles, boolean showHidden)
    {
        super();
        this.showFiles = showFiles;
        this.showHidden = showHidden;
        init();
        initDefaults();
        withoutModelCreation();
    }

    public FileTree(File folder){
        this(folder, true, true);
    }

    public FileTree(File folder, boolean showFiles, boolean showHidden){
        super();
        this.showFiles = showFiles;
        this.showHidden = showHidden;
        try
        {
            init();
            LinkTreeNode node = new DefaultLinkTreeNode(folder, OSUtil.getFileSystemView().getSystemDisplayName(folder.getCanonicalFile()), iconChanged);
            MutableTreeNode root = new DefaultMutableTreeNode();
            DefaultTreeModel model = new DefaultTreeModel(root);
            model.insertNodeInto(node, root, 0);
            withModelCreation(model);
            loadNode(node);
        } catch (IOException ex)
        {
            Logger.getLogger(FileTree.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void init(){
        setSimpleIcons(false);
        iconChanged = new FileTreeIconChangedListener((DefaultTreeModel)getModel());
        UtilBox.initFileTransfer(this);
    }

    private void initDefaults(){
        setFavoriteHandler(new DefaultFavoritesHandler());
    }

    private void withoutModelCreation()
    {
        DefaultMutableTreeNode root = new DefaultMutableTreeNode();
        DefaultTreeModel defaultTreeModel = new DefaultTreeModel(root);
        setModel(defaultTreeModel);
        intTree(root,defaultTreeModel, true);
    }

    private void withModelCreation(DefaultTreeModel model)
    {
        DefaultMutableTreeNode root = (DefaultMutableTreeNode)model.getRoot();
        intTree(root,model, false);
    }

    public void updateComputerNode()
    {
        DefaultTreeModel model = (DefaultTreeModel)this.getModel();
        model.nodeChanged(getComputerNode());
        this.expandPath(new TreePath(getComputerNode().getPath()));
    }

    private void initComputerNode(){
         for(File f : File.listRoots())
        {
            addFileToComputer(f);
        }
    }

    public void addFileToComputer(File f)
    {
        DefaultLinkTreeNode linkTreeNode = new DefaultLinkTreeNode(f, OSUtil.getFileSystemView().getSystemDisplayName(f), iconChanged);
        loadNewNode(linkTreeNode);
    }

    private void loadNewNode(LinkTreeNode node){
        DefaultTreeModel model = (DefaultTreeModel)getModel();
        model.insertNodeInto(node, computerNode, computerNode.getChildCount());
        loadNode(node);
    }

    private void loadNode(LinkTreeNode node){
        DefaultMutableTreeNode trNode = (DefaultMutableTreeNode)node;
        boolean expanded = !isExpanded(new TreePath(trNode.getPath()));
        loadNode(node, false, expanded);
    }

    private void loadNode(LinkTreeNode node, boolean childToChild, boolean fake){
       AddChildsThread t = AddChildsThread.create((DefaultTreeModel)getModel(),node, childToChild, showFiles, showHidden, fake);
       if(t.isAlive() == false){
           t.start();
       }else if(t.isFake() != fake){
           try
           {
               t.interrupt();
               t.join();
               loadNode(node, childToChild, fake);
           } catch (InterruptedException ex)
           {
               Logger.getLogger(FileTree.class.getName()).log(Level.SEVERE, null, ex);
           }

       }
    }

    private void folderTreeValueChanged(TreeSelectionEvent evt)
    {
        if(this.getLastSelectedPathComponent() instanceof LinkTreeNode){
            LinkTreeNode node = (LinkTreeNode)this.getLastSelectedPathComponent();
            if(node != null)
            {
                File linkDir = node.getLinkDir();
                fileSelectionChanged(linkDir, evt);
            }
        }
    }

    private void fileSelectionChanged(File f, TreeSelectionEvent evt){
        if(selectionListener == null)return;
        this.selectedFile = f;
        for(FileListener lis : selectionListener){
            lis.fileChanged(f, evt);
        }
    }

    private void nodeClicked(File f, MouseEvent ev){
        if(clickListener == null)return;
        for(FileListener lis : clickListener){
            lis.fileChanged(f, ev);
        }
    }

    private void folderTreeExpanded(TreeExpansionEvent event)
    {
        TreePath path = event.getPath();
        if(path.getLastPathComponent() instanceof LinkTreeNode && path.getLastPathComponent() != getBiblioNode()){
            LinkTreeNode node = (LinkTreeNode)path.getLastPathComponent();
            if(node.getParent() == null){
                DefaultTreeModel model = (DefaultTreeModel)this.getModel();
                Debug.println("Node hovering nowhere, try to find the right one..");
                LinkTreeNode find = find((DefaultMutableTreeNode) model.getRoot(), node.getLinkDir());
                if(find == null){
                        Debug.println("No node found...");
                    return;
                }
                node = find;
            }
            node.setHighPriority();
            loadNode(node, false, false);
        }
    }

    private LinkTreeNode find(DefaultMutableTreeNode root, File f) {
        Enumeration<DefaultMutableTreeNode> e = root.depthFirstEnumeration();
        while (e.hasMoreElements()) {
            DefaultMutableTreeNode nextElement = e.nextElement();
            if(nextElement instanceof LinkTreeNode){
                LinkTreeNode linkNode = (LinkTreeNode)nextElement;
                if (linkNode.getLinkDir().getAbsolutePath().equals(f.getAbsolutePath())) {
                    return linkNode;
                }
            }
        }
        return null;
    }

    private void folderTreeCollapsed(TreeExpansionEvent event)
    {
        TreePath path = event.getPath();
        if(path.getLastPathComponent() instanceof LinkTreeNode && path.getLastPathComponent() != getBiblioNode()){
            DefaultLinkTreeNode node = (DefaultLinkTreeNode)path.getLastPathComponent();
            cleanNode(node);
        }
    }

    /*
     * Maybe remove all child nodes so memory is saved
     */
    private void cleanNode(LinkTreeNode node){
        DefaultTreeModel model = (DefaultTreeModel)getModel();
        AddChildsThread create = AddChildsThread.create(model, node, false, showFiles, showHidden, true);
        if(create.isAlive() == false){
            create.start();
        }else if(create.isFake() == false){
            try
            {
                create.interrupt();
                create.join();
                cleanNode(node);
            } catch (InterruptedException ex)
            {
                Logger.getLogger(FileTree.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    private void maybeShowPopup(MouseEvent e)
    {
        if (e.isPopupTrigger())
        {
            TreePath selectionPath = this.getPathForLocation(e.getX(), e.getY());
            if(selectionPath == null)return;
            LinkTreeNode lastPathComponent = (LinkTreeNode)selectionPath.getLastPathComponent();
            this.setSelectionPath(selectionPath);
            showPopup(lastPathComponent, e);
        }
    }

    /*
     * Can be used to show a popup for the rightclicked node
     */
    protected void showPopup(LinkTreeNode node, MouseEvent e){
        FileTreePopupMenu menu = new FileTreePopupMenu(getFavoriteHandler(), node);
        menu.show(e.getComponent(), e.getX(), e.getY());
    }

    private void intTree(DefaultMutableTreeNode root, DefaultTreeModel model, boolean intModel)
    {
        intTreeActions();
        if(intModel == true)
        {
            intTreeModel(root, model);
        }
        else
        {
            this.setModel(model);
        }
        finishedBuildTree = true;
        setRootVisible(false);
        intTreeUI();
        finishTree();
    }

    private void finishTree()
    {
        if(getBiblioNode() != null)
            expandPath(new TreePath(getBiblioNode().getPath()));
        if(getFavoNode() != null)
            expandPath(new TreePath(getFavoNode().getPath()));
    }

    private void intTreeActions()
    {
        addTreeSelectionListener(new javax.swing.event.TreeSelectionListener()
        {
            @Override
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt)
            {
                folderTreeValueChanged(evt);
            }
        });
        addTreeExpansionListener(new TreeExpansionListener()
        {
            @Override
            public void treeExpanded(TreeExpansionEvent event)
            {
                folderTreeExpanded(event);
            }

            @Override
            public void treeCollapsed(TreeExpansionEvent event)
            {
                folderTreeCollapsed(event);
            }
        });
        addMouseListener(new MouseAdapter()
        {

            @Override
            public void mousePressed(MouseEvent e)
            {
                maybeShowPopup(e);
            }

            @Override
            public void mouseReleased(MouseEvent e)
            {
                maybeShowPopup(e);
            }

            @Override
            public void mouseClicked(MouseEvent e)
            {
                TreePath tp = FileTree.this.getPathForLocation(e.getX(), e.getY());
                if(tp == null)return;
                Object lastPathComponent = tp.getLastPathComponent();
                if(lastPathComponent instanceof LinkTreeNode){
                    LinkTreeNode node = (LinkTreeNode)lastPathComponent;
                    if(node.getLinkDir() != null && node.getLinkDir() instanceof VirtuaDirectory == false)
                        nodeClicked(node.getLinkDir(), e);
                }
            }
        });
    }

    private void intTreeModel(DefaultMutableTreeNode root, DefaultTreeModel model)
    {
        IOSIcons osIcons = OSUtil.getOsIcons();
        initFavoNode(root);
        // creating Bibliothek
        IFileSystem fileSystem = FileSystemUtil.getFileSystem();
        biblioNode = new DefaultLinkTreeNode(fileSystem.getHomeFolder(),osIcons.getLibraryIcon(), "Home", OSUtil.getOSAppearance().getTreeFontColor(), OSUtil.getOSAppearance().isTreeFontToUpperCase());

        // picture node
        addToLibraryIfExist(model, fileSystem.getImageFolder(), osIcons.getPictureIcon());

        // document node
        addToLibraryIfExist(model, fileSystem.getDocumentsFolder(), osIcons.getDocumentIcon());

        // music node
        addToLibraryIfExist(model, fileSystem.getMusicFolder(), osIcons.getMusicIcon());

        // videos node
        addToLibraryIfExist(model, fileSystem.getVideosFolder(), osIcons.getVideoIcon());

        if(biblioNode.getChildCount() > 0){
            model.insertNodeInto(getBiblioNode(), root, root.getChildCount());
        }
        // end creating Bibliothek

        // creating Computer node
        setComputerNode(new DefaultLinkTreeNode(OSUtil.getOsIcons().getComputerIcon(), "Computer", OSUtil.getOSAppearance().getTreeFontColor(), OSUtil.getOSAppearance().isTreeFontToUpperCase()));
        model.insertNodeInto(getComputerNode(), root, root.getChildCount());
        initComputerNode();
        //end creating computer node
        loadNode(getComputerNode());
        loadNode(getBiblioNode(), true, true);
        setModel(model);
    }

    protected void addToLibraryIfExist(DefaultTreeModel model, File f){
        addToLibraryIfExist(model, f, OSUtil.getFileSystemView().getSystemIcon(f, false));
    }

    protected void addToLibraryIfExist(DefaultTreeModel model, File f, ImageIcon icon){
        if(f.exists() == false)return;
        DefaultLinkTreeNode node = new DefaultLinkTreeNode(f, icon);
        if(node.getLinkDir().exists())
        {
            model.insertNodeInto(node, getBiblioNode(), getBiblioNode().getChildCount());
        }
    }

    /**
     * @return the computerNode
     */
    public DefaultLinkTreeNode getComputerNode()
    {
        return computerNode;
    }

    /**
     * @param computerNode the computerNode to set
     */
    public void setComputerNode(DefaultLinkTreeNode computerNode)
    {
        this.computerNode = computerNode;
    }

    private void intTreeUI()
    {
        setBackground(OSUtil.getOSAppearance().getTreePanelColor());
        HideRowTreeUI ownUi = new HideRowTreeUI();
        setUI(ownUi);
        ownUi.setCollapsedIcon(OSUtil.getOsIcons().getUncollapsedIcon());
        ownUi.setExpandedIcon(OSUtil.getOsIcons().getCollapsedIcon());
        DefaultTreeCellRenderer renderer = new IconTreeCellRenderer();
        setCellRenderer(renderer);
        setShowsRootHandles(true);
        putClientProperty("JTree.lineStyle", "None");
        setRowHeight(20);
        repaint();
    }

    public static void initUIManager(){
        UIManager.put("Tree.hash", OSUtil.getOSAppearance().getTreePanelColor());
    }

    /**
     * @return the finishedBuildTree
     */
    public boolean isFinishedBuildTree()
    {
        return finishedBuildTree;
    }

    /**
     * @return the biblioNode
     */
    public DefaultLinkTreeNode getBiblioNode()
    {
        return biblioNode;
    }

    /**
     * @return the favoNode
     */
    public DefaultLinkTreeNode getFavoNode()
    {
        return favoNode;
    }

    public void addFavorite(File link)
    {
        if(favoriteHandler != null){
            favoriteHandler.addFavorite(link, OSUtil.getFileSystemView().getSystemDisplayName(link));
        }
    }

    public void removeFavorite(File f)
    {
        if(favoriteHandler != null){
            favoriteHandler.removeFavorite(f);
        }
    }

    public void initFavorites(){
        if(favoriteHandler != null){
            favoriteHandler.initFavorites();
            HashMap<File, String> favorites = getFavorites();
            for (Iterator<Map.Entry<File, String>> it = favorites.entrySet().iterator(); it.hasNext();)
            {
                Map.Entry<File, String> entr = it.next();
                addFavoriteImpl(entr.getKey(), entr.getValue());
            }
            favoriteHandler.addFavoritesChangedListener(new FavoritesChangedListener() {
                @Override
                public void favoriteAdded(File f, String name)
                {
                    addFavoriteImpl(f, name);
                }

                @Override
                public void favoriteRemoved(File f)
                {
                    removeFavoriteImpl(f);
                }
            });
        }
    }

    private void initFavoNode(DefaultMutableTreeNode root){
        if(favoriteHandler != null){
            DefaultTreeModel model = (DefaultTreeModel)getModel();
            // creating Favorite node
            favoNode = new DefaultLinkTreeNode(OSUtil.getOsIcons().getStarIcon(), "Favoriten", OSUtil.getOSAppearance().getTreeFontColor(), OSUtil.getOSAppearance().isTreeFontToUpperCase());
            model.insertNodeInto(favoNode, root, 0);
            initFavorites();
            // end creating favorite node
        }
    }

    private void addFavoriteImpl(File f, String name){
        DefaultTreeModel model = (DefaultTreeModel)getModel();
        LinkTreeNode node = new DefaultLinkTreeNode(f, name, iconChanged);
        model.insertNodeInto(node, getFavoNode(), getFavoNode().getChildCount());
        loadNode(node);
    }

    private void removeFavoriteImpl(File f){
        DefaultTreeModel model = (DefaultTreeModel)getModel();
        for(int i = 0; i<getFavoNode().getChildCount(); i++){
            LinkTreeNode node = (LinkTreeNode)getFavoNode().getChildAt(i);
            if(node.getLinkDir().getAbsolutePath().equals(f.getAbsolutePath())){
                model.removeNodeFromParent(node);
            }
        }
    }

    public HashMap<File, String> getFavorites(){
        if(favoriteHandler == null){
            return null;
        }
        return favoriteHandler.getFavorites();
    }

    public void cleanup(){
        ArrayList<AddChildsThread> threads = AddChildsThread.getThreads();
        for(int i = 0; i<threads.size(); i++){
            AddChildsThread t = threads.get(i);
            t.interrupt();
            threads.remove(t);
        }
        if(favoriteHandler != null){
            favoriteHandler.dispose();
        }
    }

    public void addFileSelectionChangedListener(FileListener lis){
        if(selectionListener == null){
            selectionListener = new ArrayList<>();
        }
        selectionListener.add(lis);
    }

    public void removeFileSelectionChangedListener(FileListener lis){
        if(selectionListener == null){
            return;
        }
        selectionListener.remove(lis);
    }

    public void addFileClickListener(FileListener lis){
        if(clickListener == null){
            clickListener = new ArrayList<>();
        }
        clickListener.add(lis);
    }

    public void removeFileClickListener(FileListener lis){
        if(clickListener == null){
            return;
        }
        clickListener.remove(lis);
    }

    public void setFavoriteHandler(FavoritesHandler favoriteHandler)
    {
        if(finishedBuildTree && this.favoriteHandler != favoriteHandler){
            DefaultTreeModel model = (DefaultTreeModel)getModel();
            if(favoriteHandler == null){
                model.removeNodeFromParent(getFavoNode());
            }else{
                initFavoNode((DefaultMutableTreeNode)model.getRoot());
            }
        }else{
            this.favoriteHandler = favoriteHandler;
        }
    }

    public FavoritesHandler getFavoriteHandler()
    {
        return favoriteHandler;
    }

    public File getSelectedFile()
    {
        return selectedFile;
    }

    public void setSimpleIcons(boolean simpleIcons)
    {
        this.simpleIcons = simpleIcons;
        IconQueue.setSimpleIcons(simpleIcons);
    }

    @Override
    public boolean importFile(File[] file, int action, TransferHandler.DropLocation dropLocation) {
        DropLocation treeLoc = (DropLocation)dropLocation;
        Object lastPathComponent = treeLoc.getPath().getLastPathComponent();
        if(lastPathComponent instanceof LinkTreeNode){
            LinkTreeNode dropNode = (LinkTreeNode)lastPathComponent;
            File dropFile = dropNode.getLinkDir();
            if(canImport(dropFile) == false)return false;
            return importFile(file, dropFile);
        }
        return false;
    }

    public boolean importFile(File[] file, File drop){
        for(File f : file){
            Debug.println("Import file: " + f.getAbsolutePath() + " into " + drop.getAbsolutePath());
        }
        return true;
    }

    public boolean canImport(File drop) {
        return drop != null && drop.isDirectory();
    }

    @Override
    public boolean canImport(TransferHandler.TransferSupport support) {
        DropLocation treeLoc = (DropLocation)support.getDropLocation();
        Object lastPathComponent = treeLoc.getPath().getLastPathComponent();
        if(lastPathComponent instanceof LinkTreeNode){
            LinkTreeNode dropNode = (LinkTreeNode)lastPathComponent;
            File dropFile = dropNode.getLinkDir();
            boolean canImport = canImport(dropFile);
            support.setShowDropLocation(canImport);
            return canImport;
        }
        return false;
    }

    @Override
    public File[] getSelectedFiles() {
        TreePath[] selectionPaths = this.getSelectionPaths();
        if(selectionPaths == null){
            return new File[0];
        }
        File[] selFiles = new File[selectionPaths.length];
        for(int i = 0; i<selFiles.length; i++){
            Object lastPath  = selectionPaths[i].getLastPathComponent();
            if(lastPath instanceof LinkTreeNode){
                LinkTreeNode node = (LinkTreeNode)lastPath;
                selFiles[i] = node.getLinkDir();
            }
        }
        return selFiles;
    }

    @Override
    public void lostOwnership(Clipboard clipboard, Transferable contents) {
        //clipboard.setContents(null, this);
    }

    private static class FileTreeIconChangedListener implements IconChangedListener {
        private static final long serialVersionUID = 42L;
        private DefaultTreeModel model;
        public FileTreeIconChangedListener(DefaultTreeModel model)
        {
            this.model = model;
        }

        @Override
        public void iconChanged(final LinkTreeNode node, Icon newIcon)
        {
            EventQueue.invokeLater(new Runnable() {
                @Override
                public void run()
                {
                    model.nodeChanged(node);
                }
            });
        }
    };
}


text:
<?php

/**
 *
 * @package CRM
 * @copyright CiviCRM LLC (c) 2004-2015
 * $Id$
 *
 */

/**
 * Page for displaying list of PDF Page Formats
 */
class CRM_Admin_Page_PdfFormats extends CRM_Core_Page_Basic {

  public $useLivePageJS = TRUE;

  /**
   * The action links that we need to display for the browse screen.
   *
   * @var array
   */
  static $_links = NULL;

  /**
   * Get BAO Name.
   *
   * @return string
   *   Classname of BAO.
   */
  public function getBAOName() {
    return 'CRM_Core_BAO_PdfFormat';
  }

  /**
   * Get action Links.
   *
   * @return array
   *   (reference) of action links
   */
  public function &links() {
    if (!(self::$_links)) {
      // helper variable for nicer formatting
      self::$_links = array(
        CRM_Core_Action::UPDATE => array(
          'name' => ts('Edit'),
          'url' => 'civicrm/admin/pdfFormats',
          'qs' => 'action=update&id=%%id%%&reset=1',
          'title' => ts('Edit PDF Page Format'),
        ),
        CRM_Core_Action::DELETE => array(
          'name' => ts('Delete'),
          'url' => 'civicrm/admin/pdfFormats',
          'qs' => 'action=delete&id=%%id%%',
          'title' => ts('Delete PDF Page Format'),
        ),
      );
    }

    return self::$_links;
  }

  /**
   * Get name of edit form.
   *
   * @return string
   *   Classname of edit form.
   */
  public function editForm() {
    return 'CRM_Admin_Form_PdfFormats';
  }

  /**
   * Get edit form name.
   *
   * @return string
   *   name of this page.
   */
  public function editName() {
    return 'PDF Page Formats';
  }

  /**
   * Get user context.
   *
   * @param null $mode
   *
   * @return string
   *   user context.
   */
  public function userContext($mode = NULL) {
    return 'civicrm/admin/pdfFormats';
  }

  /**
   * Browse all PDF Page Formats.
   *
   * @param null $action
   *
   * @return void
   */
  public function browse($action = NULL) {
    // Get list of configured PDF Page Formats
    $pdfFormatList = CRM_Core_BAO_PdfFormat::getList();

    // Add action links to each of the PDF Page Formats
    $action = array_sum(array_keys($this->links()));
    foreach ($pdfFormatList as & $format) {
      $format['action'] = CRM_Core_Action::formLink(
        self::links(),
        $action,
        array('id' => $format['id']),
        ts('more'),
        FALSE,
        'pdfFormat.manage.action',
        'PdfFormat',
        $format['id']
      );
    }

    // Order Label Formats by weight
    $returnURL = CRM_Utils_System::url(self::userContext());
    CRM_Core_BAO_PdfFormat::addOrder($pdfFormatList, $returnURL);

    $this->assign('rows', $pdfFormatList);
  }

}


text:
define({
//begin v1.x content
	"clearFilterDialogTitle": "Rensa filter",
	"filterDefDialogTitle": "Filter",
	"defaultRuleTitle": "Regel",
	"ruleTitleTemplate": "Regel ${ruleNumber}",
	"noFilterApplied": "Inget filter tillämpat.",
	"defineFilter": "Definiera filter",
	"conditionEqual": "lika med",
	"conditionNotEqual": "inte lika med",
	"conditionLess": "är mindre än",
	"conditionLessEqual": "mindre eller lika med",
	"conditionGreater": "är större än",
	"conditionGreaterEqual": "större än eller lika med",
	"conditionContain": "innehåller",
	"conditionIs": "är",
	"conditionStartWith": "börjar med",
	"conditionEndWith": "slutar med",
	"conditionNotContain": "innehåller inte",
	"conditionIsNot": "är inte",
	"conditionNotStartWith": "börjar inte med",
	"conditionNotEndWith": "slutar inte med",
	"conditionBefore": "före",
	"conditionAfter": "efter",
	"conditionRange": "intervall",
	"conditionIsEmpty": "är tom",
	"all": "alla",
	"any": "någon",
	"relationAll": "alla regler",
	"waiRelAll": "Matcha alla följande regler:",
	"relationAny": "någon regel",
	"waiRelAny": "Matcha någon av följande regler:",
	"relationMsgFront": "Matcha",
	"relationMsgTail": "",
	"and": "och",
	"or": "eller",
	"addRuleButton": "Lägg till regel",
	"waiAddRuleButton": "Lägg till en ny regel",
	"removeRuleButton": "Ta bort regel",
	"waiRemoveRuleButtonTemplate": "Ta bort regel ${0}",
	"addRuleButton": "Lägg till filterregel",
	"cancelButton": "Avbryt",
	"waiCancelButton": "Avbryt dialogen",
	"clearButton": "Rensa",
	"waiClearButton": "Rensa filtret",
	"filterButton": "Filter",
	"waiFilterButton": "Filtrera",
	"columnSelectLabel": "Kolumn",
	"waiColumnSelectTemplate": "Kolumn för regel ${0}",
	"conditionSelectLabel": "Villkor",
	"waiConditionSelectTemplate": "Villkor för regel ${0}",
	"valueBoxLabel": "Värde",
	"waiValueBoxTemplate": "Ange värde för filtrering efter regeln ${0}",
	"rangeTo": "till",
	"rangeTemplate": "från ${0} till ${1}",
	"statusTipHeaderColumn": "Kolumn",
	"statusTipHeaderCondition": "Regler",
	"statusTipTitle": "Filterfält",
	"statusTipMsg": "Klicka på filterfältet om du vill filtrera värden i ${0}.",
	"anycolumn": "alla kolumner",
	"statusTipTitleNoFilter": "Filterfält",
	"statusTipTitleHasFilter": "Filter",
	"statusTipRelPre": "Matcha",
	"statusTipRelPost": "regler.",
	"statusTipHeaderAll": "Matcha alla regler.",
	"statusTipHeaderAny": "Matcha någon av reglerna.",
	"defaultItemsName": "objekt",
	"filterBarMsgHasFilterTemplate": "${0} av ${1} ${2} visas.",
	"filterBarMsgNoFilterTemplate": "Inget filter tillämpat",
	"filterBarDefButton": "Definiera filter",
	"waiFilterBarDefButton": "Filtrera tabellen",
	"a11yFilterBarDefButton": "Filter...",
	"filterBarClearButton": "Rensa filter",
	"waiFilterBarClearButton": "Rensa filtret",
	"closeFilterBarBtn": "Stäng filterfält",
	"clearFilterMsg": "Tar bort filtret och visar alla tillgängliga poster.",
	"anyColumnOption": "Någon kolumn",
	"trueLabel": "Sant",
	"falseLabel": "Falskt",
	"radioTrueLabel": "Värdet Sant",
	"radioFalseLabel": "Värdet Falskt",
	"beginTimeRangeLabel": "Startvärde för tidsintervall",
	"endTimeRangeLabel": "Slutvärde för tidsintervall",
	"beginDateRangeLabel": "Startvärde för datumintervall",
	"endDateRangeLabel": "Slutvärde för datumintervall",
	"startsWithExpr": "${0}*"
//end v1.x content
});


text:
АВТОРСКИЙ НАДЗОР

Авторский надзор – это контроль со стороны авторов проекта за соответствием строящегося объекта проектно-сметной документации. Авторский надзор осуществляется на протяжении всего периода строительства и приемки объекта.

В эту часть входят следующие пункты:

 Работа по корректировке выбранных материалов, сантехники, мебели, материалов максимально соответствующих первоначальной идее.

Корректировки смет, пересогласование

Корректировка встроенной мебели,в случае изменения задания

Поездки на объект, встречи со смежниками

Стоимость 500 $ в месяц. Включает в себя 4 выезда в пределах МКАД или 160 $ за 1 выезд. За пределы МКАД один выезд стоит 250 $.

Комплектация объекта

выезды к поставщикам с Заказчиком и без него

телефонные и другие переговоры с поставщиками с целью получения составленных ими счетов и их проверки на соответствие замыслу дизайнера;

получение технической документации от поставщиков и консультирование производителей работ;

сопровождение оплаты;

организация доставки, разгрузки и складирования и страхования ценностей.

Стоимость  700 $ + 10% от стоимости закупаемых мебели и материалов.

Проектирование заказных элементов

В т.ч. мебели, люстр, каминов, лестниц, скульптур, росписи, сложных конструкций деревянных и лепных потолков, панно и т.д.

Стоимость 10 % от стоимости изделия

Сопровождение проекта

Контроль за соблюдением календарных сроков выполнения ремонтных, строительных и отделочных работ.

Контроль качества в ходе выполнения ремонтных, строительных и отделочных работ, контроль качества и соответствия используемых материалов и поставляемого оборудования дизайнерским и проектным решениям и требованиям технического задания.

Контроль качества и соответствия материалов, используемых подрядчиками сметной документации, при необходимости - проверка наличия документов, подтверждающих их качество (технических паспортов, сертификатов и т. п.).

Помощь в выборе, покупке материалов и оборудования.

Координирование работы подрядчиков, решение спорных вопросов.

Фото фиксация проведения строительных работ.( В целях независимого контроля качества осуществляется фото фиксация допущенного брака, дефекты, а так же работы по их устранению и фото фиксация скрытых работ)

Стоимость 10 % от строительной сметы

Декорирование интерьера

наполнение предметами интерьера, картинами, вазами, инсталяциями, цветами, посудой, скульптурами, арт-объектами,различным декором.

Стоимосьть 10-30 евро за метр


text:
#pragma checksum "C:\Users\d.delaire\Documents\GitHub\CustomRateMyApp-Universal\CustomRateMyApp-Demo\CustomRateMyApp-Demo\CustomRateMyApp-Demo.Shared\Controls\RateUserControl.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "D8D68FAF2238F5BC11C846A19F6CA225"
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace CustomRateMyApp_Demo
{
    partial class RateUserControl : global::Windows.UI.Xaml.Controls.UserControl
    {
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
        private global::Windows.UI.Xaml.Controls.Grid RateUserGrid;
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
        private global::Windows.UI.Xaml.Controls.Grid GridRating;
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
        private global::Windows.UI.Xaml.Controls.TextBlock tbDoNotAsk;
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
        private global::Windows.UI.Xaml.Controls.TextBlock tbLater;
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
        private bool _contentLoaded;

        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Windows.UI.Xaml.Build.Tasks"," 4.0.0.0")]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        public void InitializeComponent()
        {
            if (_contentLoaded)
                return;

            _contentLoaded = true;
            global::Windows.UI.Xaml.Application.LoadComponent(this, new global::System.Uri("ms-appx:///Controls/RateUserControl.xaml"), global::Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            RateUserGrid = (global::Windows.UI.Xaml.Controls.Grid)this.FindName("RateUserGrid");
            GridRating = (global::Windows.UI.Xaml.Controls.Grid)this.FindName("GridRating");
            tbDoNotAsk = (global::Windows.UI.Xaml.Controls.TextBlock)this.FindName("tbDoNotAsk");
            tbLater = (global::Windows.UI.Xaml.Controls.TextBlock)this.FindName("tbLater");
        }
    }
}


text:
Imports System.Data.SqlClient
Public Class FrmGiToConsoh
    Dim cx As New NPIData(NPIConnect.NPIRYSV62PlanningS)
    Private dgvColumnHeader As DGVColumnHeader
    Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
        cx.ClearButton(Panel1)
        Try
            dtgItem.Columns.Remove("Check")
        Catch ex As Exception

        End Try

        Me.Cursor = Cursors.WaitCursor

        dtgItem.Columns.Add("Check", "Check")

        Dim r1 As Integer = 0
        For r As Integer = 0 To dtgItem.Rows.Count - 1
            If Me.dtgItem.Rows(r).Cells(0).Value = "true" Then
                r1 += 1
            End If
        Next

        If r1 = 0 Then MsgBox("คุณไม่ได้เลือกรายการเลย", , "เลือกอย่างน้อย 1 รายการ") : Me.Cursor = Cursors.Default : Exit Sub

        Dim tmpID As Integer
        Dim Result As String
        Dim movementtype As String
        Dim x As String = cx.ExecuteScalar("select MAX (orderno) from [172.18.8.188].NPIconsohPD.dbo.tbt_giinusedheader")
        tmpID = Convert.ToInt32(x.ToString().Substring(4, 4))
        Result = (x.ToString().Substring(0, 4) & (tmpID + 1).ToString("0000"))

        Dim c = cx.ExecuteScalar("Select Giinusedorderno from tbt_600GiToConsoh where headertext = '" & txtOrder.Text & "'")
        If String.IsNullOrEmpty(c.ToString) Then
            movementtype = "201"
        Else
            movementtype = "261"
        End If

        Dim cmd As OleDbCommand
        cmd = cx.CommandCreate("insert into [172.18.8.188].NPIconsohPD.dbo.tbt_giinusedheader (OrderNo,OrderStatus,WHCode,MovementType,DocumentDate, " & _
                               "RequestByWHCode,RequestByWHName,CreateBy,HeaderText) values (?,?,?,?,?,?,?,?,?)", "TTTTDTTIT")
        cmd.Parameters(0).Value = Result
        cmd.Parameters(1).Value = "New"
        cmd.Parameters(2).Value = txtWhCode.Text
        cmd.Parameters(3).Value = movementtype
        cmd.Parameters(4).Value = Now()
        cmd.Parameters(5).Value = "106"
        cmd.Parameters(6).Value = "RY - ประกอบสินค้า"
        cmd.Parameters(7).Value = 195
        cmd.Parameters(8).Value = txtOrder.Text
        cx.Execute(cmd)

        For r As Integer = 0 To dtgItem.Rows.Count - 1
            Me.dtgItem.EndEdit()
            'Dim re_value As String = Me.dtgItem.Rows(r).Cells(0).EditedFormattedValue.ToString()
            Try
                If Me.dtgItem.Rows(r).Cells(0).Value = "true" Then
                    cmd = cx.CommandCreate("insert into [172.18.8.188].NPIconsohPD.dbo.tbt_giinusedDetail (OrderNo,ItemNo,ProductCode,OrderQty,Unit, " & _
                    "GLAccount,GIInUsedOrderNo,CostCenter) values (?,?,?,?,?,?,?,?) ", "TITITTTT")
                    cmd.Parameters(0).Value = Result
                    cmd.Parameters(1).Value = dtgItem.Item("itemNo", r).Value
                    cmd.Parameters(2).Value = dtgItem.Item("Productcode", r).Value
                    cmd.Parameters(3).Value = dtgItem.Item("OrderQty", r).Value
                    cmd.Parameters(4).Value = dtgItem.Item("Unit", r).Value
                    cmd.Parameters(5).Value = dtgItem.Item("GLAccount", r).Value
                    cmd.Parameters(6).Value = dtgItem.Item("Giinusedorderno", r).Value
                    cmd.Parameters(7).Value = dtgItem.Item("CostCenter", r).Value

                    Dim Z As Integer = cx.Execute(cmd)
                    If Z = -99 Then
                        dtgItem.Item("Check", r).Value = "Fail"
                        dtgItem.Rows(r).DefaultCellStyle.BackColor = Color.Red
                    Else
                        dtgItem.Item("Check", r).Value = "OK"
                    End If
                End If
            Catch ex As Exception
                MsgBox("ไม่สามารถนำข้อมูลเข้าระบบได้ โปรดลองอีกครั้ง และสังเกตุ Column Check ด้วย")
                cmdSave.Enabled = False
                Me.Cursor = Cursors.Default
                Exit Sub
            End Try
        Next

        cmd = cx.CommandCreate("Update tbt_600GiToConsoh set Orderno = ? , UnameConfirm = ? , ConfirmDate  = ? where HeaderText = ?", "TTDT")
        cmd.Parameters(0).Value = Result
        cmd.Parameters(1).Value = Uname
        cmd.Parameters(2).Value = Now()
        cmd.Parameters(3).Value = txtOrder.Text
        cx.Execute(cmd)

        MsgBox("นำข้อมูล Order " & txtOrder.Text & " เข้า ConSoh เรียบร้อย ได้เลข " & Result.ToString & " โปรดตรวจสอบ Column Check ว่า OK หรือไม่")
        cmdSave.Enabled = False
        Me.Cursor = Cursors.Default
    End Sub
    Private Sub cmdExec_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExec.Click
        cx.ClearButton(Panel1)

        dtgItem.DataSource = Nothing
        lblWarning.Text = ""

        Try
            dtgItem.Columns.RemoveAt(0)
        Catch ex As Exception

        End Try

        Try
            dtgItem.Columns.Remove("Check")
        Catch ex As Exception

        End Try

        If txtOrder.Enabled = False Then txtOrder.Enabled = True : txtWhCode.Enabled = True : Exit Sub

        Dim A As String = txtWhCode.Text
        If A = String.Empty Then MsgBox("ยังไม่ใส่รหัส Wh Code") : txtWhCode.Focus() : Exit Sub
        If A <> "113" And A <> "117" Then MsgBox("Wh code ใส่เฉพาะ 113 หรือ 117") : txtWhCode.Focus() : Exit Sub

        A = txtOrder.Text
        If A = String.Empty Then MsgBox("ยังไม่ใส่เลข Order") : txtOrder.Focus() : Exit Sub

        Dim B As String = cx.ExecuteScalar("Select headertext from tbt_600GiToConsoh where headertext = '" & A & "'")
        If String.IsNullOrEmpty(B) Then MsgBox("ไม่มีเลข Order นี้ในระบบ") : txtOrder.Focus() : Exit Sub

        Dim C = cx.ExecuteScalar("Select Orderno from tbt_600GiToConsoh where headertext = '" & A & "'")
        If Not IsDBNull(C) Then lblWarning.Text = "โปรดระวัง Order " & A & " เคยนำเข้า Consoh แล้ว ได้เลข " & C : MsgBox(lblWarning.Text)

        Me.Cursor = Cursors.WaitCursor

        dgvColumnHeader = New DGVColumnHeader()
        dtgItem.Columns.Insert(0, New DataGridViewCheckBoxColumn())
        dtgItem.Columns(0).HeaderCell = dgvColumnHeader

        Dim DT As DataTable = cx.GetdataTable("select A.Headertext,A.itemNo,A.Productcode,B.mmateng,A.OrderQty,A.Unit,A.GLAccount,A.CostCenter,A.Giinusedorderno " & _
                " from tbt_600GiToConsoh A left join DBWMS.dbo.vmsa140_product_basic B on a.productcode = B.mmatno where A.Headertext ='" & A & "'" & _
                " order by itemno ")
        dtgItem.DataSource = DT
        cx.GridToList(dtgItem)

        For r As Integer = 0 To dtgItem.Rows.Count - 1
            If IsDBNull(dtgItem.Item("GLAccount", r).Value) Or IsDBNull(dtgItem.Item("CostCenter", r).Value) Then
                MsgBox("ข้อมูลบัญชีไม่สมบูรณ์ ไม่สามารถ Interface ConSoh ได้")
                dtgItem.Rows(r).DefaultCellStyle.BackColor = Color.Red
                cmdSave.Enabled = False
                Me.Cursor = Cursors.Default
                Exit Sub
            ElseIf IsDBNull(dtgItem.Item("OrderQty", r).Value) Then
                MsgBox("ข้อมูลจำนวนเบิกไม่ถูกต้อง ไม่สามารถ Interface Consoh ได้")
                dtgItem.Rows(r).DefaultCellStyle.BackColor = Color.Red
                cmdSave.Enabled = False
                Me.Cursor = Cursors.Default
                Exit Sub
            ElseIf dtgItem.Item("OrderQty", r).Value = 0 Then
                MsgBox("ข้อมูลจำนวนเบิกไม่ถูกต้อง ไม่สามารถ Interface Consoh ได้")
                dtgItem.Rows(r).DefaultCellStyle.BackColor = Color.Red
                cmdSave.Enabled = False
                Me.Cursor = Cursors.Default
                Exit Sub
            Else
                txtWhCode.Enabled = False
                txtOrder.Enabled = False
                cmdSave.Enabled = True
            End If
        Next
        Me.Cursor = Cursors.Default
    End Sub
    Private Sub FrmGiToConsoh_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        cx.GetUserUsedProg(My.Application.ToString, Me.Name.ToString)
        cmdSave.Enabled = False
        lblWarning.BorderStyle = BorderStyle.None
        lblWarning.Text = ""
        lblWarning.ForeColor = Color.Red
    End Sub
    Private Sub dtgItem_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dtgItem.CellClick
        If e.ColumnIndex = 0 Then
            If e.RowIndex >= 0 Then
                Me.dtgItem.EndEdit()
                Dim re_value As String = Me.dtgItem.Rows(e.RowIndex).Cells(0).EditedFormattedValue.ToString()
                If Me.dtgItem.Rows(e.RowIndex).Cells(0).Value = "true" Then Me.dtgItem.Rows(e.RowIndex).Cells(0).Value = "False" Else Me.dtgItem.Rows(e.RowIndex).Cells(0).Value = "true"
            End If
        End If
    End Sub
    Private Sub dtgItem_ColumnHeaderMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles dtgItem.ColumnHeaderMouseClick
        If e.ColumnIndex = 0 Then
            For i As Integer = 0 To dtgItem.Rows.Count - 1
                Me.dtgItem.EndEdit()
                Dim re_value As String = Me.dtgItem.Rows(i).Cells(0).EditedFormattedValue.ToString()
                dtgItem.Rows(i).Cells(0).Value = dgvColumnHeader.CheckAll
            Next
        End If
    End Sub
End Class


text:
namespace net {

class AuthCredentials;
struct HttpRequestInfo;
class HttpResponseInfo;
class IOBuffer;
struct TransportInfo;
struct LoadTimingInfo;
class NetLogWithSource;
class QuicServerInfo;
class SSLPrivateKey;
class X509Certificate;

// Represents a single HTTP transaction (i.e., a single request/response pair).
// HTTP redirects are not followed and authentication challenges are not
// answered.  Cookies are assumed to be managed by the caller.
class NET_EXPORT_PRIVATE HttpTransaction {
 public:
  // If |*defer| is set to true, the transaction will wait until
  // ResumeNetworkStart is called before establishing a connection.
  using BeforeNetworkStartCallback = base::OnceCallback<void(bool* defer)>;

  // Called each time a connection is obtained, before any data is sent.
  //
  // |info| describes the newly-obtained connection.
  //
  // This can be called multiple times for a single transaction, in the case of
  // retries, auth challenges, and split range requests.
  //
  // If this callback returns an error, the transaction fails with that error.
  // Otherwise the transaction continues unimpeded.
  // Must not return ERR_IO_PENDING.
  //
  // TODO(crbug.com/986744): Fix handling of OnConnected() when proxy
  // authentication is required. We should notify this callback that a
  // connection was established, even though the stream might not be ready for
  // us to send data through it.
  using ConnectedCallback =
      base::RepeatingCallback<int(const TransportInfo& info,
                                  CompletionOnceCallback callback)>;

  // Stops any pending IO and destroys the transaction object.
  virtual ~HttpTransaction() {}

  // Starts the HTTP transaction (i.e., sends the HTTP request).
  //
  // TODO(crbug.com/723786) The consumer should ensure that request_info points
  // to a valid value till final response headers are received; after that
  // point, the HttpTransaction will not access |*request_info| and it may be
  // deleted.
  //
  // Returns OK if the transaction could be started synchronously, which means
  // that the request was served from the cache.  ERR_IO_PENDING is returned to
  // indicate that |callback| will be notified once response info is available
  // or if an IO error occurs.  Any other return value indicates that the
  // transaction could not be started.
  //
  // Regardless of the return value, the caller is expected to keep the
  // request_info object alive until Destroy is called on the transaction.
  //
  // NOTE: The transaction is not responsible for deleting the callback object.
  //
  // Profiling information for the request is saved to |net_log| if non-NULL.
  virtual int Start(const HttpRequestInfo* request_info,
                    CompletionOnceCallback callback,
                    const NetLogWithSource& net_log) = 0;

  // Restarts the HTTP transaction, ignoring the last error.  This call can
  // only be made after a call to Start (or RestartIgnoringLastError) failed.
  // Once Read has been called, this method cannot be called.  This method is
  // used, for example, to continue past various SSL related errors.
  //
  // Not all errors can be ignored using this method.  See error code
  // descriptions for details about errors that can be ignored.
  //
  // NOTE: The transaction is not responsible for deleting the callback object.
  //
  virtual int RestartIgnoringLastError(CompletionOnceCallback callback) = 0;

  // Restarts the HTTP transaction with a client certificate.
  virtual int RestartWithCertificate(
      scoped_refptr<X509Certificate> client_cert,
      scoped_refptr<SSLPrivateKey> client_private_key,
      CompletionOnceCallback callback) = 0;

  // Restarts the HTTP transaction with authentication credentials.
  virtual int RestartWithAuth(const AuthCredentials& credentials,
                              CompletionOnceCallback callback) = 0;

  // Returns true if auth is ready to be continued. Callers should check
  // this value anytime Start() completes: if it is true, the transaction
  // can be resumed with RestartWithAuth(L"", L"", callback) to resume
  // the automatic auth exchange. This notification gives the caller a
  // chance to process the response headers from all of the intermediate
  // restarts needed for authentication.
  virtual bool IsReadyToRestartForAuth() = 0;

  // Once response info is available for the transaction, response data may be
  // read by calling this method.
  //
  // Response data is copied into the given buffer and the number of bytes
  // copied is returned.  ERR_IO_PENDING is returned if response data is not yet
  // available.  |callback| is notified when the data copy completes, and it is
  // passed the number of bytes that were successfully copied.  Or, if a read
  // error occurs, |callback| is notified of the error.  Any other negative
  // return value indicates that the transaction could not be read.
  //
  // NOTE: The transaction is not responsible for deleting the callback object.
  // If the operation is not completed immediately, the transaction must acquire
  // a reference to the provided buffer.
  //
  virtual int Read(IOBuffer* buf,
                   int buf_len,
                   CompletionOnceCallback callback) = 0;

  // Stops further caching of this request by the HTTP cache, if there is any.
  // Note that this is merely a hint to the transaction which it may choose to
  // ignore.
  virtual void StopCaching() = 0;

  // Get the number of bytes received from network.
  virtual int64_t GetTotalReceivedBytes() const = 0;

  // Get the number of bytes sent over the network.
  virtual int64_t GetTotalSentBytes() const = 0;

  // Called to tell the transaction that we have successfully reached the end
  // of the stream. This is equivalent to performing an extra Read() at the end
  // that should return 0 bytes. This method should not be called if the
  // transaction is busy processing a previous operation (like a pending Read).
  //
  // DoneReading may also be called before the first Read() to notify that the
  // entire response body is to be ignored (e.g., in a redirect).
  virtual void DoneReading() = 0;

  // Returns the response info for this transaction. Must not be called until
  // |Start| completes.
  virtual const HttpResponseInfo* GetResponseInfo() const = 0;

  // Returns the load state for this transaction.
  virtual LoadState GetLoadState() const = 0;

  // SetQuicServerInfo sets a object which reads and writes public information
  // about a QUIC server.
  virtual void SetQuicServerInfo(QuicServerInfo* quic_server_info) = 0;

  // Populates all of load timing, except for request start times and receive
  // headers time.
  // |load_timing_info| must have all null times when called.  Returns false and
  // does not modify |load_timing_info| if there's no timing information to
  // provide.
  virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0;

  // Gets the remote endpoint of the socket that the transaction's underlying
  // stream is using or did use, if any. Returns true and fills in |endpoint|
  // if it is available; returns false and leaves |endpoint| unchanged if it is
  // unavailable.
  virtual bool GetRemoteEndpoint(IPEndPoint* endpoint) const = 0;

  // Populates network error details for this transaction.
  virtual void PopulateNetErrorDetails(NetErrorDetails* details) const = 0;

  // Called when the priority of the parent job changes.
  virtual void SetPriority(RequestPriority priority) = 0;

  // Set the WebSocketHandshakeStreamBase::CreateHelper to be used for the
  // request.  Only relevant to WebSocket transactions. Must be called before
  // Start(). Ownership of |create_helper| remains with the caller.
  virtual void SetWebSocketHandshakeStreamCreateHelper(
      WebSocketHandshakeStreamBase::CreateHelper* create_helper) = 0;

  // Sets the callback to receive notification just before network use.
  virtual void SetBeforeNetworkStartCallback(
      BeforeNetworkStartCallback callback) = 0;

  // Sets the callback to receive a notification upon connection.
  virtual void SetConnectedCallback(const ConnectedCallback& callback) = 0;

  virtual void SetRequestHeadersCallback(RequestHeadersCallback callback) = 0;
  virtual void SetEarlyResponseHeadersCallback(
      ResponseHeadersCallback callback) = 0;
  virtual void SetResponseHeadersCallback(ResponseHeadersCallback callback) = 0;

  // Resumes the transaction after being deferred.
  virtual int ResumeNetworkStart() = 0;

  virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0;

  // Configures the transaction to close the network connection, if any, on
  // destruction. Intended for cases where keeping the socket alive may leak
  // data. Does not immediately close the socket. If multiple transactions are
  // using the same socket, only closes it once all transactions have completed.
  //
  // Does not close H2/H3 sessions, but does close H1 tunnels on top of H2/H3
  // sessions.
  //
  // Only applies to currently in-use connections. Does nothing after the last
  // byte of the response body has been read, as the connection is no longer in
  // use at that point.
  virtual void CloseConnectionOnDestruction() = 0;
};

}  // namespace net

#endif  // NET_HTTP_HTTP_TRANSACTION_H_


text:
![alt text](https://raw.githubusercontent.com/waldirbertazzijr/JSONViewer/main/JSONViewer/Assets.xcassets/AppIcon.appiconset/jv128.png?raw=true)

# JSONViewer
JSONViewer is a simple JSON formatter and viewer app for macOS.

Support parsing and structure error viewing in real time.

## Why?
I made this because I didn't want to share my JSON over the internet using common linting websites.

## Screenshot
![alt text](https://github.com/waldirbertazzijr/JSONViewer/blob/main/image.png?raw=true)