text:
<?xml version="1.0" encoding="UTF-8"?>
<adhocDataView exportedWithPermissions="true">
    <folder>/public/audit/reports</folder>
    <name>Audit_Report_AdhocDataView</name>
    <version>0</version>
    Audit Report Adhoc Data View
    <description>The AdhocDataView for Audit Report report</description>
    <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
    <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
    <dataSource>
        <uri>/public/audit/domains/AuditDomain</uri>
    </dataSource>
    <inputControl>
        <localResource
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            exportedWithPermissions="false" xsi:type="inputControl">
            <folder>/public/audit/reports/Audit_Report_AdhocDataView_files</folder>
            <name>event_type_1</name>
            <version>0</version>
            Event Type
            <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
            <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
            <type>7</type>
            <mandatory>false</mandatory>
            <readOnly>false</readOnly>
            <visible>true</visible>
            <query>
                <localResource exportedWithPermissions="false" xsi:type="query">
                    <folder>/public/audit/reports/Audit_Report_AdhocDataView_files/event_type_1_files</folder>
                    <name>event_type_1</name>
                    <version>0</version>
                    Event Type
                    <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
                    <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
                    <language>domain</language>
                    <queryString><?xml version="1.0" encoding="UTF-8"?>
<query xmlns="http://www.jaspersoft.com/2007/SL/XMLSchema">
  <groupList>
    <group columnName="audit_join1.audit_event_group.event_type" />
  </groupList>
  <queryFields>
    <queryField id="audit_join1.audit_event_group.event_type" />
  </queryFields>
</query>

</queryString>
                    <dataSource>
                        <uri>/public/audit/domains/AuditDomain</uri>
                    </dataSource>
                </localResource>
            </query>
            <queryVisibleColumn>audit_join1.audit_event_group.event_type</queryVisibleColumn>
            <queryValueColumn>audit_join1.audit_event_group.event_type</queryValueColumn>
        </localResource>
    </inputControl>
    <inputControl>
        <localResource
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            exportedWithPermissions="false" xsi:type="inputControl">
            <folder>/public/audit/reports/Audit_Report_AdhocDataView_files</folder>
            <name>resource_org_type_1</name>
            <version>0</version>
            Resource Type
            <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
            <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
            <type>7</type>
            <mandatory>false</mandatory>
            <readOnly>false</readOnly>
            <visible>true</visible>
            <query>
                <localResource exportedWithPermissions="false" xsi:type="query">
                    <folder>/public/audit/reports/Audit_Report_AdhocDataView_files/resource_org_type_1_files</folder>
                    <name>resource_org_type_1</name>
                    <version>0</version>
                    Resource Type
                    <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
                    <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
                    <language>domain</language>
                    <queryString><?xml version="1.0" encoding="UTF-8"?>
<query xmlns="http://www.jaspersoft.com/2007/SL/XMLSchema">
  <groupList>
    <group columnName="audit_join1.audit_event_group.resource_org_type" />
  </groupList>
  <queryFields>
    <queryField id="audit_join1.audit_event_group.resource_org_type" />
  </queryFields>
</query>

</queryString>
                    <dataSource>
                        <uri>/public/audit/domains/AuditDomain</uri>
                    </dataSource>
                </localResource>
            </query>
            <queryVisibleColumn>audit_join1.audit_event_group.resource_org_type</queryVisibleColumn>
            <queryValueColumn>audit_join1.audit_event_group.resource_org_type</queryValueColumn>
        </localResource>
    </inputControl>
    <inputControl>
        <localResource
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            exportedWithPermissions="false" xsi:type="inputControl">
            <folder>/public/audit/reports/Audit_Report_AdhocDataView_files</folder>
            <name>audit_event_date_1</name>
            <version>0</version>
            Date between
            <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
            <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
            <type>2</type>
            <mandatory>false</mandatory>
            <readOnly>false</readOnly>
            <visible>true</visible>
            <dataType>
                <localResource exportedWithPermissions="false" xsi:type="dataType">
                    <folder>/public/audit/reports/Audit_Report_AdhocDataView_files/audit_event_date_1_files</folder>
                    <name>date</name>
                    <version>0</version>
                    Date
                    <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
                    <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
                    <type>3</type>
                    <strictMin>false</strictMin>
                    <strictMax>false</strictMax>
                </localResource>
            </dataType>
        </localResource>
    </inputControl>
    <inputControl>
        <localResource
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            exportedWithPermissions="false" xsi:type="inputControl">
            <folder>/public/audit/reports/Audit_Report_AdhocDataView_files</folder>
            <name>audit_event_date_2</name>
            <version>0</version>
            and
            <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
            <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
            <type>2</type>
            <mandatory>false</mandatory>
            <readOnly>false</readOnly>
            <visible>true</visible>
            <dataType>
                <localResource exportedWithPermissions="false" xsi:type="dataType">
                    <folder>/public/audit/reports/Audit_Report_AdhocDataView_files/audit_event_date_2_files</folder>
                    <name>date</name>
                    <version>0</version>
                    Date
                    <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
                    <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
                    <type>3</type>
                    <strictMin>false</strictMin>
                    <strictMax>false</strictMax>
                </localResource>
            </dataType>
        </localResource>
    </inputControl>
    <resource>
        <localResource
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            exportedWithPermissions="false"
            dataFile="audit_schema.properties.data" xsi:type="fileResource">
            <folder>/public/audit/reports/Audit_Report_AdhocDataView_files</folder>
            <name>audit_schema.properties</name>
            <version>0</version>
            bundle
            <description>bundle</description>
            <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
            <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
            <fileType>prop</fileType>
        </localResource>
    </resource>
    <resource>
        <localResource
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            exportedWithPermissions="false" dataFile="stateXML.data" xsi:type="fileResource">
            <folder>/public/audit/reports/Audit_Report_AdhocDataView_files</folder>
            <name>stateXML</name>
            <version>0</version>
            stateXML
            <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
            <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
            <fileType>img</fileType>
        </localResource>
    </resource>
    <resource>
        <localResource
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            exportedWithPermissions="false" dataFile="topicJRXML.data" xsi:type="fileResource">
            <folder>/public/audit/reports/Audit_Report_AdhocDataView_files</folder>
            <name>topicJRXML</name>
            <version>0</version>
            topicJRXML
            <creationDate>2015-05-27T15:05:26.809-07:00</creationDate>
            <updateDate>2012-05-03T16:51:47.612-07:00</updateDate>
            <fileType>jrxml</fileType>
        </localResource>
    </resource>
    <inputControlRenderingView></inputControlRenderingView>
    <alwaysPromptControls>true</alwaysPromptControls>
    <controlsLayout>1</controlsLayout>
</adhocDataView>


text:
package com.github.florent37.materialviewpager.sample.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.github.florent37.materialpager.MaterialViewPagerHelper;
import com.github.florent37.materialviewpager.sample.R;
import com.github.ksoichiro.android.observablescrollview.ObservableWebView;

/**
 * Created by florentchampigny on 24/04/15.
 */
public class WebViewFragment extends Fragment {

    private ObservableWebView mWebView;

    public static WebViewFragment newInstance() {
        return new WebViewFragment();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_webview, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        mWebView = (ObservableWebView) view.findViewById(R.id.webView);

        //must be called before loadUrl()
        MaterialViewPagerHelper.preLoadInjectHeader(mWebView);

        //have to inject header when WebView page loaded
        mWebView.setWebViewClient(new WebViewClient() {
            @Override
            public void onPageFinished(WebView view, String url) {
                MaterialViewPagerHelper.injectHeader(mWebView, true);
            }

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });

        mWebView.loadUrl("http://coderom.ml");

        MaterialViewPagerHelper.registerWebView(getActivity(), mWebView, null);
    }
}

redpajama_set_name: RedPajamaGithub


text:
// This file was generated by Mendix Modeler.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
// Special characters, e.g., é, ö, à, etc. are supported in comments.

package boxconnector.actions;

import static boxconnector.proxies.microflows.Microflows.updateMetadataOnFolderImpl;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.systemwideinterfaces.core.IMendixObject;
import com.mendix.webui.CustomJavaAction;

/**
 * Used to update the template instance.
 * Updates can be either add, replace, remove , test, move, or copy.
 * The template instance can only be updated if the template instance already exists.
 * When editing metadata, only values that adhere to the metadata template schema will be accepted.
 *
 * The update is applied atomically. If any errors occur during the application of the update operations, the metadata instance remains unchanged.
 *
 * Required
 * BoxFolder
 * The _id attribute is required
 *
 * Scope: The scope of the object.
 *
 * BoxTemplate: The template to use.
 * The templateKey attribute is required
 * At least 1 MetadataValue must be provided with type and corresponding value.
 *
 * UpdateMetadataList: The list of changes to apply
 *
 * UpdateMetadata objects must be set as follow:
 *
 * Operation: the operation to apply
 * TypeMetadata: the type of the metadata
 * Key: The key name of the metadata
 * StrValue/FloatValue/DateValue: The corresponding value to be set or tested. Required for add, replace, and test operations.
 * For add, if value already exists, then previous value will be overwritten by the new value.
 * For replace, the metadata value must exist before replacing.
 * For test, the value of the existing metadata instance must match the specified value.
 *
 * FromBoxMetadata: The key to the Metadata source.
 * This value is required only in case of Move or Copy operation.
 *
 */
