text:
package service

import (
	"context"
	"testing"

	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	utilfeature "k8s.io/apiserver/pkg/util/feature"
	"k8s.io/client-go/informers"
	clientset "k8s.io/client-go/kubernetes"
	restclient "k8s.io/client-go/rest"
	servicecontroller "k8s.io/cloud-provider/controllers/service"
	fakecloud "k8s.io/cloud-provider/fake"
	featuregatetesting "k8s.io/component-base/featuregate/testing"
	"k8s.io/kubernetes/pkg/features"
	"k8s.io/kubernetes/test/integration/framework"
	utilpointer "k8s.io/utils/pointer"
)

// Test_ServiceLoadBalancerAllocateNodePorts tests that a Service with spec.allocateLoadBalancerNodePorts=false
// does not allocate node ports for the Service.
func Test_ServiceLoadBalancerDisableAllocateNodePorts(t *testing.T) {
	defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ServiceLBNodePortControl, true)()

	controlPlaneConfig := framework.NewIntegrationTestControlPlaneConfig()
	_, server, closeFn := framework.RunAnAPIServer(controlPlaneConfig)
	defer closeFn()

	config := restclient.Config{Host: server.URL}
	client, err := clientset.NewForConfig(&config)
	if err != nil {
		t.Fatalf("Error creating clientset: %v", err)
	}

	ns := framework.CreateTestingNamespace("test-service-allocate-node-ports", server, t)
	defer framework.DeleteTestingNamespace(ns, server, t)

	service := &corev1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Name: "test-123",
		},
		Spec: corev1.ServiceSpec{
			Type:                          corev1.ServiceTypeLoadBalancer,
			AllocateLoadBalancerNodePorts: utilpointer.BoolPtr(false),
			Ports: []corev1.ServicePort{{
				Port: int32(80),
			}},
			Selector: map[string]string{
				"foo": "bar",
			},
		},
	}

	service, err = client.CoreV1().Services(ns.Name).Create(context.TODO(), service, metav1.CreateOptions{})
	if err != nil {
		t.Fatalf("Error creating test service: %v", err)
	}

	if serviceHasNodePorts(service) {
		t.Error("found node ports when none was expected")
	}
}

// Test_ServiceLoadBalancerSwitchToDeallocatedNodePorts test that switching a Service
// to spec.allocateLoadBalancerNodePorts=false, does not de-allocate existing node ports.
func Test_ServiceLoadBalancerEnableThenDisableAllocatedNodePorts(t *testing.T) {
	defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ServiceLBNodePortControl, true)()

	controlPlaneConfig := framework.NewIntegrationTestControlPlaneConfig()
	_, server, closeFn := framework.RunAnAPIServer(controlPlaneConfig)
	defer closeFn()

	config := restclient.Config{Host: server.URL}
	client, err := clientset.NewForConfig(&config)
	if err != nil {
		t.Fatalf("Error creating clientset: %v", err)
	}

	ns := framework.CreateTestingNamespace("test-service-deallocate-node-ports", server, t)
	defer framework.DeleteTestingNamespace(ns, server, t)

	service := &corev1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Name: "test-123",
		},
		Spec: corev1.ServiceSpec{
			Type:                          corev1.ServiceTypeLoadBalancer,
			AllocateLoadBalancerNodePorts: utilpointer.BoolPtr(true),
			Ports: []corev1.ServicePort{{
				Port: int32(80),
			}},
			Selector: map[string]string{
				"foo": "bar",
			},
		},
	}

	service, err = client.CoreV1().Services(ns.Name).Create(context.TODO(), service, metav1.CreateOptions{})
	if err != nil {
		t.Fatalf("Error creating test service: %v", err)
	}

	if !serviceHasNodePorts(service) {
		t.Error("expected node ports but found none")
	}

	service.Spec.AllocateLoadBalancerNodePorts = utilpointer.BoolPtr(false)
	service, err = client.CoreV1().Services(ns.Name).Update(context.TODO(), service, metav1.UpdateOptions{})
	if err != nil {
		t.Fatalf("Error updating test service: %v", err)
	}

	if !serviceHasNodePorts(service) {
		t.Error("node ports were unexpectedly deallocated")
	}
}

func serviceHasNodePorts(svc *corev1.Service) bool {
	for _, port := range svc.Spec.Ports {
		if port.NodePort > 0 {
			return true
		}
	}

	return false
}

// Test_ServiceLoadBalancerEnableLoadBalancerClass tests that when a LoadBalancer
// type of service has spec.LoadBalancerClass set, cloud provider should not create default load balancer.
func Test_ServiceLoadBalancerEnableLoadBalancerClass(t *testing.T) {
	defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ServiceLoadBalancerClass, true)()

	controlPlaneConfig := framework.NewIntegrationTestControlPlaneConfig()
	_, server, closeFn := framework.RunAnAPIServer(controlPlaneConfig)
	defer closeFn()

	config := restclient.Config{Host: server.URL}
	client, err := clientset.NewForConfig(&config)
	if err != nil {
		t.Fatalf("Error creating clientset: %v", err)
	}

	ns := framework.CreateTestingNamespace("test-service-load-balancer-class", server, t)
	defer framework.DeleteTestingNamespace(ns, server, t)

	controller, cloud, informer := newServiceController(t, client)

	stopCh := make(chan struct{})
	informer.Start(stopCh)
	go controller.Run(stopCh, 1)
	defer close(stopCh)

	service := &corev1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Name: "test-load-balancer-class",
		},
		Spec: corev1.ServiceSpec{
			Type: corev1.ServiceTypeLoadBalancer,
			Ports: []corev1.ServicePort{{
				Port: int32(80),
			}},
			LoadBalancerClass: utilpointer.StringPtr("test.com/test"),
		},
	}

	_, err = client.CoreV1().Services(ns.Name).Create(context.TODO(), service, metav1.CreateOptions{})
	if err != nil {
		t.Fatalf("Error creating test service: %v", err)
	}

	if len(cloud.Calls) > 0 {
		t.Errorf("Unexpected cloud provider calls: %v", cloud.Calls)
	}
}

// Test_ServiceLoadBalancerEnableLoadBalancerClassThenUpdateLoadBalancerClass tests that when a LoadBalancer
// type of service has spec.LoadBalancerClass set, it should be immutable as long as the service type
// is still LoadBalancer.
func Test_ServiceLoadBalancerEnableLoadBalancerClassThenUpdateLoadBalancerClass(t *testing.T) {
	defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ServiceLoadBalancerClass, true)()

	controlPlaneConfig := framework.NewIntegrationTestControlPlaneConfig()
	_, server, closeFn := framework.RunAnAPIServer(controlPlaneConfig)
	defer closeFn()

	config := restclient.Config{Host: server.URL}
	client, err := clientset.NewForConfig(&config)
	if err != nil {
		t.Fatalf("Error creating clientset: %v", err)
	}

	ns := framework.CreateTestingNamespace("test-service-immutable-load-balancer-class", server, t)
	defer framework.DeleteTestingNamespace(ns, server, t)

	controller, cloud, informer := newServiceController(t, client)

	stopCh := make(chan struct{})
	informer.Start(stopCh)
	go controller.Run(stopCh, 1)
	defer close(stopCh)

	service := &corev1.Service{
		ObjectMeta: metav1.ObjectMeta{
			Name: "test-load-balancer-class",
		},
		Spec: corev1.ServiceSpec{
			Type: corev1.ServiceTypeLoadBalancer,
			Ports: []corev1.ServicePort{{
				Port: int32(80),
			}},
			LoadBalancerClass: utilpointer.StringPtr("test.com/test"),
		},
	}

	service, err = client.CoreV1().Services(ns.Name).Create(context.TODO(), service, metav1.CreateOptions{})
	if err != nil {
		t.Fatalf("Error creating test service: %v", err)
	}

	if len(cloud.Calls) > 0 {
		t.Errorf("Unexpected cloud provider calls: %v", cloud.Calls)
	}

	service.Spec.LoadBalancerClass = utilpointer.StringPtr("test.com/update")
	_, err = client.CoreV1().Services(ns.Name).Update(context.TODO(), service, metav1.UpdateOptions{})
	if err == nil {
		t.Fatal("Error updating test service load balancer class should throw error")
	}

	if len(cloud.Calls) > 0 {
		t.Errorf("Unexpected cloud provider calls: %v", cloud.Calls)
	}
}

func newServiceController(t *testing.T, client *clientset.Clientset) (*servicecontroller.Controller, *fakecloud.Cloud, informers.SharedInformerFactory) {
	cloud := &fakecloud.Cloud{}
	informerFactory := informers.NewSharedInformerFactory(client, 0)
	serviceInformer := informerFactory.Core().V1().Services()
	nodeInformer := informerFactory.Core().V1().Nodes()

	controller, err := servicecontroller.New(cloud,
		client,
		serviceInformer,
		nodeInformer,
		"test-cluster",
		utilfeature.DefaultFeatureGate)
	if err != nil {
		t.Fatalf("Error creating service controller: %v", err)
	}
	cloud.Calls = nil // ignore any cloud calls made in init()
	return controller, cloud, informerFactory
}


text:
This repository contains the external dependencies needed to build full
asynchronous, networking and video support for the simh simulators on Windows.