public class UpdateMetadataOnFolder extends CustomJavaAction<java.lang.Boolean>
{
	private IMendixObject __boxFolder;
	private boxconnector.proxies.BoxFolder boxFolder;
	private IMendixObject __boxTemplate;
	private boxconnector.proxies.BoxTemplate boxTemplate;
	private boxconnector.proxies.MetadataScope scope;
	private java.util.List<IMendixObject> __updateMetadataList;
	private java.util.List<boxconnector.proxies.UpdateMetadata> updateMetadataList;
	private IMendixObject __accessToken;
	private boxconnector.proxies.AccessToken accessToken;
	private IMendixObject __asUser;
	private boxconnector.proxies.BoxUser asUser;

	public UpdateMetadataOnFolder(IContext context, IMendixObject boxFolder, IMendixObject boxTemplate, java.lang.String scope, java.util.List<IMendixObject> updateMetadataList, IMendixObject accessToken, IMendixObject asUser)
	{
		super(context);
		this.__boxFolder = boxFolder;
		this.__boxTemplate = boxTemplate;
		this.scope = scope == null ? null : boxconnector.proxies.MetadataScope.valueOf(scope);
		this.__updateMetadataList = updateMetadataList;
		this.__accessToken = accessToken;
		this.__asUser = asUser;
	}

	@Override
	public java.lang.Boolean executeAction() throws Exception
	{
		this.boxFolder = __boxFolder == null ? null : boxconnector.proxies.BoxFolder.initialize(getContext(), __boxFolder);

		this.boxTemplate = __boxTemplate == null ? null : boxconnector.proxies.BoxTemplate.initialize(getContext(), __boxTemplate);

		this.updateMetadataList = new java.util.ArrayList<boxconnector.proxies.UpdateMetadata>();
		if (__updateMetadataList != null)
			for (IMendixObject __updateMetadataListElement : __updateMetadataList)
				this.updateMetadataList.add(boxconnector.proxies.UpdateMetadata.initialize(getContext(), __updateMetadataListElement));

		this.accessToken = __accessToken == null ? null : boxconnector.proxies.AccessToken.initialize(getContext(), __accessToken);

		this.asUser = __asUser == null ? null : boxconnector.proxies.BoxUser.initialize(getContext(), __asUser);

		// BEGIN USER CODE
		Boolean result = updateMetadataOnFolderImpl(getContext(), this.boxFolder, this.boxTemplate, this.scope, this.updateMetadataList, this.accessToken, this.asUser);
		return result;
		// END USER CODE
	}

	/**
	 * Returns a string representation of this action
	 */
	@Override
	public java.lang.String toString()
	{
		return "UpdateMetadataOnFolder";
	}

	// BEGIN EXTRA CODE
	// END EXTRA CODE
}


text:
namespace Synthesis.Mvc.UI
{
	public interface IContextItem
	{
		/// <summary>
		/// Gets the Sitecore context item (e.g. the current page) as a specified template
		/// </summary>
		/// <returns>The context item, or null if the context item is not set or is not the expected template.</returns>
		TItem GetContextItem<TItem>()
			where TItem : class, IStandardTemplateItem;

		/// <summary>
		/// Gets the Sitecore context item (e.g. the current page)
		/// </summary>
		IStandardTemplateItem ContextItem { get; }
	}
}


text:
package net.trolldad.dashclock.redditheadlines.testactivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import net.trolldad.dashclock.redditheadlines.activity.PreviewActivity_;

/**
 * Created by jacob-tabak on 1/26/14.
 */
public class LaunchAmpersandActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent = PreviewActivity_.intent(this)
                .mCommentsUrl("/r/pics/comments/1w5wjo/grilled_cheese_mac_cheese_in_shots_of_tomato_soup/")
                .mLinkName("t3_1w5wjo")
                .mLinkUrl("http://i.imgur.com/mUyhf6x.jpg")
                .get();
        startActivity(intent);
        finish();
    }
}


text:
class QuestionsController < ApplicationController
  before_filter :require_login, only: %w[new create edit update destroy]
  before_filter :refuse_guest, only: %w[new create edit update destroy]
  before_filter :set_question, only: %w[show redirect edit update destroy]
  before_filter :meta_noindex, only: %w[new edit]

  def redirect
    redirect_to @question
  end

  def show
    check_notification(@question)
    @question.comments.each { |c| check_notification(c) }
  end

  def new
    @question = Question.new product_id: params[:product_id]
    @question.build_images
  end

  def edit
  end

  def create
    @question = Question.new(creating_params.except(:images_attributes))
    @question.writer_id = @current_user.id

    if @question.save
      # accepts_nested_attributes_for が new, create 時に正しく動作しないため
      @question.update(creating_params)
      redirect_to @question
    else
      @question.build_images
      render :new
    end
  end

  def update
    return redirect_to root_path if @question.writer_id != @current_user.id

    if @question.update_attributes(updating_params)
      redirect_to @question
    else
      render :edit
    end
  end

  def destroy
    return redirect_to root_path if @question.writer_id != @current_user.id

    user = @question.writer
    @question.destroy
    redirect_to user
  end

  private

  def creating_params
    params.require(:question).permit(:body, :title, :star, :product_id, images_attributes: [:src])
  end

  def updating_params
    params.require(:question).permit(:body, :title, :star)
  end

  def set_question
    @question = Question.find params[:id]
    @meta = @question.to_meta
  end
end


text:
package vclib

import (
	"fmt"
	"path/filepath"
	"regexp"
	"strconv"
	"strings"

	"github.com/vmware/govmomi/find"
	"github.com/vmware/govmomi/object"
	"github.com/vmware/govmomi/vim25/soap"
	"github.com/vmware/govmomi/vim25/types"
	"k8s.io/klog/v2"
)

// IsNotFound return true if err is NotFoundError or DefaultNotFoundError
func IsNotFound(err error) bool {
	_, ok := err.(*find.NotFoundError)
	if ok {
		return true
	}

	_, ok = err.(*find.DefaultNotFoundError)
	if ok {
		return true
	}

	return false
}

func getFinder(dc *Datacenter) *find.Finder {
	finder := find.NewFinder(dc.Client(), false)
	finder.SetDatacenter(dc.Datacenter)
	return finder
}

// formatVirtualDiskUUID removes any spaces and hyphens in UUID
// Example UUID input is 42375390-71f9-43a3-a770-56803bcd7baa and output after format is 4237539071f943a3a77056803bcd7baa
func formatVirtualDiskUUID(uuid string) string {
	uuidwithNoSpace := strings.Replace(uuid, " ", "", -1)
	uuidWithNoHypens := strings.Replace(uuidwithNoSpace, "-", "", -1)
	return strings.ToLower(uuidWithNoHypens)
}

// getSCSIControllersOfType filters specific type of Controller device from given list of Virtual Machine Devices
func getSCSIControllersOfType(vmDevices object.VirtualDeviceList, scsiType string) []*types.VirtualController {
	// get virtual scsi controllers of passed argument type
	var scsiControllers []*types.VirtualController
	for _, device := range vmDevices {
		devType := vmDevices.Type(device)
		if devType == scsiType {
			if c, ok := device.(types.BaseVirtualController); ok {
				scsiControllers = append(scsiControllers, c.GetVirtualController())
			}
		}
	}
	return scsiControllers
}

// getAvailableSCSIController gets available SCSI Controller from list of given controllers, which has less than 15 disk devices.
func getAvailableSCSIController(scsiControllers []*types.VirtualController) *types.VirtualController {
	// get SCSI controller which has space for adding more devices
	for _, controller := range scsiControllers {
		if len(controller.Device) < SCSIControllerDeviceLimit {
			return controller
		}
	}
	return nil
}

// getNextUnitNumber gets the next available SCSI controller unit number from given list of Controller Device List
func getNextUnitNumber(devices object.VirtualDeviceList, c types.BaseVirtualController) (int32, error) {
	var takenUnitNumbers [SCSIDeviceSlots]bool
	takenUnitNumbers[SCSIReservedSlot] = true
	key := c.GetVirtualController().Key

	for _, device := range devices {
		d := device.GetVirtualDevice()
		if d.ControllerKey == key {
			if d.UnitNumber != nil {
				takenUnitNumbers[*d.UnitNumber] = true
			}
		}
	}
	for unitNumber, takenUnitNumber := range takenUnitNumbers {
		if !takenUnitNumber {
			return int32(unitNumber), nil
		}
	}
	return -1, fmt.Errorf("SCSI Controller with key=%d does not have any available slots", key)
}

// getSCSIControllers filters and return list of Controller Devices from given list of Virtual Machine Devices.
func getSCSIControllers(vmDevices object.VirtualDeviceList) []*types.VirtualController {
	// get all virtual scsi controllers
	var scsiControllers []*types.VirtualController
	for _, device := range vmDevices {
		devType := vmDevices.Type(device)
		switch devType {
		case SCSIControllerType, strings.ToLower(LSILogicControllerType), strings.ToLower(BusLogicControllerType), PVSCSIControllerType, strings.ToLower(LSILogicSASControllerType):
			if c, ok := device.(types.BaseVirtualController); ok {
				scsiControllers = append(scsiControllers, c.GetVirtualController())
			}
		}
	}
	return scsiControllers
}

// RemoveStorageClusterORFolderNameFromVDiskPath removes the cluster or folder path from the vDiskPath
// for vDiskPath [DatastoreCluster/sharedVmfs-0] kubevols/e2e-vmdk-1234.vmdk, return value is [sharedVmfs-0] kubevols/e2e-vmdk-1234.vmdk
// for vDiskPath [sharedVmfs-0] kubevols/e2e-vmdk-1234.vmdk, return value remains same [sharedVmfs-0] kubevols/e2e-vmdk-1234.vmdk
func RemoveStorageClusterORFolderNameFromVDiskPath(vDiskPath string) string {
	datastore := regexp.MustCompile("\\[(.*?)\\]").FindStringSubmatch(vDiskPath)[1]
	if filepath.Base(datastore) != datastore {
		vDiskPath = strings.Replace(vDiskPath, datastore, filepath.Base(datastore), 1)
	}
	return vDiskPath
}

// GetPathFromVMDiskPath retrieves the path from VM Disk Path.
// Example: For vmDiskPath - [vsanDatastore] kubevols/volume.vmdk, the path is kubevols/volume.vmdk
func GetPathFromVMDiskPath(vmDiskPath string) string {
	datastorePathObj := new(object.DatastorePath)
	isSuccess := datastorePathObj.FromString(vmDiskPath)
	if !isSuccess {
		klog.Errorf("Failed to parse vmDiskPath: %s", vmDiskPath)
		return ""
	}
	return datastorePathObj.Path
}

//GetDatastorePathObjFromVMDiskPath gets the datastorePathObj from VM disk path.
func GetDatastorePathObjFromVMDiskPath(vmDiskPath string) (*object.DatastorePath, error) {
	datastorePathObj := new(object.DatastorePath)
	isSuccess := datastorePathObj.FromString(vmDiskPath)
	if !isSuccess {
		klog.Errorf("Failed to parse volPath: %s", vmDiskPath)
		return nil, fmt.Errorf("failed to parse volPath: %s", vmDiskPath)
	}
	return datastorePathObj, nil
}

//IsValidUUID checks if the string is a valid UUID.
func IsValidUUID(uuid string) bool {
	r := regexp.MustCompile("^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")
	return r.MatchString(uuid)
}

// IsManagedObjectNotFoundError returns true if error is of type ManagedObjectNotFound
func IsManagedObjectNotFoundError(err error) bool {
	isManagedObjectNotFoundError := false
	if soap.IsSoapFault(err) {
		_, isManagedObjectNotFoundError = soap.ToSoapFault(err).VimFault().(types.ManagedObjectNotFound)
	}
	return isManagedObjectNotFoundError
}

// IsInvalidCredentialsError returns true if error is of type InvalidLogin
func IsInvalidCredentialsError(err error) bool {
	isInvalidCredentialsError := false
	if soap.IsSoapFault(err) {
		_, isInvalidCredentialsError = soap.ToSoapFault(err).VimFault().(types.InvalidLogin)
	}
	return isInvalidCredentialsError
}

// VerifyVolumePathsForVMDevices verifies if the volume paths (volPaths) are attached to VM.
func VerifyVolumePathsForVMDevices(vmDevices object.VirtualDeviceList, volPaths []string, nodeName string, nodeVolumeMap map[string]map[string]bool) {
	volPathsMap := make(map[string]bool)
	for _, volPath := range volPaths {
		volPathsMap[volPath] = true
	}
	// Verify if the volume paths are present on the VM backing virtual disk devices
	for _, device := range vmDevices {
		if vmDevices.TypeName(device) == "VirtualDisk" {
			virtualDevice := device.GetVirtualDevice()
			if backing, ok := virtualDevice.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok {
				if volPathsMap[backing.FileName] {
					setNodeVolumeMap(nodeVolumeMap, backing.FileName, nodeName, true)
				}
			}
		}
	}

}

// isvCenterDeprecated takes vCenter version and vCenter API version as input and return true if vCenter is deprecated
func isvCenterDeprecated(vCenterVersion string, vCenterAPIVersion string) (bool, error) {
	var vcversion, vcapiversion, minvcversion vcVersion
	var err error
	err = vcversion.parse(vCenterVersion)
	if err != nil {
		return false, fmt.Errorf("failed to parse vCenter version: %s. err: %+v", vCenterVersion, err)
	}
	err = vcapiversion.parse(vCenterAPIVersion)
	if err != nil {
		return false, fmt.Errorf("failed to parse vCenter API version: %s. err: %+v", vCenterAPIVersion, err)
	}
	err = minvcversion.parse(MinvCenterVersion)
	if err != nil {
		return false, fmt.Errorf("failed to parse minimum vCenter version: %s. err: %+v", MinvCenterVersion, err)
	}
	if vcversion.isLessThan(minvcversion) && vcapiversion.isLessThan(minvcversion) {
		return true, nil
	}
	return false, nil
}

// vcVersion represents a VC version
type vcVersion struct {
	Major    int64
	Minor    int64
	Revision int64
	Build    int64
}

// parse helps parse version string to VCVersion
// returns error when parse fail
func (v *vcVersion) parse(version string) error {
	for index, value := range strings.Split(version, ".") {
		var err error
		if index == 0 {
			v.Major, err = strconv.ParseInt(value, 10, 64)
		} else if index == 1 {
			v.Minor, err = strconv.ParseInt(value, 10, 64)
		} else if index == 2 {
			v.Revision, err = strconv.ParseInt(value, 10, 64)
		} else if index == 3 {
			v.Build, err = strconv.ParseInt(value, 10, 64)
		}
		if err != nil {
			return fmt.Errorf("failed to parse version: %q, err: %v", version, err)
		}
	}
	return nil
}

// isLessThan compares VCVersion v to o and returns
// true if v is less than o
func (v *vcVersion) isLessThan(o vcVersion) bool {
	if v.Major != o.Major {
		if v.Major > o.Major {
			return false
		}
		return true
	}
	if v.Minor != o.Minor {
		if v.Minor > o.Minor {
			return false
		}
		return true
	}
	if v.Revision != o.Revision {
		if v.Revision > o.Revision {
			return false
		}
		return true
	}
	if v.Build != o.Build {
		if v.Build > o.Build {
			return false
		}
		return true
	}
	return false
}


text:
module NanoTwitter
  module Routes
    module Sessions

      def self.registered(app)

        app.post '/login' do
          name = params[:name]
          password = params[:password]
          u = User.find_by(name: name, password: password)
          unauthorized_error if u.nil?
          login(u)
          redirect '/'
        end

        app.get '/logout' do
          logout
          redirect '/'
        end

        app.get '/register' do
          output = partial( :navbar )
          output << partial( :register )
          output
        end

        app.post '/register' do
          new_user = User.new(params)
          new_user.save ? login(new_user) : internal_error
          redirect '/'
        end

      end
    end
  end
end


text:
/**
 * @coreapi
 * @module transition
 */