It contains five separate packages which the windows simh build depends on:
    The WinPcap developer Pack
    Posix threads for Windows
    Simple DirectMedia Layer
    Simple DirectMedia Layer True Type Fonts
    Perl Compatible Regular Expressions

The Visual Studio Projects in the simh source tree presume that
The directory containing this file should be located parallel to the
directory containing the simh source code.  The makefile which can
be used by MinGW compiler also presumes the same directory structure.

For Example, the directory structure should look like:

    .../simh/simhv38-2-rc1/VAX/vax_cpu.c
    .../simh/simhv38-2-rc1/scp.c
    .../simh/simhv38-2-rc1/Visual Studio Projects/simh.sln
    .../simh/simhv38-2-rc1/Visual Studio Projects/VAX.vcproj
    .../simh/simhv38-2-rc1/BIN/Nt/Win32-Release/vax.exe
    .../simh/windows-build/pthreads/pthread.h
    .../simh/windows-build/winpcap/WpdPack/Include/pcap.h
    .../simh/windows-build/libSDL/SDL-2.0.3/include/SDL.h
    .../simh/windows-build/PCRE/include/pcreposix.h

The ../simh/windows-build/winpcap directory contains Version 4.1.2 of
the winpcap developer pack from:

       http://www.winpcap.org/devel.htm

The ../simh/windows-build/pthreads directory contains the source to the
next release of the pthreads-win32 Posix Threads package for the windows
platform.

The ../simh/windows-build/libSDL directory contains the source to version
2.0.3 of libSDL2.  This source has been modified from the code in the zip
file: http://www.libsdl.org/release/SDL2-2.0.3.zip.  The modifications
produce SDL libraries which can be statically linked into simh simulator
binaries when building with the Microsoft Visual Studio compilers.  These
binaries will then run without external DLL dependencies.  The MinGW link
libraries are also provided.  These have been extracted from:
http://www.libsdl.org/release/SDL2-devel-2.0.3-mingw.tar.gz along with
the SDL2.dll file which is required when running a simulator with video
support if it is compiled with the MinGW gcc compiler.

The SDL True Type Font support is also modified to produce a static library
with the original source from:
https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.12.zip

The ../simh/windows-build/PCRE directory contains the source to PCRE version
8.36 the Perl Compatible Regular Expression library.

redpajama_set_name: RedPajamaGithub


text:
package jriot.objects;

import java.util.ArrayList;

public class RunePages {

    private ArrayList<RunePage> pages;
    private long summonerId;

    public ArrayList<RunePage> getPages() {
        return pages;
    }

    public void setPages(ArrayList<RunePage> pages) {
        this.pages = pages;
    }

    public long getSummonerId() {
        return summonerId;
    }

    public void setSummonerId(long summonerId) {
        this.summonerId = summonerId;
    }

    @Override
    public String toString() {
        return "RunePages [pages=" + pages + ", summonerId=" + summonerId + "]";
    }

}


text:
package com.ibm.si.jaql.logging;

public class Logger
{
	public void info(final String info)
	{

	}
}


text:
import literal from 'ember-macro-helpers/literal';
import { module, test } from 'qunit';
import { compute } from 'ember-macro-helpers/test-support';

module('Integration | literal', function() {
  test('it returns value verbatim', function(assert) {
    compute({
      assert,
      computed: literal('source'),
      strictEqual: 'source'
    });
  });

  test('it doesn\'t treat it as a key, but as a string literal', function(assert) {
    compute({
      assert,
      computed: literal('source'),
      properties: {
        source: 'new source'
      },
      strictEqual: 'source'
    });
  });

  test('it is readOnly', function(assert) {
    compute({
      assert,
      computed: literal('source'),
      assertReadOnly: true
    });
  });
});


text:
<?xml version="1.0" encoding="utf-8"?>

<resources>
  <string name="preference_category_location">ځای</string>
  <string name="app_name">ويکي خونديځ</string>
  <string name="bullet">•</string>
  <string name="menu_settings">امستنې</string>
  <string name="username">کارن-نوم</string>
  <string name="password">پټنوم</string>
  <string name="login">ننوتل</string>
  <string name="signup">نومليکنه</string>
  <string name="logging_in_title">په ننوتلو کې دی</string>
  <string name="logging_in_message">لطفاً تم شۍ …</string>
  <string name="login_success">غونډال کې بريالی ورننوتلۍ!</string>
  <string name="login_failed">غونډال کې ننوتنه نابريالې شوه!</string>
  <string name="upload_failed">دوتنه و نه موندل شوه. لطفاً د يوې بلې دوتنې د موندلو هڅه وکړئ.</string>
  <string name="uploading_started">پورته کېدنه پيل شوه!</string>
  <string name="upload_completed_notification_title">%1$s پورته شوی!</string>
  <string name="upload_progress_notification_title_in_progress">د %1$s پورته کول</string>
  <string name="title_activity_contributions">زما تازه پورته کېدنې</string>
  <string name="contribution_state_queued">لږ</string>
  <string name="contribution_state_failed">نابريال شو</string>
  <string name="contribution_state_in_progress">%1$d%% بشپړ</string>
  <string name="contribution_state_starting">د برسېرېدلو په حال کې…</string>
  <string name="menu_from_gallery">له انځورتون څخه</string>
  <string name="menu_from_camera">انځور اخيستل</string>
  <string name="menu_nearby">نژدې</string>
  <string name="provider_contributions">زما پورته کېدنې</string>
  <string name="menu_share">شريکول</string>
  <string name="menu_open_in_browser">په کتنمل کې کتل</string>
  <string name="share_title_hint">سرليک</string>
  <string name="add_title_toast">مهرباني وکړئ د دې دوتنې لپاره سرلیک چمتو کړئ</string>
  <string name="share_description_hint">څرگندونه</string>
  <string name="login_failed_network">د ننوتلو توان نلري - د شبکې ناکامي</string>
  <string name="login_failed_throttled">ډیری ناکامه هڅې. لطفا څو دقیقې وروسته بیا هڅه وکړئ.</string>
  <string name="login_failed_blocked">بخښنه غواړو، په دي کارن د کامنز لخوا بنديز ولګول شو</string>
  <string name="login_failed_generic">غونډال کې ننوتنه نابريالې شوه</string>
  <string name="share_upload_button">پورته کول</string>
  <string name="provider_modifications">بدلونونه</string>
  <string name="menu_upload_single">پورته کول</string>
  <string name="categories_search_text_hint">وېشنيزې پلټل</string>
  <string name="menu_save_categories">خوندي کول</string>
  <string name="refresh_button">بياتازه کول</string>
  <plurals name="multiple_uploads_title" fuzzy="true">
    <item quantity="one">1 پورته کول</item>
    <item quantity="other">%1$d پورته کول</item>
  </plurals>
  <string name="categories_activity_title">وېشنيزې</string>
  <string name="title_activity_settings">امستنې</string>
  <string name="title_activity_signup">نومليکنه</string>
  <string name="menu_about">په اړه</string>
  <string name="about_privacy_policy" fuzzy="true">د پټنتيا تگلاره</string>
  <string name="title_activity_about">په اړه</string>
  <string name="provider_categories">وروستۍ کارېدلې وېشنيزې</string>
  <string name="no_uploads_yet">تاسې تر اوسه کوم انځور نه دی پورته کړی.</string>
  <string name="menu_retry_upload">بياآزمويل</string>
  <string name="menu_cancel_upload">ناگارل</string>
  <string name="share_license_summary">دا انځور به د %1$s په منښتليک سمبال وي.</string>
  <string name="menu_download">ښکته کول</string>
  <string name="preference_license">تلواليز منښتليک</string>
  <string name="preference_theme">د شپې بڼه</string>
  <string name="preference_theme_summary">تیارې والا موضوع وکاروئ</string>
  <string name="license_name_cc_by_sa_3_0_at">CC BY-SA 3.0 (اتريش)</string>
  <string name="license_name_cc_by_sa_3_0_de">CC BY-SA 3.0 (جرمني)</string>
  <string name="license_name_cc_by_sa_3_0_ee">CC BY-SA 3.0 (اېسټونيا)</string>
  <string name="license_name_cc_by_sa_3_0_es">CC BY-SA 3.0 (سپانيا)</string>
  <string name="license_name_cc_by_sa_3_0_hr">CC BY-SA 3.0 (کرواسيا)</string>
  <string name="license_name_cc_by_sa_3_0_lu">CC BY-SA 3.0 (لوکسزمبورگ)</string>
  <string name="license_name_cc_by_sa_3_0_nl">CC BY-SA 3.0 (نېدرلند)</string>
  <string name="license_name_cc_by_sa_3_0_no">CC BY-SA 3.0 (ناروې)</string>
  <string name="license_name_cc_by_sa_3_0_pl">CC BY-SA 3.0 (پولند)</string>
  <string name="license_name_cc_by_sa_3_0_ro">CC BY-SA 3.0 (رومانيا)</string>
  <string name="license_name_cc_by_3_0">CC BY 3.0</string>
  <string name="license_name_cc_zero">CC صفر</string>
  <string name="welcome_final_button_text">هو</string>
  <string name="detail_panel_cats_label">وېشنيزې</string>
  <string name="detail_panel_cats_loading">رابرسېرېږي...</string>
  <string name="detail_panel_cats_none">هېڅ هم نه دی ټاکل شوی</string>
  <string name="detail_description_empty">څرگندونه نشته</string>
  <string name="detail_license_empty">نامعلوم جواز</string>
  <string name="menu_refresh">تازه کول</string>
  <string name="ok">ښه</string>
  <string name="title_activity_nearby">نږدې ځایونه</string>
  <string name="no_nearby">نږدې ځایونه ونه موندل شول</string>
  <string name="warning">گواښنه</string>
  <string name="yes">هو</string>
  <string name="no">نه</string>
  <string name="media_detail_title">سرليک</string>
  <string name="media_detail_description">څرگندونه</string>
  <string name="media_detail_coordinates">کورډيناټونه</string>
  <string name="welcome_image_welcome_wikipedia">ويکيپېډياښه راغلئ</string>
  <string name="cancel">ناگارل</string>
  <string name="navigation_drawer_open">پرانيستل</string>
  <string name="navigation_drawer_close">تړل</string>
  <string name="navigation_item_home">کور</string>
  <string name="navigation_item_upload">پورته کول</string>
  <string name="navigation_item_nearby">نژدې</string>
  <string name="navigation_item_about">په اړه</string>
  <string name="navigation_item_settings">امستنې</string>
  <string name="navigation_item_feedback">غبرگون</string>
  <string name="navigation_item_logout">وتل</string>
</resources>


text:
package apoc;

import org.neo4j.helpers.collection.MapUtil;

import java.util.Map;

public class AsyncIndexingGraphDatabaseState extends SyncIndexingGraphDatabaseState {

    @Override
    public Map<String, String> getGraphDatabaseConfig() {
        return MapUtil.genericMap("apoc.autoIndex.enabled", "true",
                "apoc.autoIndex.async", "true",
                "apoc.autoIndex.configUpdateInterval", "-1");
    }

}


text:
When enabled, files will be compressed with GZIP and "Content-Encoding" header
will be set to "gzip".


text:
namespace MFXVC1DecCommon
{
    // need for dword alignment memory
    inline mfxU32    GetDWord_s(mfxU8* pData) { return ((*(pData+3))<<24) + ((*(pData+2))<<16) + ((*(pData+1))<<8) + *(pData);}

    // we sure about our types
    template <class T, class T1>
    static T bit_set(T value, uint32_t offset, uint32_t count, T1 in)
    {
        return (T)(value | (((1<<count) - 1)&in) << offset);
    };

    mfxStatus ConvertMfxToCodecParams(mfxVideoParam *par, UMC::BaseCodecParams* pVideoParams);
    mfxStatus ParseSeqHeader(mfxBitstream *bs, mfxVideoParam *par, mfxExtVideoSignalInfo *pVideoSignal, mfxExtCodingOptionSPSPPS *pSPS);
    mfxStatus PrepareSeqHeader(mfxBitstream *bs_in, mfxBitstream *bs_out);

    mfxStatus Query(VideoCORE* core, mfxVideoParam *in, mfxVideoParam *out);
}

#endif
#endif


text:
'use strict';

var isNumber = require('is-number');

module.exports = function(arr, a, b) {
  if (!Array.isArray(arr)) {
    throw new TypeError('expected an array');
  }

  var idxa = isNumber(a) ? a : arr.indexOf(a);
  var idxb = isNumber(b) ? b : arr.indexOf(b);
  var vala = arr[idxa];
  var valb = arr[idxb];
  arr[idxa] = valb;
  arr[idxb] = vala;
  return arr;
};


text:
package org.apereo.portal.io.xml.layout;

import java.util.Arrays;
import java.util.List;
import javax.xml.namespace.QName;
import org.apereo.portal.io.xml.AbstractPortalDataType;
import org.apereo.portal.io.xml.PortalDataKey;

/** Describes a fragment owner's layout in the portal */
public class FragmentLayoutPortalDataType extends AbstractPortalDataType {
    public static final QName LEGACY_LAYOUT_QNAME = new QName("fragment-layout");

    public static final PortalDataKey IMPORT_32_DATA_KEY =
            new PortalDataKey(
                    LEGACY_LAYOUT_QNAME,
                    "classpath://org/jasig/portal/io/import-layout_v3-2.crn",
                    null);

    /** @deprecated used for importing old data files */
    @Deprecated
    public static final PortalDataKey IMPORT_30_DATA_KEY =
            new PortalDataKey(
                    LEGACY_LAYOUT_QNAME,
                    "classpath://org/jasig/portal/io/import-layout_v3-0.crn",
                    null);

    /** @deprecated used for importing old data files */
    @Deprecated
    public static final PortalDataKey IMPORT_26_DATA_KEY =
            new PortalDataKey(
                    LEGACY_LAYOUT_QNAME,
                    "classpath://org/jasig/portal/io/import-layout_v2-6.crn",
                    null);

    private static final List<PortalDataKey> PORTAL_DATA_KEYS =
            Arrays.asList(IMPORT_26_DATA_KEY, IMPORT_30_DATA_KEY, IMPORT_32_DATA_KEY);

    public FragmentLayoutPortalDataType() {
        super(LEGACY_LAYOUT_QNAME);
    }

    @Override
    public List<PortalDataKey> getDataKeyImportOrder() {
        return PORTAL_DATA_KEYS;
    }

    @Override
    public String getTitleCode() {
        return "Fragment Layout";
    }

    @Override
    public String getDescriptionCode() {
        return "Fragment Owner Layout";
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Threading;
using System.Windows;
using System.Windows.Threading;
using EnvDTE;
using Microsoft.VisualStudio.ComponentModelHost;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Threading;
using Task = System.Threading.Tasks.Task;

namespace Microsoft.VisualStudio.IntegrationTest.Utilities.InProcess
{
    /// <summary>
    /// Base class for all components that run inside of the Visual Studio process.
    /// <list type="bullet">
    /// <item>Every in-proc component should provide a public, static, parameterless "Create" method.
    /// This will be called to construct the component in the VS process.</item>
    /// <item>Public methods on in-proc components should be instance methods to ensure that they are
    /// marshalled properly and execute in the VS process. Static methods will execute in the process
    /// in which they are called.</item>
    /// </list>
    /// </summary>
    internal abstract class InProcComponent : MarshalByRefObject
    {
        private static JoinableTaskFactory _joinableTaskFactory;

        protected InProcComponent() { }

        private static Dispatcher CurrentApplicationDispatcher
            => Application.Current.Dispatcher;

        protected static JoinableTaskFactory JoinableTaskFactory
        {
            get
            {
                if (_joinableTaskFactory is null)
                {
                    Interlocked.CompareExchange(ref _joinableTaskFactory, ThreadHelper.JoinableTaskFactory.WithPriority(CurrentApplicationDispatcher, DispatcherPriority.Background), null);
                }

                return _joinableTaskFactory;
            }
        }

        protected static void InvokeOnUIThread(Action<CancellationToken> action)
        {
            using var cancellationTokenSource = new CancellationTokenSource(Helper.HangMitigatingTimeout);
            var operation = JoinableTaskFactory.RunAsync(async () =>
            {
                await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationTokenSource.Token);

                action(cancellationTokenSource.Token);
            });

            operation.Task.Wait(cancellationTokenSource.Token);
        }

        protected static T InvokeOnUIThread<T>(Func<CancellationToken, T> action)
        {
            using var cancellationTokenSource = new CancellationTokenSource(Helper.HangMitigatingTimeout);
            var operation = JoinableTaskFactory.RunAsync(async () =>
            {
                await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationTokenSource.Token);

                return action(cancellationTokenSource.Token);
            });

            operation.Task.Wait(cancellationTokenSource.Token);
            return operation.Task.Result;
        }

        protected static TInterface GetGlobalService<TService, TInterface>()
            where TService : class
            where TInterface : class
        => InvokeOnUIThread(cancellationToken => (TInterface)ServiceProvider.GlobalProvider.GetService(typeof(TService)));

        protected static TService GetComponentModelService<TService>()
            where TService : class
         => InvokeOnUIThread(cancellationToken => GetComponentModel().GetService<TService>());

        protected static DTE GetDTE()
            => GetGlobalService<SDTE, DTE>();

        protected static IComponentModel GetComponentModel()
            => GetGlobalService<SComponentModel, IComponentModel>();

        protected static bool IsCommandAvailable(string commandName)
            => GetDTE().Commands.Item(commandName).IsAvailable;

        protected static void ExecuteCommand(string commandName, string args = "")
        {
            var task = Task.Run(() => GetDTE().ExecuteCommand(commandName, args));
            task.Wait(Helper.HangMitigatingTimeout);
        }

        /// <summary>
        /// Waiting for the application to 'idle' means that it is done pumping messages (including WM_PAINT).
        /// </summary>
        protected static void WaitForApplicationIdle(TimeSpan timeout)
#pragma warning disable VSTHRD001 // Avoid legacy thread switching APIs
            => CurrentApplicationDispatcher.InvokeAsync(() => { }, DispatcherPriority.ApplicationIdle).Wait(timeout);
#pragma warning restore VSTHRD001 // Avoid legacy thread switching APIs

        protected static void WaitForSystemIdle()
#pragma warning disable VSTHRD001 // Avoid legacy thread switching APIs
            => CurrentApplicationDispatcher.Invoke(() => { }, DispatcherPriority.SystemIdle);
#pragma warning restore VSTHRD001 // Avoid legacy thread switching APIs

        // Ensure InProcComponents live forever
        public override object InitializeLifetimeService() => null;
    }
}


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
  Schema = mongoose.Schema;