/** for typedoc */
import { TransitionHookPhase } from './interface';
import { defaults, noop, silentRejection } from '../common/common';
import { fnToString, maxLength } from '../common/strings';
import { isPromise } from '../common/predicates';
import { is, parse } from '../common/hof';
import { trace } from '../common/trace';
import { services } from '../common/coreservices';
import { Rejection } from './rejectFactory';
import { TargetState } from '../state/targetState';
var defaultOptions = {
    current: noop,
    transition: null,
    traceData: {},
    bind: null,
};
/** @hidden */
var TransitionHook = /** @class */ (function () {
    function TransitionHook(transition, stateContext, registeredHook, options) {
        var _this = this;
        this.transition = transition;
        this.stateContext = stateContext;
        this.registeredHook = registeredHook;
        this.options = options;
        this.isSuperseded = function () {
            return _this.type.hookPhase === TransitionHookPhase.RUN && !_this.options.transition.isActive();
        };
        this.options = defaults(options, defaultOptions);
        this.type = registeredHook.eventType;
    }
    TransitionHook.prototype.logError = function (err) {
        this.transition.router.stateService.defaultErrorHandler()(err);
    };
    TransitionHook.prototype.invokeHook = function () {
        var _this = this;
        var hook = this.registeredHook;
        if (hook._deregistered)
            return;
        var notCurrent = this.getNotCurrentRejection();
        if (notCurrent)
            return notCurrent;
        var options = this.options;
        trace.traceHookInvocation(this, this.transition, options);
        var invokeCallback = function () {
            return hook.callback.call(options.bind, _this.transition, _this.stateContext);
        };
        var normalizeErr = function (err) {
            return Rejection.normalize(err).toPromise();
        };
        var handleError = function (err) {
            return hook.eventType.getErrorHandler(_this)(err);
        };
        var handleResult = function (result) {
            return hook.eventType.getResultHandler(_this)(result);
        };
        try {
            var result = invokeCallback();
            if (!this.type.synchronous && isPromise(result)) {
                return result.catch(normalizeErr)
                    .then(handleResult, handleError);
            }
            else {
                return handleResult(result);
            }
        }
        catch (err) {
            // If callback throws (synchronously)
            return handleError(Rejection.normalize(err));
        }
        finally {
            if (hook.invokeLimit && ++hook.invokeCount >= hook.invokeLimit) {
                hook.deregister();
            }
        }
    };
    /**
     * This method handles the return value of a Transition Hook.
     *
     * A hook can return false (cancel), a TargetState (redirect),
     * or a promise (which may later resolve to false or a redirect)
     *
     * This also handles "transition superseded" -- when a new transition
     * was started while the hook was still running
     */
    TransitionHook.prototype.handleHookResult = function (result) {
        var _this = this;
        var notCurrent = this.getNotCurrentRejection();
        if (notCurrent)
            return notCurrent;
        // Hook returned a promise
        if (isPromise(result)) {
            // Wait for the promise, then reprocess with the resulting value
            return result.then(function (val) { return _this.handleHookResult(val); });
        }
        trace.traceHookResult(result, this.transition, this.options);
        // Hook returned false
        if (result === false) {
            // Abort this Transition
            return Rejection.aborted("Hook aborted transition").toPromise();
        }
        var isTargetState = is(TargetState);
        // hook returned a TargetState
        if (isTargetState(result)) {
            // Halt the current Transition and redirect (a new Transition) to the TargetState.
            return Rejection.redirected(result).toPromise();
        }
    };
    /**
     * Return a Rejection promise if the transition is no longer current due
     * to a stopped router (disposed), or a new transition has started and superseded this one.
     */
    TransitionHook.prototype.getNotCurrentRejection = function () {
        var router = this.transition.router;
        // The router is stopped
        if (router._disposed) {
            return Rejection.aborted("UIRouter instance #" + router.$id + " has been stopped (disposed)").toPromise();
        }
        if (this.transition._aborted) {
            return Rejection.aborted().toPromise();
        }
        // This transition is no longer current.
        // Another transition started while this hook was still running.
        if (this.isSuperseded()) {
            // Abort this transition
            return Rejection.superseded(this.options.current()).toPromise();
        }
    };
    TransitionHook.prototype.toString = function () {
        var _a = this, options = _a.options, registeredHook = _a.registeredHook;
        var event = parse("traceData.hookType")(options) || "internal", context = parse("traceData.context.state.name")(options) || parse("traceData.context")(options) || "unknown", name = fnToString(registeredHook.callback);
        return event + " context: " + context + ", " + maxLength(200, name);
    };
    /**
     * Chains together an array of TransitionHooks.
     *
     * Given a list of [[TransitionHook]] objects, chains them together.
     * Each hook is invoked after the previous one completes.
     *
     * #### Example:
     * ```js
     * var hooks: TransitionHook[] = getHooks();
     * let promise: Promise<any> = TransitionHook.chain(hooks);
     *
     * promise.then(handleSuccess, handleError);
     * ```
     *
     * @param hooks the list of hooks to chain together
     * @param waitFor if provided, the chain is `.then()`'ed off this promise
     * @returns a `Promise` for sequentially invoking the hooks (in order)
     */
    TransitionHook.chain = function (hooks, waitFor) {
        // Chain the next hook off the previous
        var createHookChainR = function (prev, nextHook) {
            return prev.then(function () { return nextHook.invokeHook(); });
        };
        return hooks.reduce(createHookChainR, waitFor || services.$q.when());
    };
    /**
     * Invokes all the provided TransitionHooks, in order.
     * Each hook's return value is checked.
     * If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned.
     * If no hook returns a promise, then all hooks are processed synchronously.
     *
     * @param hooks the list of TransitionHooks to invoke
     * @param doneCallback a callback that is invoked after all the hooks have successfully completed
     *
     * @returns a promise for the async result, or the result of the callback
     */
    TransitionHook.invokeHooks = function (hooks, doneCallback) {
        for (var idx = 0; idx < hooks.length; idx++) {
            var hookResult = hooks[idx].invokeHook();
            if (isPromise(hookResult)) {
                var remainingHooks = hooks.slice(idx + 1);
                return TransitionHook.chain(remainingHooks, hookResult)
                    .then(doneCallback);
            }
        }
        return doneCallback();
    };
    /**
     * Run all TransitionHooks, ignoring their return value.
     */
    TransitionHook.runAllHooks = function (hooks) {
        hooks.forEach(function (hook) { return hook.invokeHook(); });
    };
    /**
     * These GetResultHandler(s) are used by [[invokeHook]] below
     * Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])
     */
    TransitionHook.HANDLE_RESULT = function (hook) { return function (result) {
        return hook.handleHookResult(result);
    }; };
    /**
     * If the result is a promise rejection, log it.
     * Otherwise, ignore the result.
     */
    TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) {
        isPromise(result) && result.catch(function (err) {
            return hook.logError(Rejection.normalize(err));
        });
        return undefined;
    }; };
    /**
     * These GetErrorHandler(s) are used by [[invokeHook]] below
     * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])
     */
    TransitionHook.LOG_ERROR = function (hook) { return function (error) {
        return hook.logError(error);
    }; };
    TransitionHook.REJECT_ERROR = function (hook) { return function (error) {
        return silentRejection(error);
    }; };
    TransitionHook.THROW_ERROR = function (hook) { return function (error) {
        throw error;
    }; };
    return TransitionHook;
}());
export { TransitionHook };
//# sourceMappingURL=transitionHook.js.map


text:
package com.piggate.samples.PiggateLogin;

import android.app.Activity;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;

import com.loopj.android.http.RequestParams;
import com.piggate.sdk.Piggate;

import org.apache.http.Header;
import org.json.JSONArray;
import org.json.JSONObject;

/*
Activity for login into the application
The activity have two fields, user email and password, and a submit button
*/
public class Activity_SingUp extends Activity {
    EditText editEmail;
    EditText editPass;
    Piggate _piggate; //Object of the Piggate class
    private boolean handledClick = false; //Handles click in buttons

    //Method onCreate for the activity
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        _piggate=new Piggate(this,null); //Initialize the Piggate object

        setContentView(R.layout.activity_register);
        //EditTexts for user email and password
        editEmail = (EditText) findViewById(R.id.editText1);
        editPass = (EditText) findViewById(R.id.editText2);
        final ImageButton return_button = (ImageButton)findViewById(R.id.return1);
        Button register = (Button)findViewById(R.id.buttonregister2);

        //Handles the top left back button of the activity
        return_button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });

        //OnClick listener for the login button
        //Handles the login request to the server with the email and password fields
        register.setOnClickListener(new View.OnClickListener(){
            @Override
            synchronized public void onClick(View v) {
                if (!handledClick) {
                    handledClick = true;
                    String email = editEmail.getText().toString();
                    String pass = editPass.getText().toString();

                    //If the internet connection is working
                    if (checkInternetConnection() == true) {
                        RequestParams params = new RequestParams();
                        params.put("email", email);
                        params.put("password", pass);

                        //Request of the Piggate object. Handles the login into the application with the user email and password
                        _piggate.RequestNewUser(params).setListenerRequest(new Piggate.PiggateCallBack() {

                            //Method onComplete for JSONObject
                            //When the request is correct start Activity_Logged activity
                            @Override
                            public void onComplete(int statusCode, Header[] headers, String msg, JSONObject data) {
                                Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();
                                Intent slideactivity = new Intent(Activity_SingUp.this, Activity_Logged.class);
                                Bundle bndlanimation =
                                        ActivityOptions.makeCustomAnimation(getApplicationContext(), R.anim.flip1, R.anim.flip2).toBundle();
                                startActivity(slideactivity, bndlanimation);
                            }

                            //Method onError for JSONObject
                            //If there's an error with the request displays the error message to the user
                            @Override
                            public void onError(int statusCode, Header[] headers, String msg, JSONObject data) {
                                Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();
                            }

                            //Method onComplete for JSONArray
                            @Override
                            public void onComplete(int statusCode, Header[] headers, String msg, JSONArray data) {
                                //Unused
                            }

                            //Method onError for JSONArray
                            @Override
                            public void onError(int statusCode, Header[] headers, String msg, JSONArray data) {
                                //Unused
                            }
                        }).exec();
                    } else { //If the internet connection is not working
                        Toast.makeText(getApplicationContext(), "Network is not working", Toast.LENGTH_LONG).show();
                    }
                }
            }
        });
    }

    //Method onResume of the activity
    @Override
    protected void onResume(){
        super.onStart();
        handledClick = false;
    }

    //Check if the internet connection is working
    private boolean checkInternetConnection(){
        Context context=this;
        ConnectivityManager conMgr = (ConnectivityManager) getSystemService (context.CONNECTIVITY_SERVICE);
        if (conMgr.getActiveNetworkInfo() != null && conMgr.getActiveNetworkInfo().isAvailable() && conMgr.getActiveNetworkInfo().isConnected())
            return true;
        else
            return false;
    }
}