/**
 * Transaction Schema
 */
var TransactionSchema = new Schema({
  trDate: {
    type: Date,
    default: Date.now,
    required: 'Please fill transaction date'
  },
  accountFrom: {
    type: Schema.ObjectId,
    ref: 'Account',
    required: 'Please fill account from'
  },
  accountFromGroupItem: {
    type: Schema.ObjectId,
    ref: 'Account'
  },
  accountTo: {
    type: Schema.ObjectId,
    ref: 'Account',
    required: 'Please fill account to'
  },
  amount: {
    type: Number,
    required: 'Please fill amount'
  },
  remarks: {
    type: String
  },
  created: {
    type: Date,
    default: Date.now
  },
  user: {
    type: Schema.ObjectId,
    ref: 'User'
  }
});

mongoose.model('Transaction', TransactionSchema);


text:
=pod

Reading from multiple sockets

This version uses zmq_poll()

Author: Alexander D'Archangel (darksuji) <darksuji(at)gmail(dot)com>

=cut

use strict;
use warnings;
use 5.10.0;

use ZeroMQ qw/:all/;

my $context = ZeroMQ::Context->new();

# Connect to task ventilator
my $receiver = $context->socket(ZMQ_PULL);
$receiver->connect('tcp://localhost:5557');

# Connect to weather server
my $subscriber = $context->socket(ZMQ_SUB);
$subscriber->connect('tcp://localhost:5556');
$subscriber->setsockopt(ZMQ_SUBSCRIBE, '10001 ');

# Initialize poll set
my $poller = ZeroMQ::Poller->new(
    {
        name    => 'receiver',
        socket  => $receiver,
        events  => ZMQ_POLLIN,
    }, {
        name    => 'subscriber',
        socket  => $subscriber,
        events  => ZMQ_POLLIN,
    },
);
# Process messages from both sockets
while (1) {
    $poller->poll();
    if ($poller->has_event('receiver')) {
        my $message = $receiver->recv();
        # Process task
    }
    if ($poller->has_event('subscriber')) {
        my $message = $subscriber->recv();
        # Process weather update
    }
}
# We never get here


text:
package org.commoncrawl.async;

import java.io.IOException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.util.StringUtils;
import org.commoncrawl.async.Callbacks.Callback;
import org.commoncrawl.async.Callbacks.CallbackWithResult;
import org.commoncrawl.io.internal.NIODNSLocalResolver;
import org.commoncrawl.io.internal.NIOSocketSelector;

public class EventLoop implements Runnable {

	/** logging **/
	private static final Log LOG = LogFactory.getLog(EventLoop.class);

	ExecutorService _resolverThreadPool = null;
	boolean _ownsResolverThreadPool = false;
	NIODNSLocalResolver _resolver;
	NIOSocketSelector _selector;
	Thread _eventThread;
	TimerRegistry _timerRegistry = new TimerRegistry(this);
	boolean _shutdown = false;
	long _loopCount = 0;

	NIOSocketSelector.TimeUsageDetail _selectorTimeUsage = new NIOSocketSelector.TimeUsageDetail();

	public EventLoop() throws IOException {
		init(null);
		// stop the async client manager thread (we are managing sockets ourselves)
		//super.stop();
	}

	public EventLoop(ExecutorService resolverThreadPool) throws IOException {
		init(resolverThreadPool);
		// stop the async client manager thread (we are managing sockets ourselves)
		//super.stop();
	}

	private void init(ExecutorService resolverThreadPool) {
		try {
			_selector = new NIOSocketSelector(this);
			_resolverThreadPool = resolverThreadPool;

		} catch (IOException e) {
			LOG.fatal("Unable to initialize NIO Selector");
			throw new RuntimeException("Unable to initialize NIO Selector");
		}

	}

	public NIOSocketSelector getSelector() {
		return _selector;
	}

	public NIODNSLocalResolver getResolver() {
		if (_resolver == null) {
			if (_resolverThreadPool == null) {
				_resolverThreadPool = Executors.newFixedThreadPool(1);
				_ownsResolverThreadPool = true;
			}
			_resolver = new NIODNSLocalResolver(this, _resolverThreadPool, true);
		}
		return _resolver;
	}

	public void start() {
		if (_eventThread != null) {
			LOG.fatal("Invalid Call State");
			throw new RuntimeException("Invalid Call State");
		}

		_shutdown = false;
		_eventThread = new Thread(this);
		_eventThread.start();
	}