text: <!DOCTYPE html>


text:
/**
 * @file
 * @brief Segment Routing MPLS data structures definitions
 *
 */

#ifndef included_vnet_srmpls_h
#define included_vnet_srmpls_h

#include <vnet/vnet.h>
#include <vnet/mpls/packet.h>
#include <vnet/fib/mpls_fib.h>
#include <vnet/ip/ip.h>
#include <vnet/ip/lookup.h>
#include <vnet/dpo/dpo.h>
#include <vnet/dpo/replicate_dpo.h>

#include <stdlib.h>
#include <string.h>

/* SR policy types */
#define SR_POLICY_TYPE_DEFAULT 0
#define SR_POLICY_TYPE_SPRAY 1

#define SR_SEGMENT_LIST_WEIGHT_DEFAULT 1

#define SR_STEER_IPV4 4
#define SR_STEER_IPV6 6

#define SR_TE_CO_BITS_00 0
#define SR_TE_CO_BITS_01 1
#define SR_TE_CO_BITS_10 2
#define SR_TE_CO_BITS_11 3

/**
 * @brief SR Segment List (SID list)
 */
typedef struct
{
  /* SIDs (key) */
  mpls_label_t *segments;

  /* SID list weight (wECMP / UCMP) */
  u32 weight;

} mpls_sr_sl_t;

typedef struct
{
  u32 *segments_lists;			/**< Pool of SID lists indexes */

  mpls_label_t bsid;		/**< BindingSID (key) */

  u8 type;			/**< Type (default is 0) */
  /* SR Policy specific DPO                                       */
  /* IF Type = DEFAULT Then Load-Balancer DPO among SID lists     */
  /* IF Type = SPRAY then Spray DPO with all SID lists            */

  ip46_address_t endpoint;		/**< Optional NH for SR TE */
  u8 endpoint_type;
  u32 color;			/**< Optional color for SR TE */
} mpls_sr_policy_t;

/**
 * @brief Steering db key
 *
 * L3 is IPv4/IPv6 + mask
 */
typedef struct
{
  ip46_address_t prefix;	/**< IP address of the prefix */
  u32 mask_width;			/**< Mask width of the prefix */
  u32 fib_table;			/**< VRF of the prefix */
  u8 traffic_type;			/**< Traffic type (IPv4, IPv6, L2) */
  u8 padding[3];
} sr_mpls_steering_key_t;

typedef struct
{
  sr_mpls_steering_key_t classify;		/**< Traffic classification */
  mpls_label_t bsid;		/**< SR Policy index */
  ip46_address_t next_hop;		/**< SR TE NH */
  char nh_type;
  u32 *color;			/**< Vector of SR TE colors */
  char co_bits;			/**< Color-Only bits */
  mpls_label_t vpn_label;
} mpls_sr_steering_policy_t;

/**
 * @brief Segment Routing main datastructure
 */
typedef struct
{
  /* SR SID lists */
  mpls_sr_sl_t *sid_lists;

  /* SR MPLS policies */
  mpls_sr_policy_t *sr_policies;

  /* Hash table mapping BindingSID to SR MPLS policy */
  uword *sr_policies_index_hash;

  /* Pool of SR steer policies instances */
  mpls_sr_steering_policy_t *steer_policies;

  /* MHash table mapping steering rules to SR steer instance */
  mhash_t sr_steer_policies_hash;

  /** SR TE **/
  /* Hash table mapping (Color->Endpoint->BSID) for SR policies */
  mhash_t sr_policies_c2e2eclabel_hash;
  /* SR TE (internal) fib table (Endpoint, Color) */
  u32 fib_table_EC;
  /* Pool of (Endpoint, Color) hidden labels */
  u32 *ec_labels;

  /* convenience */
  vlib_main_t *vlib_main;
  vnet_main_t *vnet_main;
} mpls_sr_main_t;

extern mpls_sr_main_t sr_mpls_main;

extern int
sr_mpls_policy_add (mpls_label_t bsid, mpls_label_t * segments,
		    u8 behavior, u32 weight);

extern int
sr_mpls_policy_mod (mpls_label_t bsid, u8 operation,
		    mpls_label_t * segments, u32 sl_index, u32 weight);

extern int sr_mpls_policy_del (mpls_label_t bsid);

extern int
sr_mpls_policy_assign_endpoint_color (mpls_label_t bsid,
				      ip46_address_t * endpoint,
				      u8 endpoint_type, u32 color);

extern int
sr_mpls_steering_policy_add (mpls_label_t bsid, u32 table_id,
			     ip46_address_t * prefix, u32 mask_width,
			     u8 traffic_type, ip46_address_t * next_hop,
			     u8 nh_type, u32 color, char co_bits,
			     mpls_label_t vpn_label);

extern int
sr_mpls_steering_policy_del (ip46_address_t * prefix,
			     u32 mask_width, u8 traffic_type, u32 table_id,
			     u32 color);

extern u32 find_or_create_internal_label (ip46_address_t endpoint, u32 color);

extern void internal_label_lock (ip46_address_t endpoint, u32 color);

extern void internal_label_unlock (ip46_address_t endpoint, u32 color);

#endif /* included_vnet_sr_mpls_h */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables: eval: (c-set-style "gnu") End:
 */


text:
{% extends "base.html" %}

{% block page_title %}Video Production Services{% endblock %}
{% block class %}services{% endblock %}

{% block content %}

Let us handle the workflow so you can focus on being creative.

Production Services

Ohio HD Video offers a broad range of production services that cover everything from "script to screen."  We work with clients to produce commercials, business-to-business projects, broadcast television, music video, sports, narrative, internet videos.

On-Set Services

We know the production world has become a lot more complicated during the past few years. New cameras, formats, codecs, and gamma curves have made it necessary to rethink how we shoot, manage, edit, grade, and deliver footage.  Ohio HD Video is here with solutions for on-set data management, video playback, and color grading services. Let us handle the workflow while you handle the creative.

Color Grading

Data Management

Camera Setup + More!

Learn more about our workflow solutions:

				Contact Us

{% endblock %}


text:
function save_options() {
  var questions = document.getElementById("questionsJson").value;
  console.log(localStorage.okcpDefaultQuestions);
  localStorage.okcpDefaultQuestions = questions;
  console.log('after');
  console.log(localStorage.okcpDefaultQuestions);

  var statusOutput = document.getElementById("statusOutput");
  statusOutput.innerHTML =localStorage.okcpDefaultQuestions;

  // Update status to let user know options were saved.
  var status = document.getElementById("status");
  status.innerHTML = "Options Saved.";
  setTimeout(function() {
    status.innerHTML = "";
  }, 750);
}

document.querySelector('#save').addEventListener('click', save_options);


text: Create interactive overlay guides for you Angular app with this tool suite.


text:
<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
	<display-name>Archetype Created Web Application</display-name>
	<servlet>
		<servlet-name>Data Source Handler</servlet-name>
		<servlet-class>org.wso2.carbon.http.servlet.objectdetector.DataSourceHandler</servlet-class>
	</servlet>
	<servlet>
		<servlet-name>Image Display</servlet-name>
		<servlet-class>org.wso2.carbon.http.servlet.objectdetector.ImageDisplay</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>Data Source Handler</servlet-name>
		<url-pattern>/imageshow</url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>Image Display</servlet-name>
		<url-pattern>/displayImage</url-pattern>
	</servlet-mapping>

</web-app>


text:
package com.pivotal.gemfirexd.internal.impl.jdbc;

import org.apache.derbyTesting.functionTests.util.streams.CharAlphabet;
import org.apache.derbyTesting.functionTests.util.streams.LoopingAlphabetReader;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Test basic operations on a small temporary Clob.
 * <p>
 * The test is intended to use sizes that makes the Clob stay in memory (i.e.
 * it is not being pushed to disk due to size).
 */