	//@Override
	public void stop() {
		if (_eventThread == null) {
			throw new RuntimeException("Invalid Call State");
		}
		// set shutdown flag ...
		_shutdown = true;

		// and wakeup the socket selector ...
		try {
			_selector.wakeup();
		} catch (IOException e) {
			LOG.fatal("IOException encountered in Selector.wakeup!");
			throw new RuntimeException(e);
		}

		// if NOT called from event thread itself, wait for event thread to die ...
		if (Thread.currentThread() != _eventThread) {
			try {
				LOG.info("Waiting for Event Thread to DIE TID:" + Thread.currentThread().getId());
				_eventThread.join();
				_eventThread = null;
				LOG.info("Event Thread DEAD. Exiting EventLoop TID:" + Thread.currentThread().getId());
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

		if (_ownsResolverThreadPool) {
			_resolverThreadPool.shutdown();
			_resolverThreadPool = null;
		}
		_resolver = null;
	}

	//@Override
	public boolean isRunning() {
		return (_eventThread != null && _eventThread.isAlive());
	}

	/*
	@SuppressWarnings("unchecked")
	@Override
	public void call(TAsyncMethodCall method) throws org.apache.thrift.TException {
	  if (!isRunning()) {
	    throw new TException("SelectThread is not running");
	  }
	  _selector.call(method);
	}
	*/

	public void wakeup() {

		if (_selector != null) {
			try {
				_selector.wakeup();
			} catch (IOException e) {
				LOG.fatal("IOException encountered in Selector.wakeup!");
				throw new RuntimeException(e);
			}
		}
	}

	public Thread getEventThread() {
		return _eventThread;
	}

	public boolean waitForIO(long waitTime) throws IOException {

		long timeStart = System.currentTimeMillis();
		long timeEnd = timeStart + waitTime;

		while (!_shutdown) {

			long nextFireTime = _timerRegistry.fireTimers();

			waitTime = timeEnd - System.currentTimeMillis();

			if (waitTime > 0) {
				if (nextFireTime != 0) {
					waitTime = Math.max(1, Math.min(nextFireTime - System.currentTimeMillis(), waitTime));
				}

				if (_selector.poll(waitTime, _selectorTimeUsage) != 0) {
					return false;
				}
			} else {
				break;
			}
		}
		return true;
	}

	public void run() {

		try {
			while (!_shutdown) {

				long waitTime = Long.MAX_VALUE;
				long nextFireTime = _timerRegistry.fireTimers();

				if (nextFireTime != 0) {
					waitTime = Math.max(1, nextFireTime - System.currentTimeMillis());
				}

				try {
					// long timeStart = System.currentTimeMillis();
					if (_resolver != null) {
						_resolver.poll();
					}
					// long timeEnd = System.currentTimeMillis();

					// timeStart = System.currentTimeMillis();
					_selector.poll(waitTime, _selectorTimeUsage);
					// timeEnd = System.currentTimeMillis();

					/**
					 * if (++_loopCount % 100 == 0) JVMStats.dumpMemoryStats();
					 **/
				} catch (IOException e) {
					LOG.error(StringUtils.stringifyException(e));
					e.printStackTrace();
				}
			}
		} catch (Exception e) {
			LOG.fatal("Unhandled Exception in Event Loop:" + StringUtils.stringifyException(e));
			System.out.println("Unhandled Exception in Event Loop:" + StringUtils.stringifyException(e));
		}
		LOG.info("Event Loop Existing Run Loop");
	}

	public void setTimer(Timer t) {
		_timerRegistry.setTimer(t);
	}

	public void cancelTimer(Timer t) {
		_timerRegistry.cancelTimer(t);
	}

	public void queueAsyncRunnable(final Runnable runnable) {
		setTimer(new Timer(0, false, new Timer.Callback() {

			@Override
			public void timerFired(Timer timer) {
				runnable.run();
			}

		}));
	}

	public void queueAsyncCallback(final Callback callback) {
		setTimer(new Timer(0, false, new Timer.Callback() {

			@Override
			public void timerFired(Timer timer) {
				callback.execute();
			}

		}));
	}

	public <ResultType> void queueAsyncCallbackWithResult(final CallbackWithResult<ResultType> callback,
			final ResultType result) {
		setTimer(new Timer(0, false, new Timer.Callback() {

			@Override
			public void timerFired(Timer timer) {
				callback.execute(result);
			}

		}));
	}

}


text:
package org.jasig.portlet.calendar.mvc;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.commons.collections.map.LazyMap;
import org.jasig.portlet.form.attribute.Attribute;
import org.jasig.portlet.form.attribute.AttributeFactory;

public class CalendarDefinitionForm {

  private Long id = new Long(-1);

  private String className;

  private String name;

  private String fname;

  private Set<String> role = new HashSet<String>();

  @SuppressWarnings("unchecked")
  private Map<String, Attribute> parameters =
      LazyMap.decorate(new HashMap<String, Attribute>(), new AttributeFactory());

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getClassName() {
    return className;
  }

  public void setClassName(String className) {
    this.className = className;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getFname() {
    return fname;
  }

  public void setFname(String fname) {
    this.fname = fname;
  }

  public Set<String> getRole() {
    return role;
  }

  public void setRole(Set<String> role) {
    this.role = role;
  }

  public void addParameter(String name, String value) {
    this.parameters.put(name, new Attribute(value));
  }

  public void addParameters(Map<String, String> map) {
    Set<Entry<String, String>> entries = map.entrySet();
    for (Entry<String, String> entry : entries) {
      this.parameters.put(entry.getKey(), new Attribute(entry.getValue()));
    }
  }

  public Map<String, Attribute> getParameters() {
    return this.parameters;
  }
}


text:
package boundaryh

// Returns class of last rune in s which is not equal to l0.
func gLastNotEqualToInString(s string, l0 gClass) gClass {
	for len(s) > 0 {
		c, pos := gLastClassInString(s)
		if c != l0 {
			return c
		}
		s = s[:pos]
	}

	return gClassOther
}

// True if l0 is RI and it opens RI sequence in string <s..., l0, ...> (may be joined with next RI).
func gIsOpenRIInString(s string, l0 gClass) (res bool) {
	if l0 != gClassRI {
		return
	}
	res = true

	for len(s) > 0 {
		c, pos := gLastClassInString(s)
		if c != gClassRI {
			return
		}
		res = !res
		s = s[:pos]
	}

	return
}

// s must be valid (len>1).
// l0Pos must be valid (in s).
func graphemeClusterEndInString(s string, l0Pos int) int {
	l := len(s)

	if l0Pos+1 < l && s[l0Pos] == crRune && s[l0Pos+1] == lfRune { // GB3
		return l0Pos + 2
	}

	l0Pos = toRuneBeginInString(s, l0Pos) // TODO do it only on external call
	l0, r0Delta := gFirstClassInString(s[l0Pos:])
	l1Diff := gLastNotEqualToInString(s[:l0Pos], l0)
	lOddRI := gIsOpenRIInString(s[:l0Pos], l0)

	for l0Pos+r0Delta < l {
		r0, r1Delta := gFirstClassInString(s[l0Pos+r0Delta:])
		if gDecision(l1Diff, l0, lOddRI, r0) {
			return l0Pos + r0Delta
		}
		if l0 != r0 {
			l1Diff = l0
		}
		l0 = r0
		lOddRI = l0 == gClassRI && !lOddRI
		l0Pos += r0Delta
		r0Delta = r1Delta
	}
	return l
}

// GraphemeClusterEndInString computes grapheme cluster which contains pos-th rune.
// Returns (index of grapheme cluster's last rune)+1.
// In other words, returns first grapheme cluster's boundary on the right of pos-th rune.
func GraphemeClusterEndInString(s string, pos int) int {
	l := len(s)
	if pos < 0 || pos >= l {
		return InvalidPos
	}
	if pos == l-1 {
		return l
	}

	return graphemeClusterEndInString(s, pos)
}

// s must be valid (len>1).
// r0Pos must be valid (in s).
func graphemeClusterBeginInString(s string, r0Pos int) int {
	if r0Pos >= 1 && s[r0Pos-1] == crRune && s[r0Pos] == lfRune { // GB3
		return r0Pos - 1
	}

	r0Pos = toRuneBeginInString(s, r0Pos) // TODO do it only on external call
	r0, _ := gFirstClassInString(s[r0Pos:])

	for r0Pos > 0 {
		l0, l0Pos := gLastClassInString(s[:r0Pos])
		l1Diff := gLastNotEqualToInString(s[:l0Pos], l0)
		lOddRI := gIsOpenRIInString(s[:l0Pos], l0)

		if gDecision(l1Diff, l0, lOddRI, r0) {
			return r0Pos
		}

		r0 = l0
		r0Pos = l0Pos
	}
	return 0
}

// GraphemeClusterBeginInString computes grapheme cluster which contains pos-th rune.
// Returns grapheme cluster's first rune index.
// In other words, returns first grapheme cluster's boundary on the left of pos-th rune.
func GraphemeClusterBeginInString(s string, pos int) int {
	l := len(s)
	if pos < 0 || pos >= l {
		return InvalidPos
	}
	if pos == 0 {
		return 0
	}

	return graphemeClusterBeginInString(s, pos)
}

// GraphemeClusterAtInString computes grapheme clusters which contains pos-th rune and return their boundary.
// Grapheme cluster may retrieved by "s[r.From:r.To]".
func GraphemeClusterAtInString(s string, pos int) Boundary {
	return Boundary{GraphemeClusterBeginInString(s, pos), GraphemeClusterEndInString(s, pos)}
}

// FirstGraphemeClusterInString computes first grapheme cluster.
// Returns (index of cluster's last rune)+1.
// Result also may be treated as length of the first grapheme cluster.
// First grapheme cluster may retrieved by "s[:r]".
func FirstGraphemeClusterInString(s string) (r int) {
	return GraphemeClusterEndInString(s, 0)
}

// LastGraphemeClusterInString computes last grapheme cluster.
// Returns index of cluster's first rune.
// Last grapheme cluster may retrieved by "s[r:]".
func LastGraphemeClusterInString(s string) (r int) {
	return GraphemeClusterBeginInString(s, len(s)-1)
}

// GraphemeClustersInString computes all grapheme clusters and returns theirs boundaries.
func GraphemeClustersInString(s string) (boundaries []Boundary) {
	boundaries = make([]Boundary, 0, len(s)) // TODO memory efficient
	for i := 0; i < len(s); {
		length := FirstGraphemeClusterInString(s[i:])
		boundaries = append(boundaries, Boundary{i, i + length})
		i += length
	}
	return
}

// GraphemeClusterBreaksInString computes all grapheme clusters and returns all breaks.
func GraphemeClusterBreaksInString(s string) (breaks []int) {
	l := len(s)
	if l == 0 {
		return // []int{0}
	}
	breaks = make([]int, 1, len(s)) // TODO memory efficient
	breaks[0] = 0
	for pos := 0; pos < l; {
		length := FirstGraphemeClusterInString(s[pos:])
		pos += length
		breaks = append(breaks, pos)
	}
	return
}

// Returns class of last rune in bytes which is not equal to l0.
func gLastNotEqualTo(bytes []byte, l0 gClass) gClass {
	for len(bytes) > 0 {
		c, pos := gLastClass(bytes)
		if c != l0 {
			return c
		}
		bytes = bytes[:pos]
	}

	return gClassOther
}

// True if l0 is RI and it opens RI sequence in string <bytes..., l0, ...> (may be joined with next RI).
func gIsOpenRI(bytes []byte, l0 gClass) (res bool) {
	if l0 != gClassRI {
		return
	}
	res = true

	for len(bytes) > 0 {
		c, pos := gLastClass(bytes)
		if c != gClassRI {
			return
		}
		res = !res
		bytes = bytes[:pos]
	}

	return
}

// bytes must be valid (len>1).
// l0Pos must be valid (in bytes).
func graphemeClusterEnd(bytes []byte, l0Pos int) int {
	l := len(bytes)

	if l0Pos+1 < l && bytes[l0Pos] == crRune && bytes[l0Pos+1] == lfRune { // GB3
		return l0Pos + 2
	}

	l0Pos = toRuneBegin(bytes, l0Pos) // TODO do it only on external call
	l0, r0Delta := gFirstClass(bytes[l0Pos:])
	l1Diff := gLastNotEqualTo(bytes[:l0Pos], l0)
	lOddRI := gIsOpenRI(bytes[:l0Pos], l0)

	for l0Pos+r0Delta < l {
		r0, r1Delta := gFirstClass(bytes[l0Pos+r0Delta:])
		if gDecision(l1Diff, l0, lOddRI, r0) {
			return l0Pos + r0Delta
		}
		if l0 != r0 {
			l1Diff = l0
		}
		l0 = r0
		lOddRI = l0 == gClassRI && !lOddRI
		l0Pos += r0Delta
		r0Delta = r1Delta
	}
	return l
}

// GraphemeClusterEnd computes grapheme cluster which contains pos-th rune.
// Returns (index of grapheme cluster's last rune)+1.
// In other words, returns first grapheme cluster's boundary on the right of pos-th rune.
func GraphemeClusterEnd(bytes []byte, pos int) int {
	l := len(bytes)
	if pos < 0 || pos >= l {
		return InvalidPos
	}
	if pos == l-1 {
		return l
	}

	return graphemeClusterEnd(bytes, pos)
}

// bytes must be valid (len>1).
// r0Pos must be valid (in bytes).
func graphemeClusterBegin(bytes []byte, r0Pos int) int {
	if r0Pos >= 1 && bytes[r0Pos-1] == crRune && bytes[r0Pos] == lfRune { // GB3
		return r0Pos - 1
	}

	r0Pos = toRuneBegin(bytes, r0Pos) // TODO do it only on external call
	r0, _ := gFirstClass(bytes[r0Pos:])

	for r0Pos > 0 {
		l0, l0Pos := gLastClass(bytes[:r0Pos])
		l1Diff := gLastNotEqualTo(bytes[:l0Pos], l0)
		lOddRI := gIsOpenRI(bytes[:l0Pos], l0)

		if gDecision(l1Diff, l0, lOddRI, r0) {
			return r0Pos
		}

		r0 = l0
		r0Pos = l0Pos
	}
	return 0
}

// GraphemeClusterBegin computes grapheme cluster which contains pos-th rune.
// Returns grapheme cluster's first rune index.
// In other words, returns first grapheme cluster's boundary on the left of pos-th rune.
func GraphemeClusterBegin(bytes []byte, pos int) int {
	l := len(bytes)
	if pos < 0 || pos >= l {
		return InvalidPos
	}
	if pos == 0 {
		return 0
	}

	return graphemeClusterBegin(bytes, pos)
}

// GraphemeClusterAt computes grapheme clusters which contains pos-th rune and return their boundary.
// Grapheme cluster may retrieved by "bytes[r.From:r.To]".
func GraphemeClusterAt(bytes []byte, pos int) Boundary {
	return Boundary{GraphemeClusterBegin(bytes, pos), GraphemeClusterEnd(bytes, pos)}
}

// FirstGraphemeCluster computes first grapheme cluster.
// Returns (index of cluster's last rune)+1.
// Result also may be treated as length of the first grapheme cluster.
// First grapheme cluster may retrieved by "bytes[:r]".
func FirstGraphemeCluster(bytes []byte) (r int) {
	return GraphemeClusterEnd(bytes, 0)
}

// LastGraphemeCluster computes last grapheme cluster.
// Returns index of cluster's first rune.
// Last grapheme cluster may retrieved by "bytes[r:]".
func LastGraphemeCluster(bytes []byte) (r int) {
	return GraphemeClusterBegin(bytes, len(bytes)-1)
}

// GraphemeClusters computes all grapheme clusters and returns theirs boundaries.
func GraphemeClusters(bytes []byte) (boundaries []Boundary) {
	boundaries = make([]Boundary, 0, len(bytes)) // TODO memory efficient
	for i := 0; i < len(bytes); {
		length := FirstGraphemeCluster(bytes[i:])
		boundaries = append(boundaries, Boundary{i, i + length})
		i += length
	}
	return
}

// GraphemeClusterBreaks computes all grapheme clusters and returns all breaks.
func GraphemeClusterBreaks(bytes []byte) (breaks []int) {
	l := len(bytes)
	if l == 0 {
		return // []int{0}
	}
	breaks = make([]int, 1, len(bytes)) // TODO memory efficient
	breaks[0] = 0
	for pos := 0; pos < l; {
		length := FirstGraphemeCluster(bytes[pos:])
		pos += length
		breaks = append(breaks, pos)
	}
	return
}


text:
module Main where
import System.Environment
import Process

main :: IO ()
main = do
    args <- getArgs
    case args of
        field:folder:_ -> process field folder
        _              -> error "Args are: <field name> <folder>"

-- -- Benchmark
-- main :: IO ()
-- main = main' 100 where
--   main' :: Integer -> IO ()
--   main' 0 = return ()
--   main' n = do
--     process "Name" "../test_data"
--     main' (n - 1)


text:
#ifndef _M68K_DMA_H
#define _M68K_DMA_H 1

#include <linux/config.h>

/* it's useless on the m68k, but unfortunately needed by the new
   bootmem allocator (but this should do it for this) */
#define MAX_DMA_ADDRESS PAGE_OFFSET

#define MAX_DMA_CHANNELS 8

extern int request_dma(unsigned int dmanr, const char * device_id);	/* reserve a DMA channel */
extern void free_dma(unsigned int dmanr);	/* release it again */

#ifdef CONFIG_PCI
extern int isa_dma_bridge_buggy;
#else
#define isa_dma_bridge_buggy    (0)
#endif

#endif /* _M68K_DMA_H */


text:
package com.yourname.flixelgame;
import org.flixel.FlxDesktopApplication;

public class FlxBloom
{
	public static void main(String[] args)
	{
		new FlxDesktopApplication(new com.yourname.flixelgame.examples.bloom.FlxBloom(), 640, 480);
	}
}


text:
package prefuse.data.expression;

import prefuse.data.Schema;
import prefuse.data.Tuple;
import prefuse.util.TypeLib;

/**
 * Literal expression of a numeric value.
 *
 * @author jeffrey heer
 */
public class NumericLiteral extends Literal {

    private final Number m_number;
    private final Class  m_type;

    // ------------------------------------------------------------------------
    // Constructors

    /**
     * Create a new integer NumericLiteral.
     * @param x the literal numeric value
     */
    public NumericLiteral(int x) {
        m_number = new Integer(x);
        m_type = int.class;
    }

    /**
     * Create a new long NumericLiteral.
     * @param x the literal numeric value
     */
    public NumericLiteral(long x) {
        m_number = new Long(x);
        m_type = long.class;
    }

    /**
     * Create a new float NumericLiteral.
     * @param x the literal numeric value
     */
    public NumericLiteral(float x) {
        m_number = new Float(x);
        m_type = float.class;
    }

    /**
     * Create a new double NumericLiteral.
     * @param x the literal numeric value
     */
    public NumericLiteral(double x) {
        m_number = new Double(x);
        m_type = double.class;
    }

    /**
     * Create a new NumericLiteral.
     * @param x the literal numeric value, must be an instance of
     * {@link java.lang.Number}, otherwise an exception will be thrown.
     */
    public NumericLiteral(Object x) {
        if ( x instanceof Number ) {
            m_number = (Number)x;
            m_type = TypeLib.getPrimitiveType(m_number.getClass());
        } else {
            throw new IllegalArgumentException("Invalid type!");
        }
    }

    // ------------------------------------------------------------------------
    // Expression Interface

    /**
     * @see prefuse.data.expression.Expression#getType(prefuse.data.Schema)
     */
    public Class getType(Schema s) {
        return m_type;
    }

    /**
     * @see prefuse.data.expression.Expression#get(prefuse.data.Tuple)
     */
    public Object get(Tuple t) {
        return m_number;
    }

    /**
     * @see prefuse.data.expression.Expression#getInt(prefuse.data.Tuple)
     */
    public int getInt(Tuple t) {
        return m_number.intValue();
    }

    /**
     * @see prefuse.data.expression.Expression#getLong(prefuse.data.Tuple)
     */
    public long getLong(Tuple t) {
        return m_number.longValue();
    }

    /**
     * @see prefuse.data.expression.Expression#getFloat(prefuse.data.Tuple)
     */
    public float getFloat(Tuple t) {
        return m_number.floatValue();
    }

    /**
     * @see prefuse.data.expression.Expression#getDouble(prefuse.data.Tuple)
     */
    public double getDouble(Tuple t) {
        return m_number.doubleValue();
    }

    /**
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return m_number.toString();
    }

} // end of class NumericLiteral


text:
package com.android.settings.util;

import android.app.AlertDialog;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.android.settings.R;

import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * A preference that lists installed applications, with icons, as a multi choice list.
 *
 * @author Clark Scheff
 */
public class AppMultiSelectListPreference extends DialogPreference {
    private final List<MyApplicationInfo> mPackageInfoList = new ArrayList<MyApplicationInfo>();
    private CharSequence[] mEntries;
    private CharSequence[] mEntryValues;
    private Set<String> mValues = new HashSet<String>();
    private Set<String> mNewValues = new HashSet<String>();
    private boolean mPreferenceChanged;

    public AppMultiSelectListPreference(Context context) {
        this(context, null);
    }

    public AppMultiSelectListPreference(Context context, AttributeSet attrs) {
        super(context, attrs);
        List<ApplicationInfo> pkgs = context.getPackageManager()
                .getInstalledApplications(PackageManager.PERMISSION_GRANTED);
        for (int i=0; i<pkgs.size(); i++) {
            ApplicationInfo ai = pkgs.get(i);
            if(context.getPackageManager().getLaunchIntentForPackage(ai.packageName) == null) {
                continue;
            }
            MyApplicationInfo info = new MyApplicationInfo();
            info.info = ai;
            info.label = info.info.loadLabel(getContext().getPackageManager()).toString();
            mPackageInfoList.add(info);
        }

        List<CharSequence> entries = new ArrayList<CharSequence>();
        List<CharSequence> entryValues = new ArrayList<CharSequence>();
        Collections.sort(mPackageInfoList, sDisplayNameComparator);
        for (MyApplicationInfo info : mPackageInfoList) {
            entries.add(info.label);
            entryValues.add(info.info.packageName);
        }
        MyApplicationInfo info = new MyApplicationInfo();
        mEntries = new CharSequence[entries.size()];
        mEntryValues = new CharSequence[entries.size()];
        entries.toArray(mEntries);
        entryValues.toArray(mEntryValues);
    }

    /**
     * Sets the value of the key. This should contain entries in
     * {@link #getEntryValues()}.
     *
     * @param values The values to set for the key.
     */
    public void setValues(Set<String> values) {
        mValues.clear();
        mValues.addAll(values);

        persistStringSet(values);
    }

    public void setClearValues() {
        mValues.clear();
    }

    /**
     * Retrieves the current value of the key.
     */
    public Set<String> getValues() {
        return mValues;
    }

    /**
     * Returns the index of the given value (in the entry values array).
     *
     * @param value The value whose index should be returned.
     * @return The index of the value, or -1 if not found.
     */
    public int findIndexOfValue(String value) {
        if (value != null && mEntryValues != null) {
            for (int i = mEntryValues.length - 1; i >= 0; i--) {
                if (mEntryValues[i].equals(value)) {
                    return i;
                }
            }
        }
        return -1;
    }

    @Override
    protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
        super.onPrepareDialogBuilder(builder);
        builder.setAdapter(new AppListAdapter(getContext()), null);
        mNewValues.clear();
        mNewValues.addAll(mValues);
    }

    @Override
    protected void showDialog(Bundle state) {
        super.showDialog(state);
        final AlertDialog dialog = (AlertDialog) getDialog();
        final ListView listView = dialog.getListView();
        listView.setItemsCanFocus(false);
        listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                final AppViewHolder holder = (AppViewHolder) view.getTag();
                final boolean isChecked = !holder.checkBox.isChecked();
                holder.checkBox.setChecked(isChecked);
                if (isChecked) {
                    mPreferenceChanged |= mNewValues.add(mEntryValues[position].toString());
                } else {
                    mPreferenceChanged |= mNewValues.remove(mEntryValues[position].toString());
                }
            }
        });
    }

    @Override
    protected void onDialogClosed(boolean positiveResult) {
        super.onDialogClosed(positiveResult);

        if (positiveResult && mPreferenceChanged) {
            final Set<String> values = mNewValues;
            if (callChangeListener(values)) {
                setValues(values);
            }
        }
        mPreferenceChanged = false;
    }

    @Override
    protected Object onGetDefaultValue(TypedArray a, int index) {
        final CharSequence[] defaultValues = a.getTextArray(index);
        final int valueCount = defaultValues.length;
        final Set<String> result = new HashSet<String>();

        for (int i = 0; i < valueCount; i++) {
            result.add(defaultValues[i].toString());
        }

        return result;
    }

    @Override
    protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
        setValues(restoreValue ? getPersistedStringSet(mValues) : (Set<String>) defaultValue);
    }

    class MyApplicationInfo {
        ApplicationInfo info;
        CharSequence label;
    }

    public class AppListAdapter extends ArrayAdapter<MyApplicationInfo> {
        private final LayoutInflater mInflater;

        public AppListAdapter(Context context) {
            super(context, 0);
            mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            addAll(mPackageInfoList);
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            // A ViewHolder keeps references to children views to avoid unnecessary calls
            // to findViewById() on each row.
            AppViewHolder holder = AppViewHolder.createOrRecycle(mInflater, convertView);
            convertView = holder.rootView;
            MyApplicationInfo info = getItem(position);
            holder.appName.setText(info.label);
            if (info.info != null) {
                holder.appIcon.setImageDrawable(info.info.loadIcon(getContext().getPackageManager()));
            } else {
                holder.appIcon.setImageDrawable(null);
            }
            holder.checkBox.setChecked(mNewValues.contains(mEntryValues[position].toString()));
            return convertView;
        }

        @Override
        public MyApplicationInfo getItem(int position) {
            return mPackageInfoList.get(position);
        }
    }

    public static class AppViewHolder {
        public View rootView;
        public TextView appName;
        public ImageView appIcon;
        public CheckBox checkBox;

        public static AppViewHolder createOrRecycle(LayoutInflater inflater, View convertView) {
            if (convertView == null) {
                convertView = inflater.inflate(R.layout.ad_excluded_app_item, null);

                // Creates a ViewHolder and store references to the two children views
                // we want to bind data to.
                AppViewHolder holder = new AppViewHolder();
                holder.rootView = convertView;
                holder.appName = (TextView) convertView.findViewById(R.id.app_name);
                holder.appIcon = (ImageView) convertView.findViewById(R.id.app_icon);
                holder.checkBox = (CheckBox) convertView.findViewById(android.R.id.checkbox);
                convertView.setTag(holder);
                return holder;
            } else {
                // Get the ViewHolder back to get fast access to the TextView
                // and the ImageView.
                return (AppViewHolder)convertView.getTag();
            }
        }
    }

    private final static Comparator<MyApplicationInfo> sDisplayNameComparator
            = new Comparator<MyApplicationInfo>() {
        public final int
        compare(MyApplicationInfo a, MyApplicationInfo b) {
            return collator.compare(a.label, b.label);
        }

        private final Collator collator = Collator.getInstance();
    };
}