public class SmallTemporaryClobTest
    extends InternalClobTest {

    private static final long CLOBLENGTH = 1027;
    private static final long BYTES_PER_CHAR = 3;

    public SmallTemporaryClobTest(String name) {
        super(name);
    }

    /**
     * Creates a small read-write Clob that is kept in memory.
     */
    public void setUp()
            throws Exception {
        super.initialCharLength = CLOBLENGTH;
        super.initialByteLength = CLOBLENGTH *3; // All tamil letters.
        super.bytesPerChar = BYTES_PER_CHAR;
        EmbedStatement embStmt = (EmbedStatement)createStatement();
        EmbedConnection embCon =(EmbedConnection)getConnection();
        iClob = new TemporaryClob(embCon.getDBName(), embStmt);
        transferData(
            new LoopingAlphabetReader(CLOBLENGTH, CharAlphabet.tamil()),
            iClob.getWriter(1L),
            CLOBLENGTH);
        assertEquals(CLOBLENGTH, iClob.getCharLength());
    }

    public void tearDown()
            throws Exception {
        this.iClob.release();
        this.iClob = null;
        super.tearDown();
    }

    public static Test suite()
            throws Exception {
        Class<? extends TestCase> theClass = SmallTemporaryClobTest.class;
        TestSuite suite = new TestSuite(theClass, "SmallTemporaryClobTest suite");
        suite.addTest(addModifyingTests(theClass));
        return suite;
    }

} // End class SmallTemporaryClobTest


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

using System.Data;
using PetaPoco;
using sl.model;

namespace sl.service.manager
{
    public class HRAManagerService
    {
        /// <summary>
        /// 单例模式DB
        /// </summary>
        public static readonly Database database = new Database("ConnectionString");

        #region 用户相关

        #region 获取用户列表
        public static Sql GetUserSql(string uLoginName)
        {
            Sql sql = Sql.Builder;

            uLoginName = "%" + uLoginName + "%";

            sql.Append("Select T_UserType.uLoginTypeValue,");
            sql.Append("T_User.pkId,");
            sql.Append("T_User.uLoginName,");
            sql.Append("T_User.uLoginTypeID,"); //不能少,重置的时候要用
            sql.Append("T_User.uPassword,");
            sql.Append("T_User.uUserName,");
            sql.Append("T_User.uPhone,");
            sql.Append("T_User.uMaiBox");
            sql.Append(" from T_User,T_UserType where uLoginName Like @0 and T_User.isDeleted = 0", uLoginName);
            sql.Append(" and T_UserType.uLoginTypeID = T_User.uLoginTypeID");
            return sql;
        }

        #endregion

        #region 检查用户是否存在
        public static T_User CheckUserExist(string uLoginName)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select * from T_User where uLoginName = @0", uLoginName);
            return database.FirstOrDefault<T_User>(sql);
        }
        #endregion

        #region 用户登录
        public static T_User CheckLogin(string name, string passwordMd5)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select * from T_User where uLoginName=@0 and uPassword = @1", name, passwordMd5);