text:
gitBaseName = "git"
gitDefaultVersion = "2.6.4"
gitSupportedVersions = ["2.6.4"]
gitTarballVersions = {
  "2.6.4" : "2.6.4",
  }

#
# Script code
#

from InstallProgramDriver import *
from GeneralScriptSupport import *

class GitInstall:

  def __init__(self):
    self.dummy = None

  #
  # Called before even knowing the product version
  #

  def getScriptName(self):
    return "install-git.py"

  def getProductBaseName(self):
    return gitBaseName

  def getProductDefaultVersion(self):
    return gitDefaultVersion

  def getProductSupportedVersions(self):
    return gitSupportedVersions

  #
  # Called after knowing the product version but before parsing the
  # command-line.
  #

  def getProductName(self, version):
    return gitBaseName+"-"+version

  def getBaseDirName(self, version):
    return gitBaseName+"-"+version+"-base"

  def getExtraHelpStr(self, version):
    return """
This script builds """+self.getProductName(version)+""" from source compiled with the
configured C compiler in your path.   This also installs the git-subtree provided in the
contributed folder on install.

To also build and install the documentaion, additionally, pass in:

  --with-doc --with-info

(but note the extra packages that must be installed on the system).

For more details on installing from source and required system dependencies
before attempting this build, see:

  https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

In particular, to build everything you will need to install the documentation
(--with-doc and --with-info), you will need to install the packages
'asciidoc', 'xmlto', and 'docbook2X'.  Again, see the above webpage for
details (it is not 100% pretty).

NOTE: The assumed directory structure of the download source provided by the
command --download-cmnd=<download-cmnd> is:

   git-<version>-base/
     git-<full-version>.tar.gz
"""

  def injectExtraCmndLineOptions(self, clp, version):
    setStdDownloadCmndOption(self, clp, version)
    clp.add_option(
      "--extra-configure-options", dest="extraConfigureOptions", type="string", \
      default="", \
      help="Extra options to add to the 'configure' command for "+self.getProductName(version)+"." \
        +"  Note: This does not override the hard-coded configure options." )
    clp.add_option(
      "--with-doc", dest="withDoc", action="store_true", default=False,
      help="Build and install manpage documentation (requires asciidoc and xmlto)." )
    clp.add_option(
      "--with-info", dest="withInfo", action="store_true", default=False,
      help="Build and install info documentation (requires docbook2x)." )

  def echoExtraCmndLineOptions(self, inOptions):
    cmndLine = ""
    cmndLine += "  --download-cmnd='"+inOptions.downloadCmnd+"' \\\n"
    cmndLine += "  --extra-configure-options='"+inOptions.extraConfigureOptions+"' \\\n"
    return cmndLine

  #
  # Called after parsing the command-line
  #

  def setup(self, inOptions):
    self.inOptions = inOptions
    self.baseDir = os.getcwd()
    self.gitBaseDir = self.baseDir+"/"+self.getBaseDirName(self.inOptions.version)
    gitVersionFull = gitTarballVersions[self.inOptions.version]
    self.gitTarball = "git-"+gitVersionFull+".tar.gz"
    self.gitSrcDir = "git-"+gitVersionFull
    self.gitSrcBuildDir = self.gitBaseDir+"/"+self.gitSrcDir
    self.gitSubtreeSrcBuildDir = self.gitSrcBuildDir+"/contrib/subtree"
    self.scriptBaseDir = getScriptBaseDir()

  #
  # Called after setup()
  #

  def doDownload(self):
    removeDirIfExists(self.gitBaseDir, True)
    echoRunSysCmnd(self.inOptions.downloadCmnd)

  def doUntar(self):
    # Find the full name of the source tarball
    echoChDir(self.gitBaseDir)
    echoRunSysCmnd("tar -xzf "+self.gitTarball)

  def doConfigure(self):
    echoChDir(self.gitSrcBuildDir)
    echoRunSysCmnd("make configure")
    echoRunSysCmnd(
      "./configure "+\
      " "+self.inOptions.extraConfigureOptions+\
      " --prefix="+self.inOptions.installDir
      )
    # NOTE: Git appears to only allow an in-source build :-(

  def doBuild(self):
    echoChDir(self.gitSrcBuildDir)
    echoRunSysCmnd("make "+getParallelOpt(self.inOptions, "-j")+\
      self.inOptions.makeOptions+" all")
    if self.inOptions.withDoc:
      echoRunSysCmnd("make "+getParallelOpt(self.inOptions, "-j")+\
        self.inOptions.makeOptions+" doc")
    if self.inOptions.withInfo:
      echoRunSysCmnd("make "+getParallelOpt(self.inOptions, "-j")+\
        self.inOptions.makeOptions+" info")
    # Build git-subtree to get ready to install
    echoChDir(self.gitSubtreeSrcBuildDir)

  def doInstall(self):
    echoChDir(self.gitSrcBuildDir)
    echoRunSysCmnd("make "+self.inOptions.makeOptions+" install")
    if self.inOptions.withDoc:
      echoRunSysCmnd("make "+self.inOptions.makeOptions+" install-doc")
      echoRunSysCmnd("make "+self.inOptions.makeOptions+" install-html")
    if self.inOptions.withInfo:
      echoRunSysCmnd("make "+self.inOptions.makeOptions+" install-info")
    # Install git-subtree and documentation
    echoChDir(self.gitSubtreeSrcBuildDir)
    echoRunSysCmnd("make "+self.inOptions.makeOptions+" install")
    if self.inOptions.withDoc:
      echoRunSysCmnd("make "+self.inOptions.makeOptions+" install-doc")

  def getFinalInstructions(self):
    return """
To use the installed version of git-"""+self.inOptions.version+""" add the path:

  """+self.inOptions.installDir+"""/bin

to your path and that should be it!
"""

#
# Executable statements
#

gitInstaller = InstallProgramDriver(GitInstall())
gitInstaller.runDriver()


text: include_recipe 'build-essential'


text:
'use strict';

const expect = require('chai').expect;
const Future = require('../fluture.js');
const FutureTry = Future.classes.FutureTry;
const U = require('./util');

describe('Future.try()', () => {

  it('throws TypeError when not given a function', () => {
    const xs = [NaN, {}, [], 1, 'a', new Date, undefined, null];
    const fs = xs.map(x => () => Future.try(x));
    fs.forEach(f => expect(f).to.throw(TypeError, /Future/));
  });

  it('returns an instance of FutureTry', () => {
    expect(Future.try(x => x)).to.be.an.instanceof(FutureTry);
  });

});

describe('FutureTry', () => {

  it('extends Future', () => {
    expect(new FutureTry).to.be.an.instanceof(Future);
  });

  describe('#fork()', () => {

    it('resolves with the return value of the function', () => {
      const actual = new FutureTry(() => 1);
      return U.assertResolved(actual, 1);
    });

    it('rejects with the exception thrown by the function', () => {
      const actual = new FutureTry(() => { throw U.error });
      return U.assertRejected(actual, U.error);
    });

  });

  describe('#toString()', () => {

    it('returns the code to create the FutureTry', () => {
      const m = new FutureTry(x => x);
      expect(m.toString()).to.equal('Future.try(x => x)');
    });

  });

});


text:
var crypto    = require("crypto");
var check     = require("check-types");
var _         = require("lodash");
var BigNumber = require("bignumber.js");

var HexChars = "0123456789abcdef";

var Base62Chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

//TODO: We are ignoring padding for now.
var Base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

function log(b, n) {
	return Math.log(n) / Math.log(b);
}

/*
 * Converts str from one encoding into another.
 *
 * @param {string} str - thing to convert from
 * @param {string} from - character class you're converting from
 * @param {string} to - character class you're converting to
 * @param {object} opts - opts to use for the encode and decode functions
 *
 */
function convert(str, from, to, opts) {
	check.assert.unemptyString(str);
	check.assert.unemptyString(from);
	check.assert.unemptyString(to);
	opts = opts || {};
	var decodedNum = decode(str, _.assign(opts, {chars: from}));
	return encode(decodedNum, _.assign(opts, {chars: to, convert: true}));
}

function encode(num, opts) {
	check.assert.instance(num, BigNumber, "not BigNumber or not using allbases.BigNumber");

	opts = _.defaults(opts || {}, {
		chars: HexChars
	});
	check.assert.unemptyString(opts.chars);

	var len     = opts.chars.length;
	var indices = [];
	do {
		indices.push(num.mod(len).toNumber());
		num = num.divToInt(len);
	} while (num.gt(0));

	var str = [];
	while (indices.length > 0) {
		str.push(opts.chars[indices.pop()]);
	}

	return str.join("");
}

//Using factored out polynomial series to decode only with mul & add
// i.e. a + bX + cX^2 + dX^4 ... === a + X(b + X(c + X(d + ...
function decode(str, opts) {
	check.assert.unemptyString(str);

	opts = _.defaults(opts || {}, {
		chars: HexChars,
		strict: true
	});

	//ignore case on hex encoding
	if (opts.chars === HexChars) {
		str = str.toLowerCase();
	}

	if (opts.strict && !strictCheck(str, opts.chars)) {
		throw "str falls outside of specified character class."
	}

	var num = new BigNumber(opts.chars.indexOf(str[0]));
	for (var i = 1; i < str.length; i++) {
		var ch = str[i];
		num = num.mul(opts.chars.length).add(opts.chars.indexOf(ch));
	}

	return num;
}

function strictCheck(str, chars) {
	for (var i = 0; i < str.length; i++) {
		if (chars.indexOf(str[i]) === -1) {
			return false;
		}
	}

	return true;
}

function trimPadding(str) {
	while (str.slice(-1) === "=") {
		str = str.slice(0, -1);
	}

	return str;
}

function genRandom(numberOfBytes, chars, rand) {
	//TODO: allow user to specify random byte method used
	var buf = rand(numberOfBytes);
	var bHex = buf.toString("hex");
	return encode(new BigNumber(bHex, 16), {chars: chars});
}

function random(size, opts) {
	check.assert.positive(size);

	var defaultRandom =
		crypto.pseudoRandomBytes ? crypto.pseudoRandomBytes : crypto.randomBytes;

	//TODO: verify opts
	opts = _.defaults(opts || {}, {
		chars: HexChars,
		rand:  defaultRandom,
		strictSize: false
	});
	var len   = opts.chars.length;

	//TODO: circumvent current combo size limitation
	//TODO: for base 2 char sizes we can calculate byte size directly.
	var combos = Math.pow(len, size);
	if (combos === Infinity) {
		throw "Too large of a size, can't estimate needed bytes"
	}

	//TODO: in order to circumvent current combo size limitation need to
	//implement the log function for big decimals.
	//https://stackoverflow.com/questions/739532/logarithm-of-a-bigdecimal
	var bits = Math.ceil(log(2, combos));

	//Add 1 to give padding and reduce chance we will need to recalculate with
	//strict size enabled.
	var numberOfBytes = Math.ceil(bits / 8) + 1;

	var res;
	if (opts.strictSize) {
		// With strict size need to gurantee random value of certain size is generated
		do {
			res = genRandom(numberOfBytes, opts.chars, opts.rand);
		} while (res.length < size);
	} else {
		res = genRandom(numberOfBytes, opts.chars, opts.rand);
	}

	return res.substr(0, size);
}

function genBaseAPI(func, base) {
	return function(v, opts) { return func(v, _.assign(opts || {}, { chars: base })); }
}

module.exports = {
	Chars: {
		Hex:    HexChars,
		Base16: HexChars,
		Base62: Base62Chars,
		Base64: Base64Chars
	},
	encode:       encode,
	encodeHex:    genBaseAPI(encode, HexChars),
	encodeBase62: genBaseAPI(encode, Base62Chars),
	encodeBase64: genBaseAPI(encode, Base64Chars),
	decode:       decode,
	decodeHex:    genBaseAPI(decode, HexChars),
	decodeBase62: genBaseAPI(decode, Base62Chars),
	decodeBase64: genBaseAPI(decode, Base64Chars),
	random:       random,
	randomHex:    genBaseAPI(random, HexChars),
	randomBase62: genBaseAPI(random, Base62Chars),
	randomBase64: genBaseAPI(random, Base64Chars),
	convert:      convert,
	BigNumber:    BigNumber
}


text:
package net.sourceforge.myvd.test.ldap;

import com.novell.ldap.util.DN;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.BeforeClass;
import org.junit.AfterClass;
import static org.junit.Assert.*;

public class TestDN  {

	@Test
	public void testDNWithPlus() throws Exception {
		//DN dn = new DN("cn=my\\+dn,dc=domain,dc=com");
		DN dn = new DN("CN=Schedule\\+ Free Busy Information - COG,CN=Microsoft Exchange System Objects,DC=mwcog,DC=org");
		String dnStr = dn.toString();
		System.out.println(dnStr);
		dn = new DN(dnStr);
	}

	/*public void testDNWithDash() throws Exception {
		DN dn = new DN("cn=my-dn,dc=domain,dc=com");
	}

	public void testDNWithSpace() throws Exception {
		DN dn = new DN("cn=my dn,dc=domain,dc=com");
	}*/
}


text:
module Form
  module Static
    class Object < ActiveType::Object
      include Form
      include Static

      def self.virtual?
        true
      end
    end
  end
end