            return database.FirstOrDefault<T_User>(sql);
        }

        #endregion

        // <summary>
        /// 根据邮箱获取用户
        /// </summary>
        /// <param name="mail"></param>
        /// <returns></returns>
        public static T_User GetUserByMail(string uMaiBox)
        {
            Sql sql = Sql.Builder;
            sql.Append("select * from T_User where uMaiBox = @0", uMaiBox);
            T_User user = database.FirstOrDefault<T_User>(sql);
            return user;
        }

        /// <summary>
        /// 根据手机号获取用户
        /// </summary>
        /// <param name="uPhone"></param>
        /// <returns></returns>
        public static T_User GetUserByPhone(string uPhone)
        {
            Sql sql = Sql.Builder;
            sql.Append("select * from T_User where uPhone = @0", uPhone);
            T_User user = database.FirstOrDefault<T_User>(sql);
            return user;
        }

        #endregion

        #region 会员相关
        #region 获取会员列表
        public static Sql GetMemberSql(string mName, string mReviewResultID)
        {
            Sql sql = Sql.Builder;

            mName = "%" + mName + "%";
            mReviewResultID = "%" + mReviewResultID + "%";
            sql.Append("Select T_ReviewResult.mReviewResultValue,T_MemberType.mTypeValue,");
            sql.Append("T_Member.pkId,");
            sql.Append("T_Member.uLoginName,");
            sql.Append("T_Member.mReviewResultID,");
            sql.Append("T_Member.mTypeID,");
            sql.Append("T_Member.mApplyTime,");
            sql.Append("T_Member.mName,");
            sql.Append("T_Member.mOrganizationCode,");
            sql.Append("T_Member.mAddress,");
            sql.Append("T_Member.mCorporateName,");
            sql.Append("T_Member.mIDCardNo,");
            sql.Append("T_Member.mContacts,");
            sql.Append("T_Member.mContactsphone,");
            sql.Append("T_Member.mImgURL,");
            sql.Append("T_Member.mURL");
            sql.Append(" from T_Member,T_ReviewResult,T_MemberType where T_Member.mName Like @0 and T_Member.mReviewResultID Like @1 and T_Member.isDeleted = 0", mName, mReviewResultID);
            sql.Append(" and T_Member.mReviewResultID = T_ReviewResult.mReviewResultID and T_Member.mTypeID = T_MemberType.mTypeID");
            return sql;
        }

        #region 检查会员是否存在
        public static T_Member CheckMemberExist(string id)
        {
            Sql sql = Sql.Builder.Append("Select * from T_Member Where pkId = @0", id);
            return database.FirstOrDefault<T_Member>(sql);
        }

        #region 检查用户是否存在
        public static T_Member CheckMemberNameExist(string mName)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select * from T_Member where mName = @0", mName);
            return database.FirstOrDefault<T_Member>(sql);
        }
        #endregion
        #endregion

        #endregion
        #endregion

        #region 发布相关
        public static Sql GetPublishSql(string uLoginName)
        {
            Sql sql = Sql.Builder;

            uLoginName = "%" + uLoginName + "%";

            sql.Append("Select T_PMType.pmTypeValue,");
            sql.Append("T_PublishManage.pkId,");
            sql.Append("T_PublishManage.pmTypeID,");
            sql.Append("T_PublishManage.uLoginName,");
            sql.Append("SUBSTRING(REPLACE(CAST(T_PublishManage.pmTitle as nvarchar(4000)),' ',''),0,20)+'...'  as pmTitle,");
            sql.Append("T_PublishManage.pmADImgListID,");
            sql.Append("T_PublishManage.pmPublishTime,");
            //sql.Append("SUBSTRING(REPLACE(CAST(T_PublishManage.pmText as nvarchar(4000)),' ',''),0,20)+'...'  as pmText,"); //文章内容太长
            sql.Append("T_PublishManage.pmViews,");
            sql.Append("T_PublishManage.pmPreview");
            sql.Append(" from T_PMType,T_PublishManage where uLoginName Like @0 and T_PublishManage.isDeleted = 0", uLoginName);
            sql.Append(" and T_PMType.pmTypeID = T_PublishManage.pmTypeID");
            return sql;
        }

        /// <summary>
        /// 导出前N条 默认全部
        /// </summary>
        /// <param name="num"></param>
        /// <returns></returns>
        public static List<PublishExportInfo> ExportTopPublish(int num = -1)
        {
            Sql sql = Sql.Builder;
            if (num == -1)
            {
                sql.Append("Select T_PMType.pmTypeValue,");
                sql.Append(" T_User.uUserName,");
                sql.Append("T_PublishManage.uLoginName,");
                sql.Append("T_PublishManage.pmTitle,");
                sql.Append("T_PublishManage.pmADImgListID,");
                sql.Append("T_PublishManage.pmPublishTime,");
                sql.Append("T_PublishManage.pmText,");
                sql.Append("T_PublishManage.pmViews,");
                sql.Append("T_PublishManage.pmPreview");
                sql.Append(" from T_PMType,T_PublishManage,T_User where T_PublishManage.isDeleted = 0");
                sql.Append(" and T_PMType.pmTypeID = T_PublishManage.pmTypeID");
                sql.Append(" and T_User.uLoginName = T_PublishManage.uLoginName");

            }
            else
            {
                sql.Append("Select top " + num);
                sql.Append(" T_PMType.pmTypeValue,");
                sql.Append(" T_User.uUserName,");
                sql.Append("T_PublishManage.uLoginName,");
                sql.Append("T_PublishManage.pmTitle,");
                sql.Append("T_PublishManage.pmADImgListID,");
                sql.Append("T_PublishManage.pmPublishTime,");
                sql.Append("T_PublishManage.pmText,");
                sql.Append("T_PublishManage.pmViews,");
                sql.Append("T_PublishManage.pmPreview");
                sql.Append(" from T_PMType,T_PublishManage,T_User where T_PublishManage.isDeleted = 0");
                sql.Append(" and T_PMType.pmTypeID = T_PublishManage.pmTypeID");
                sql.Append(" and T_User.uLoginName = T_PublishManage.uLoginName");
            }

            List<PublishExportInfo> list = database.Fetch<PublishExportInfo>(sql);
            return list;
        }

        public static List<PublishExportInfo> ExportSelectedPublishByID(string pkId)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select T_PMType.pmTypeValue,");
            sql.Append(" T_User.uUserName,");
            sql.Append("T_PublishManage.uLoginName,");
            sql.Append("T_PublishManage.pmTitle,");
            sql.Append("T_PublishManage.pmADImgListID,");
            sql.Append("T_PublishManage.pmPublishTime,");
            sql.Append("T_PublishManage.pmText,");
            sql.Append("T_PublishManage.pmViews,");
            sql.Append("T_PublishManage.pmPreview");
            sql.Append(" from T_PMType,T_PublishManage,T_User where T_PublishManage.isDeleted = 0");
            sql.Append(" and T_PMType.pmTypeID = T_PublishManage.pmTypeID");
            sql.Append(" and T_User.uLoginName = T_PublishManage.uLoginName");
            sql.Append(" and T_PublishManage.pkId = @0", pkId);
            return database.Fetch<PublishExportInfo>(sql);
        }

        public static List<T_ADImgList> GetPublishADIMGS(string pmADImgListID)
        {
            Sql sql = Sql.Builder;
            sql.Select("*");
            sql.From("T_ADImgList");
            sql.Where("pmADImgListID = @0", pmADImgListID);
            return database.Fetch<T_ADImgList>(sql);

        }

        #endregion

        #region 下载相关

        #region 获取下载列表Sql
        public static Sql GetDownloadSql(string dmTitle)
        {
            Sql sql = Sql.Builder;

            dmTitle = "%" + dmTitle + "%";

            sql.Append("Select T_DMType.dmTypeValue,");
            sql.Append("T_DownloadManage.pkId,");
            sql.Append("T_DownloadManage.dmTypeID,");
            sql.Append("T_DownloadManage.uLoginName,");
            sql.Append("T_DownloadManage.dmTitle,");
            sql.Append("T_DownloadManage.dmFileURL,");
            sql.Append("T_DownloadManage.dmDownloadNum,");
            sql.Append("T_DownloadManage.dmUploadTime");
            sql.Append(" from T_DMType,T_DownloadManage where uLoginName Like @0 and T_DownloadManage.isDeleted = 0", dmTitle);
            sql.Append(" and T_DMType.dmTypeID = T_DownloadManage.dmTypeID");
            return sql;
        }
        #endregion

        #region 根据pkId获取单个下载
        public static Sql GetDownloadByIDSql(string id)
        {
            Sql sql = Sql.Builder.Append("Select * from T_DownloadManage Where pkId = @0", id);
            return sql;
        }
        #endregion

        #region 根据typeID获取类型value
        public static string GetDownloadValueByID(string dmTypeID)
        {
            Sql sql = Sql.Builder.Append("Select * from T_DMType Where dmTypeID = @0", dmTypeID);
            T_DMType temp = database.FirstOrDefault<T_DMType>(sql);
            return temp.dmTypeValue;
        }
        #endregion

        #endregion

        #region 友情链接相关
        public static Sql GetLinksSql(string flName)
        {
            Sql sql = Sql.Builder;
            flName = "%" + flName + "%";
            sql.Select("T_FriendlyLink.pkId,T_FriendlyLink.uLoginName,"
                + "T_FriendlyLink.flName,T_FriendlyLink.flURL,"
                + "T_FriendlyLink.flImgURL,T_FriendlyLink.flAddTime,"
                 + "T_FriendlyLink.flTypeID,T_FLType.flTypeValue");
            sql.From("T_FriendlyLink,T_FLType");
            sql.Where("flName Like @0 and T_FriendlyLink.flTypeID = T_FLType.flTypeID and T_FriendlyLink.isDeleted = 0", flName);
            return sql;
        }
        #endregion

        #region 类型管理相关

        #region 查询用户类型
        public static List<T_UserType> GetUserTypeList()
        {
            List<T_UserType> userTypes = new List<T_UserType>();
            Sql sql = Sql.Builder;
            sql.Select("*")
                .From("T_UserType")
                .Where("isDeleted = 0")
                .OrderBy("uLoginTypeValue asc");
            userTypes = database.Fetch<T_UserType>(sql);
            return userTypes;
        }

        public static Sql GetUserTypeSql(string uLoginTypeValue)
        {
            Sql sql = Sql.Builder;

            uLoginTypeValue = "%" + uLoginTypeValue + "%";
            sql.Append("Select * from T_UserType where uLoginTypeValue Like @0 and isDeleted = 0", uLoginTypeValue);
            return sql;
        }

        #endregion

        #region 查询会员审核结果
        public static List<T_ReviewResult> GetReviewResults()
        {
            List<T_ReviewResult> reviewResults = new List<T_ReviewResult>();
            Sql sql = Sql.Builder;
            sql.Select("*")
                .From("T_ReviewResult")
                .Where("isDeleted = 0")
                .OrderBy("mReviewResultID asc");
            reviewResults = database.Fetch<T_ReviewResult>(sql);
            return reviewResults;
        }

        public static Sql GetReviewResultSql(string reviewResultValue)
        {
            Sql sql = Sql.Builder;
            reviewResultValue = "%" + reviewResultValue + "%";
            sql.Append("Select * from T_ReviewResult where mReviewResultValue Like @0 and isDeleted = 0", reviewResultValue);
            return sql;
        }
        #endregion

        #region 查询会员类型
        public static List<T_MemberType> GetMemberTypes()
        {
            List<T_MemberType> reviewResults = new List<T_MemberType>();
            Sql sql = Sql.Builder;
            sql.Select("*")
                .From("T_MemberType")
                .Where("isDeleted = 0")
                .OrderBy("mTypeID asc");
            reviewResults = database.Fetch<T_MemberType>(sql);
            return reviewResults;
        }

        public static Sql GetMemberTypeSql(string mTypeValue)
        {
            Sql sql = Sql.Builder;
            mTypeValue = "%" + mTypeValue + "%";
            sql.Append("Select * from T_MemberType where mTypeValue Like @0 and isDeleted = 0", mTypeValue);
            return sql;
        }
        #endregion

        #region 查询下载类型
        public static List<T_DMType> GetDownloadTypeList()
        {
            List<T_DMType> types = new List<T_DMType>();
            Sql sql = Sql.Builder;
            sql.Select("*")
                .From("T_DMType")
                .Where("isDeleted = 0")
                .OrderBy("dmTypeValue asc");
            types = database.Fetch<T_DMType>(sql);
            return types;
        }

        public static Sql GetDownloadTypeSql(string dmTypeValue)
        {
            Sql sql = Sql.Builder;
            dmTypeValue = "%" + dmTypeValue + "%";
            sql.Append("Select * from T_DMType where dmTypeValue Like @0 and isDeleted = 0", dmTypeValue);
            return sql;
        }
        #endregion

        #region 查询发布类型
        public static List<T_PMType> GetPublishTypes()
        {
            List<T_PMType> publishTypes = new List<T_PMType>();
            Sql sql = Sql.Builder;
            sql.Select("*")
                .From("T_PMType")
                .Where("isDeleted = 0")
                .OrderBy("pmTypeID asc");
            publishTypes = database.Fetch<T_PMType>(sql);
            return publishTypes;
        }

        public static Sql GetPublishTypeSql(string pmTypeValue)
        {
            Sql sql = Sql.Builder;
            pmTypeValue = "%" + pmTypeValue + "%";
            sql.Append("Select * from T_PMType where pmTypeValue Like @0 and isDeleted = 0", pmTypeValue);
            return sql;
        }
        #endregion

        #region 查询友情链接类型

        public static List<T_FLType> GetFLTypeList()
        {
            List<T_FLType> flTypes = new List<T_FLType>();
            Sql sql = Sql.Builder;
            sql.Select("*")
                .From("T_FLType")
                .Where("isDeleted = 0")
                .OrderBy("flTypeValue asc");
            flTypes = database.Fetch<T_FLType>(sql);
            return flTypes;
        }

        public static Sql GetFLTypeSql(string flTypeValue)
        {
            Sql sql = Sql.Builder;
            flTypeValue = "%" + flTypeValue + "%";
            sql.Append("Select * from T_FLType where flTypeValue Like @0 and isDeleted = 0", flTypeValue);
            return sql;
        }
        #endregion

        #region 是否存在于表中
        public static int ExistInTable(string tableName, string selectRow, string selectRowValue)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select count(*) from " + tableName + " where " + selectRow + "=@0", selectRowValue);

            return database.FirstOrDefault<int>(sql);
        }
        #endregion

        #region 通用的删除方法
        public static void CommonDelete(string refTableName, string refSelectRow, string typeNoID, string value)
        {
            Sql sql = Sql.Builder;
            sql.Append("UPDATE " + refTableName + " SET " + refSelectRow + " =@0 WHERE " + refSelectRow + " = @1", typeNoID, value);
            database.Execute(sql);
        }
        #endregion

        #region 检查用户类型是否存在
        public static T_UserType UserTypeIsExist(string typeValue)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select * from T_UserType where uLoginTypeValue = @0", typeValue);
            T_UserType result = database.FirstOrDefault<T_UserType>(sql);
            return result;
        }
        #endregion

        #region 检查下载类型是否存在
        public static T_DMType DownloadTypeIsExist(string typeValue)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select * from T_DMType where dmTypeValue = @0", typeValue);
            T_DMType result = database.FirstOrDefault<T_DMType>(sql);
            return result;
        }
        #endregion

        #region 检查发布类型是否存在
        public static T_PMType PublishTypeIsExist(string typeValue)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select * from T_PMType where pmTypeValue = @0", typeValue);
            T_PMType result = database.FirstOrDefault<T_PMType>(sql);
            return result;
        }
        #endregion

        #region 检查审核结果是否存在
        public static T_ReviewResult ReviewResultIsExist(string typeValue)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select * from T_ReviewResult where mReviewResultValue = @0", typeValue);
            T_ReviewResult result = database.FirstOrDefault<T_ReviewResult>(sql);
            return result;
        }
        #endregion

        #region 检查会员类型是否存在
        public static T_MemberType MemberTypetIsExist(string typeValue)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select * from T_MemberType where mTypeValue = @0", typeValue);
            T_MemberType result = database.FirstOrDefault<T_MemberType>(sql);
            return result;
        }
        #endregion

        #region 检查友情链接类型是否存在
        public static T_FLType FLTypetIsExist(string typeValue)
        {
            Sql sql = Sql.Builder;
            sql.Append("Select * from T_FLType where flTypeValue = @0", typeValue);
            T_FLType result = database.FirstOrDefault<T_FLType>(sql);
            return result;
        }
        #endregion

        #endregion

    }
}


text:
import axios from 'axios'
import {setDefaultHeader, removeDefaultHeader} from '../../utils/manage-headers'
import sha256 from '../../utils/sha256'
import {SET_CURRENT_USER} from '../types'

export default function register (data) {
  return dispatch => {
    const params = {
      username: data.username,
      passwordHash: sha256(data.password),
      firstName: data.firstName,
      lastName: data.lastName
    }

    return axios.post('/api/auth/register', params)
    .then(res => {
      const sessionKey = res.data.token
      const userData = res.data.publicUserData
      localStorage.setItem('sessionKey', sessionKey)
      setDefaultHeader('Authentication', sessionKey)

      dispatch(setCurrentUser(userData))
    })
    .catch(error => {
      removeDefaultHeader('Authentication')
      localStorage.removeItem('sessionKey')
      dispatch(setCurrentUser(null))

      if (Array.isArray(error)) {
        error = error.map(err => `${err.context.key} is invalid`).join('\n')
      }

      throw error
    })
  }
}

function setCurrentUser (userData) {
  return {
    type: SET_CURRENT_USER,
    userData
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class com.compsci408.rxcore.Controller</title>
<meta name="date" content="2014-12-11">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
com.compsci408.rxcore.Controller

Packages that use Controller

Package
Description

com.compsci408.rxcore

Uses of Controller in com.compsci408.rxcore

Fields in com.compsci408.rxcore declared as Controller

Modifier and Type
Field and Description

static Controller
Controller.instance

Methods in com.compsci408.rxcore that return Controller

Modifier and Type
Method and Description

static Controller
Controller.getInstance(Context ctxt)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
package com.github.sawied.ws.model.hub;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author wang
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "RespePayload")
public class RespePayload {

    /***/
    @XmlElement(name = "OpDefRespe")
    private OpDefRespe opDefRespe;

    public OpDefRespe getOpDefRespe() {
        return opDefRespe;
    }

    public void setOpDefRespe(OpDefRespe opDefRespe) {
        this.opDefRespe = opDefRespe;
    }

    @Override
    public String toString() {
        return "RespePayload [opDefRespe=" + opDefRespe + "]";
    }

}


text:
@interface SEGTuneIntegrationFactory : NSObject<SEGIntegrationFactory>

+ (instancetype)instance;

@end


text:
package org.springframework.boot.autoconfigure.codec;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.util.unit.DataSize;

/**
 * {@link ConfigurationProperties properties} for reactive codecs.
 *
 * @author Brian Clozel
 * @since 2.2.1
 */
@ConfigurationProperties(prefix = "spring.codec")
public class CodecProperties {

	/**
	 * Limit on the number of bytes that can be buffered whenever the input stream needs
	 * to be aggregated. By default this is not set, in which case individual codec
	 * defaults apply. Most codecs are limited to 256K by default.
	 */
	private DataSize maxInMemorySize;

	public DataSize getMaxInMemorySize() {
		return this.maxInMemorySize;
	}

	public void setMaxInMemorySize(DataSize maxInMemorySize) {
		this.maxInMemorySize = maxInMemorySize;
	}

}


text:
<!DOCTYPE HTML>

        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="1;url=http://crowdtilt.com/campaigns/ragemas-2013">

        <title>Page Redirection</title>

        If you are not redirected automatically, follow the link to Ragemas on Crowdtilt.


text:
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:keepScreenOn="true"/>
    <!-- xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.polyglotprogramminginc.revealjs.MainActivity"
    tools:ignore="MergeRootFrame" /-->


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

namespace ModelDemo.Models
{
    public class ModelDemoContext : DbContext
    {
        public ModelDemoContext() : base("name=ModelDemoContext")
        {
        }

        public DbSet<Album> Albums { get; set; }

        public DbSet<Artist> Artists { get; set; }

        public DbSet<Genre> Genres { get; set; }
    }
}


text:
<?php

/**
 * This class defines the structure of the 'attachment' table.
 *
 *
 * This class was autogenerated by Propel 1.4.1 on:
 *
 * Tue Apr  6 21:36:04 2010
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    lib.model.map
 */
class AttachmentTableMap extends TableMap {

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'lib.model.map.AttachmentTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
	  // attributes
		$this->setName('attachment');
		$this->setPhpName('Attachment');
		$this->setClassname('Attachment');
		$this->setPackage('lib.model');
		$this->setUseIdGenerator(true);
		// columns
		$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
		$this->addForeignKey('ARTICLE_ID', 'ArticleId', 'INTEGER', 'article', 'ID', false, null, null);
		$this->addColumn('NAME', 'Name', 'VARCHAR', false, 255, null);
		$this->addColumn('FILE', 'File', 'VARCHAR', false, 255, null);
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
    $this->addRelation('Article', 'Article', RelationMap::MANY_TO_ONE, array('article_id' => 'id', ), null, null);
	} // buildRelations()

	/**
	 *
	 * Gets the list of behaviors registered for this table
	 *
	 * @return array Associative array (name => parameters) of behaviors
	 */
	public function getBehaviors()
	{
		return array(
			'symfony' => array('form' => 'true', 'filter' => 'true', ),
			'symfony_behaviors' => array(),
		);
	} // getBehaviors()

} // AttachmentTableMap


text:
namespace editor
{
class UserStats
{
public:
  UserStats();
  UserStats(time_t const updateTime, uint32_t const rating,
            uint32_t const changesCount, string const & levelUpFeat);

  bool IsValid() const { return m_valid; }

  operator bool() const { return IsValid(); }

  bool GetChangesCount(int32_t & changesCount) const;
  bool GetRank(int32_t & rank) const;
  bool GetLevelUpRequiredFeat(string & levelUpFeat);

  time_t GetLastUpdate() const { return m_updateTime; }

private:
  int32_t m_changesCount;
  int32_t m_rank;
  time_t m_updateTime;
  /// A very doubtful field representing what a user must commit to have a better rank.
  string m_levelUpRequiredFeat;
  bool m_valid;
};

class UserStatsLoader
{
public:
  using TOnUpdateCallback = function<void()>;

  UserStatsLoader();

  /// Synchronously sends request to the server. Updates stats and returns true on success.
  bool Update(string const & userName);

  /// Launch the update process if stats are too old.
  /// The process posts fn to a gui thread on success.
  void Update(string const & userName, TOnUpdateCallback fn);

  /// Resets internal state and removes records from settings.
  void DropStats(string const & userName);

  /// Atomically returns stats if userName is still actual.
  UserStats GetStats(string const & userName) const;

  /// Debug only.
  string GetUserName() const;

private:
  /// Not thread-safe, but called only in constructor.
  bool LoadFromSettings();
  /// Not thread-safe, use synchonization.
  void SaveToSettings();
  void DropSettings();

  string m_userName;

  time_t m_lastUpdate;
  mutable mutex m_mutex;

  UserStats m_userStats;
};
}  // namespace editor


text:
var http = require("http");
var url = require("url");
var router = require("./router");

http.createServer(function (request,response) {

    if(request.url!='/favicon.ico'){
        pathname = url.parse(request.url).pathname;
        pathname = pathname.replace(/\//,'');
        try{
            router[pathname](request,response);

        }catch(err){
            console.log("异常:"+err);
            response.writeHead(200,{'Content-Type':'text/html;charset=utf-8'});
            response.write(err.toString());
            response.end();
        }
        console.log("执行完毕!");
    }
}).listen(8000);
console.log("正在监听8000.........");