text:
#ifndef MetroInfoH
#define MetroInfoH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class PACKAGE TMetroInfo : public TGraphicControl
{
private:
protected:
public:
  __fastcall TMetroInfo(TComponent* Owner);
__published:
};
//---------------------------------------------------------------------------
#endif


text:
package gov.nih.nci.evs.browser.servlet;

/**
 * @author EVS Team
 * @version 1.0
 *
 * Modification history
 *     Initial implementation kim.ong@ngc.com
 *
 */

import org.json.*;
import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;
import gov.nih.nci.evs.browser.utils.*;
import org.apache.log4j.*;

import gov.nih.nci.evs.browser.bean.LicenseBean;
import gov.nih.nci.evs.browser.properties.NCImBrowserProperties.*;
import gov.nih.nci.evs.browser.utils.NCImMetadataUtils;
import gov.nih.nci.evs.browser.common.*;
import gov.nih.nci.evs.browser.properties.*;

import org.LexGrid.LexBIG.LexBIGService.LexBIGService;

public final class RedirectServlet extends HttpServlet {
    private static Logger _logger = Logger.getLogger(RedirectServlet.class);

    /**
     * Validates the Init and Context parameters, configures authentication URL
     *
     * @throws ServletException if the init parameters are invalid or any other
     *         problems occur during initialisation
     */
    public void init() throws ServletException {

    }

    /**
     * Route the user to the execute method
     *
     * @param request The HTTP request we are processing
     * @param response The HTTP response we are creating
     *
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet exception occurs
     */
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {
        execute(request, response);
    }

    /**
     * Route the user to the execute method
     *
     * @param request The HTTP request we are processing
     * @param response The HTTP response we are creating
     *
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet exception occurs
     */
    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {
        execute(request, response);
    }

    /**
     * Process the specified HTTP request, and create the corresponding HTTP
     * response (or forward to another web component that will create it).
     *
     * @param request The HTTP request we are processing
     * @param response The HTTP response we are creating
     *
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet exception occurs
     */

    public void execute(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

		LicenseBean licenseBean = (LicenseBean) request.getSession().getAttribute("licenseBean");
		if (licenseBean == null) {
		    licenseBean = new LicenseBean();
		    request.getSession().setAttribute("licenseBean", licenseBean);
		}

        String nciterm_browser_url = NCImBrowserProperties.getTermBrowserURL();

        //KLO, 020413
        String action = HTTPUtils.cleanXSS((String) request.getParameter("action"));
        String dictionary = HTTPUtils.cleanXSS((String) request.getParameter("dictionary"));
        String code = HTTPUtils.cleanXSS((String) request.getParameter("code"));
        String term_source = HTTPUtils.cleanXSS((String) request.getParameter("sab"));
        String type = HTTPUtils.cleanXSS((String) request.getParameter("type"));

	    boolean licenseAgreementAccepted = false;
	    //LexBIGService lbSvc = RemoteServerUtil.createLexBIGService();
	    String formal_name = NCImMetadataUtils.getSABFormalName(term_source);
	    boolean isLicensed = DataUtils.checkIsLicensed(term_source);

	    String cs_name = Constants.CODING_SCHEME_NAME;

	    if (term_source != null && isLicensed ) {
	        //formal_name = MetadataUtils.getSABFormalName(term_source);
	        licenseAgreementAccepted = licenseBean.licenseAgreementAccepted(formal_name);
	    }

	    if (!isLicensed) {
	        licenseAgreementAccepted = true;
	    }

        if (action.equals("details")) {
		      if (!licenseAgreementAccepted) {
				  String url = request.getContextPath() + "/pages/accept_license.jsf?"
														+ "dictionary=" + formal_name
														+ "&code=" + code;
				  response.sendRedirect(response.encodeRedirectURL(url));

 	          } else {

				  String url = nciterm_browser_url + "/ConceptReport.jsp?"
														+ "dictionary=" + formal_name
														+ "&code=" + code
														+ "&type=" + type
														+ "&sortBy=name#SynonymsDetails";

				  response.sendRedirect(response.encodeRedirectURL(url));
              }

		} else if (action.equals("tree")) {
		      if (!licenseAgreementAccepted) {

				  String url = request.getContextPath() + "/pages/accept_license.jsf?"
														+ "dictionary=" + formal_name
														+ "&code=" + code
														+ "&sab=" + term_source
														+ "&type=hierarchy";

				  response.sendRedirect(response.encodeRedirectURL(url));

	          } else {
				  String url = request.getContextPath() + "/pages/source_hierarchy.jsf?"
														+ "dictionary=" + dictionary
														+ "&code=" + code
														+ "&sab=" + term_source
														+ "&type=hierarchy";

				  response.sendRedirect(response.encodeRedirectURL(url));

			  }
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.geode.modules.session.catalina.callback;

import javax.servlet.http.HttpSession;

import org.apache.geode.cache.CacheLoader;
import org.apache.geode.cache.CacheLoaderException;
import org.apache.geode.cache.Declarable;
import org.apache.geode.cache.LoaderHelper;
import org.apache.geode.cache.Region;

public class LocalSessionCacheLoader implements CacheLoader<String, HttpSession>, Declarable {

  private final Region<String, HttpSession> backingRegion;

  public LocalSessionCacheLoader(Region<String, HttpSession> backingRegion) {
    this.backingRegion = backingRegion;
  }

  @Override
  public HttpSession load(LoaderHelper<String, HttpSession> helper) throws CacheLoaderException {
    return backingRegion.get(helper.getKey());
  }

  @Override
  public void close() {}
}


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/text"
        style="@style/MediumText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:indeterminate="true"
        android:padding="8dp" />

</LinearLayout>


text:
function EyeDropperColorPickerController($scope, angularHelper) {

    var vm = this;

    //setup the default config
    var config = {
        showAlpha: true,
        showPalette: true,
        allowEmpty: true
    };

    // map the user config
    Utilities.extend(config, $scope.model.config);

    // map back to the model
    $scope.model.config = config;

    vm.options = $scope.model.config;

    vm.color = $scope.model.value || null;

    vm.selectColor = function (color) {
        angularHelper.safeApply($scope, function () {
            vm.color = color ? color.toString() : null;
            $scope.model.value = vm.color;
            $scope.propertyForm.selectedColor.$setViewValue(vm.color);
        });
    };

    // Method required by the valPropertyValidator directive (returns true if the property editor has at least one color selected)
    $scope.validateMandatory = function () {
        var isValid = !$scope.model.validation.mandatory || (
            $scope.model.value != null
            && $scope.model.value != "");

        return {
            isValid: isValid,
            errorMsg: $scope.model.validation.mandatoryMessage || "Value cannot be empty",
            errorKey: "required"
        };
    };
}

angular.module("umbraco").controller("Umbraco.PropertyEditors.EyeDropperColorPickerController", EyeDropperColorPickerController);


text:
package com.google.cloud.dlp.v2beta1.stub;

import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
import com.google.privacy.dlp.v2beta1.AnalyzeDataSourceRiskRequest;
import com.google.privacy.dlp.v2beta1.CreateInspectOperationRequest;
import com.google.privacy.dlp.v2beta1.DeidentifyContentRequest;
import com.google.privacy.dlp.v2beta1.DeidentifyContentResponse;
import com.google.privacy.dlp.v2beta1.InspectContentRequest;
import com.google.privacy.dlp.v2beta1.InspectContentResponse;
import com.google.privacy.dlp.v2beta1.InspectOperationMetadata;
import com.google.privacy.dlp.v2beta1.InspectOperationResult;
import com.google.privacy.dlp.v2beta1.ListInfoTypesRequest;
import com.google.privacy.dlp.v2beta1.ListInfoTypesResponse;
import com.google.privacy.dlp.v2beta1.ListInspectFindingsRequest;
import com.google.privacy.dlp.v2beta1.ListInspectFindingsResponse;
import com.google.privacy.dlp.v2beta1.ListRootCategoriesRequest;
import com.google.privacy.dlp.v2beta1.ListRootCategoriesResponse;
import com.google.privacy.dlp.v2beta1.RedactContentRequest;
import com.google.privacy.dlp.v2beta1.RedactContentResponse;
import com.google.privacy.dlp.v2beta1.RiskAnalysisOperationMetadata;
import com.google.privacy.dlp.v2beta1.RiskAnalysisOperationResult;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS
/**
 * Base stub class for DLP API.
 *
 * <p>This class is for advanced usage and reflects the underlying API directly.
 */
@Generated("by GAPIC v0.0.5")
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public abstract class DlpServiceStub implements BackgroundResource {

  public OperationsStub getOperationsStub() {
    throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
  }

  public UnaryCallable<InspectContentRequest, InspectContentResponse> inspectContentCallable() {
    throw new UnsupportedOperationException("Not implemented: inspectContentCallable()");
  }

  public UnaryCallable<RedactContentRequest, RedactContentResponse> redactContentCallable() {
    throw new UnsupportedOperationException("Not implemented: redactContentCallable()");
  }

  public UnaryCallable<DeidentifyContentRequest, DeidentifyContentResponse>
      deidentifyContentCallable() {
    throw new UnsupportedOperationException("Not implemented: deidentifyContentCallable()");
  }

  public OperationCallable<
          AnalyzeDataSourceRiskRequest, RiskAnalysisOperationResult, RiskAnalysisOperationMetadata>
      analyzeDataSourceRiskOperationCallable() {
    throw new UnsupportedOperationException(
        "Not implemented: analyzeDataSourceRiskOperationCallable()");
  }

  public UnaryCallable<AnalyzeDataSourceRiskRequest, Operation> analyzeDataSourceRiskCallable() {
    throw new UnsupportedOperationException("Not implemented: analyzeDataSourceRiskCallable()");
  }

  public OperationCallable<
          CreateInspectOperationRequest, InspectOperationResult, InspectOperationMetadata>
      createInspectOperationOperationCallable() {
    throw new UnsupportedOperationException(
        "Not implemented: createInspectOperationOperationCallable()");
  }

  public UnaryCallable<CreateInspectOperationRequest, Operation> createInspectOperationCallable() {
    throw new UnsupportedOperationException("Not implemented: createInspectOperationCallable()");
  }

  public UnaryCallable<ListInspectFindingsRequest, ListInspectFindingsResponse>
      listInspectFindingsCallable() {
    throw new UnsupportedOperationException("Not implemented: listInspectFindingsCallable()");
  }

  public UnaryCallable<ListInfoTypesRequest, ListInfoTypesResponse> listInfoTypesCallable() {
    throw new UnsupportedOperationException("Not implemented: listInfoTypesCallable()");
  }

  public UnaryCallable<ListRootCategoriesRequest, ListRootCategoriesResponse>
      listRootCategoriesCallable() {
    throw new UnsupportedOperationException("Not implemented: listRootCategoriesCallable()");
  }
}


text:
package google_devtools_clouderrorreporting_v1beta1 // import "google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1"

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "google.golang.org/genproto/googleapis/api/serviceconfig"

import (
	context "golang.org/x/net/context"
	grpc "google.golang.org/grpc"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// A request to return an individual group.
type GetGroupRequest struct {
	// [Required] The group resource name. Written as
	// projects/<var>projectID</var>/groups/<var>group_name</var>.
	// Call
	//
	// groupStats.list to return a list of groups belonging to
	// this project.
	//
	// Example: projects/my-project-123/groups/my-group
	GroupName string `protobuf:"bytes,1,opt,name=group_name,json=groupName" json:"group_name,omitempty"`
}

func (m *GetGroupRequest) Reset()                    { *m = GetGroupRequest{} }
func (m *GetGroupRequest) String() string            { return proto.CompactTextString(m) }
func (*GetGroupRequest) ProtoMessage()               {}
func (*GetGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }

// A request to replace the existing data for the given group.
type UpdateGroupRequest struct {
	// [Required] The group which replaces the resource on the server.
	Group *ErrorGroup `protobuf:"bytes,1,opt,name=group" json:"group,omitempty"`
}

func (m *UpdateGroupRequest) Reset()                    { *m = UpdateGroupRequest{} }
func (m *UpdateGroupRequest) String() string            { return proto.CompactTextString(m) }
func (*UpdateGroupRequest) ProtoMessage()               {}
func (*UpdateGroupRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }

func (m *UpdateGroupRequest) GetGroup() *ErrorGroup {
	if m != nil {
		return m.Group
	}
	return nil
}

func init() {
	proto.RegisterType((*GetGroupRequest)(nil), "google.devtools.clouderrorreporting.v1beta1.GetGroupRequest")
	proto.RegisterType((*UpdateGroupRequest)(nil), "google.devtools.clouderrorreporting.v1beta1.UpdateGroupRequest")
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion3

// Client API for ErrorGroupService service

type ErrorGroupServiceClient interface {
	// Get the specified group.
	GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*ErrorGroup, error)
	// Replace the data for the specified group.
	// Fails if the group does not exist.
	UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*ErrorGroup, error)
}

type errorGroupServiceClient struct {
	cc *grpc.ClientConn
}

func NewErrorGroupServiceClient(cc *grpc.ClientConn) ErrorGroupServiceClient {
	return &errorGroupServiceClient{cc}
}

func (c *errorGroupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*ErrorGroup, error) {
	out := new(ErrorGroup)
	err := grpc.Invoke(ctx, "/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/GetGroup", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *errorGroupServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*ErrorGroup, error) {
	out := new(ErrorGroup)
	err := grpc.Invoke(ctx, "/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/UpdateGroup", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for ErrorGroupService service

type ErrorGroupServiceServer interface {
	// Get the specified group.
	GetGroup(context.Context, *GetGroupRequest) (*ErrorGroup, error)
	// Replace the data for the specified group.
	// Fails if the group does not exist.
	UpdateGroup(context.Context, *UpdateGroupRequest) (*ErrorGroup, error)
}

func RegisterErrorGroupServiceServer(s *grpc.Server, srv ErrorGroupServiceServer) {
	s.RegisterService(&_ErrorGroupService_serviceDesc, srv)
}

func _ErrorGroupService_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetGroupRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ErrorGroupServiceServer).GetGroup(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/GetGroup",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ErrorGroupServiceServer).GetGroup(ctx, req.(*GetGroupRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ErrorGroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateGroupRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ErrorGroupServiceServer).UpdateGroup(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/google.devtools.clouderrorreporting.v1beta1.ErrorGroupService/UpdateGroup",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ErrorGroupServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _ErrorGroupService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "google.devtools.clouderrorreporting.v1beta1.ErrorGroupService",
	HandlerType: (*ErrorGroupServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetGroup",
			Handler:    _ErrorGroupService_GetGroup_Handler,
		},
		{
			MethodName: "UpdateGroup",
			Handler:    _ErrorGroupService_UpdateGroup_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: fileDescriptor1,
}

func init() {
	proto.RegisterFile("google.golang.org/genproto/googleapis/devtools/clouderrorreporting/v1beta1/error_group_service.proto", fileDescriptor1)
}

var fileDescriptor1 = []byte{
	// 358 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x52, 0xcd, 0x4a, 0x2b, 0x31,
	0x14, 0x66, 0xee, 0xe5, 0x5e, 0x6e, 0xd3, 0xc5, 0xc5, 0x2c, 0x44, 0x06, 0x04, 0xe9, 0x4a, 0x5b,
	0x48, 0x6c, 0x5d, 0x28, 0xa2, 0x08, 0x05, 0x29, 0x22, 0x4a, 0xa9, 0x88, 0xcb, 0x92, 0xce, 0x1c,
	0xc3, 0xc8, 0x4c, 0xce, 0x98, 0xa4, 0xdd, 0x88, 0x1b, 0x1f, 0xc0, 0x8d, 0xaf, 0xe2, 0x0b, 0xf8,
	0x0c, 0xbe, 0x82, 0x0f, 0x22, 0x93, 0xb4, 0x56, 0x5b, 0x05, 0xa7, 0xb8, 0xfd, 0x72, 0xf2, 0xfd,
	0x9d, 0x43, 0x62, 0x89, 0x28, 0x53, 0x60, 0x12, 0x53, 0xa1, 0x24, 0x43, 0x2d, 0xb9, 0x04, 0x95,
	0x6b, 0xb4, 0xc8, 0xfd, 0x93, 0xc8, 0x13, 0xc3, 0x63, 0x18, 0x59, 0xc4, 0xd4, 0xf0, 0x28, 0xc5,
	0x61, 0x0c, 0x5a, 0xa3, 0xd6, 0x90, 0xa3, 0xb6, 0x89, 0x92, 0x7c, 0xd4, 0x1c, 0x80, 0x15, 0x4d,
	0xee, 0xe0, 0xbe, 0xd4, 0x38, 0xcc, 0xfb, 0x06, 0xf4, 0x28, 0x89, 0x80, 0x39, 0x26, 0xda, 0x18,
	0xab, 0x4c, 0x68, 0xd8, 0x27, 0x34, 0x6c, 0x4c, 0x13, 0x1e, 0x7d, 0xcf, 0x92, 0xc8, 0x13, 0x3e,
	0x56, 0x89, 0x50, 0x5d, 0x26, 0x92, 0x0b, 0xa5, 0xd0, 0x0a, 0x9b, 0xa0, 0x32, 0x5e, 0x37, 0xbc,
	0xf8, 0xc1, 0x74, 0x11, 0x66, 0x19, 0x2a, 0x4f, 0x5c, 0xdb, 0x24, 0xff, 0x3b, 0x60, 0x3b, 0x45,
	0xd4, 0x1e, 0x5c, 0x0f, 0xc1, 0x58, 0xba, 0x4a, 0x88, 0x8f, 0xae, 0x44, 0x06, 0x2b, 0xc1, 0x5a,
	0xb0, 0x5e, 0xe9, 0x55, 0x1c, 0x72, 0x2a, 0x32, 0xa8, 0x45, 0x84, 0x9e, 0xe7, 0xb1, 0xb0, 0xf0,
	0xe1, 0xd3, 0x09, 0xf9, 0xe3, 0x46, 0xdc, 0x7c, 0xb5, 0xb5, 0xcd, 0x4a, 0x14, 0xc5, 0x0e, 0x0b,
	0xd8, 0xd3, 0x79, 0x96, 0xd6, 0xfd, 0x6f, 0xb2, 0x34, 0x45, 0xcf, 0x7c, 0x3b, 0xf4, 0x31, 0x20,
	0xff, 0x26, 0x6e, 0xe9, 0x5e, 0x29, 0x89, 0x99, 0x90, 0xe1, 0xa2, 0x06, 0x6b, 0xcd, 0xbb, 0xe7,
	0x97, 0x87, 0x5f, 0x0d, 0xba, 0xf1, 0xd6, 0xe7, 0xcd, 0xb4, 0xad, 0xfd, 0x5c, 0xe3, 0x15, 0x44,
	0xd6, 0xf0, 0x3a, 0x77, 0xa8, 0xe1, 0xf5, 0x5b, 0xfa, 0x14, 0x90, 0xea, 0xbb, 0xca, 0xe8, 0x41,
	0x29, 0xed, 0xf9, 0xb2, 0x17, 0x37, 0xbf, 0xe3, 0xcc, 0xb7, 0xc2, 0x59, 0xf3, 0xec, 0x4b, 0xf3,
	0xbb, 0x7e, 0x21, 0xed, 0x63, 0x52, 0xdc, 0x4d, 0x19, 0xdd, 0xf6, 0xf2, 0xdc, 0x02, 0xbb, 0xc5,
	0xc9, 0x75, 0x83, 0xc1, 0x5f, 0x77, 0x7b, 0x5b, 0xaf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x68,
	0x09, 0x8a, 0xb4, 0x03, 0x00, 0x00,
}


text:
local Component = require(script.Parent.Component)

-------------------------
----- Bar Component -----
-------------------------
local Bar = {}
setmetatable(Bar, { __index = Component })
Bar.__index = Component.__index
Bar.__newindex = Component.__newindex

Bar.Directions = {
	Horizontal = 1;
	Vertical = 2;
}

Bar.Origins = {
	Start = 1;
	End = 2;
	Middle = 3;
}

function Bar.new(parent)
	-- Object tree creation
	local root = Instance.new("Frame", parent)
	root.Name = "Bar"
	root.BackgroundColor3 = Color3.new(1, 1, 1)
	root.Size = UDim2.new(0, 100, 0, 5)

	local realBar = Instance.new("Frame", root)
	realBar.Name = "Real"
	realBar.BackgroundColor3 = Color3.new(0, 0, 0)
	realBar.BorderSizePixel = 0

	-- Object creation
	local super = Component.new(root)
	local self = setmetatable(super, Bar)
	self.Bar = realBar
	self._min = 0
	self._max = 1
	self._value = 0
	self._direction = Bar.Directions.Horizontal
	self._origin = Bar.Origins.Start
	self.AnimationTime = 0.2

	return self
end

-----------------------------
----- Bar Class Methods -----
-----------------------------
function Bar:_update()
	local percentage = self._value - self._min / self._max - self._min
	local position = UDim2.new(0, 0, 0, 0)
end

--------------------------------
----- Bar Class Properties -----
--------------------------------
function Bar:set_ZIndex(value)
	self.RootObject.ZIndex = value
	self.RootObject.Real.ZIndex = value
end

return Bar


text:
package elastic

import (
	"testing"

	"golang.org/x/net/context"
)

func TestCountURL(t *testing.T) {
	client := setupTestClientAndCreateIndex(t)

	tests := []struct {
		Indices  []string
		Types    []string
		Expected string
	}{
		{
			[]string{},
			[]string{},
			"/_all/_count",
		},
		{
			[]string{},
			[]string{"tweet"},
			"/_all/tweet/_count",
		},
		{
			[]string{"twitter-*"},
			[]string{"tweet", "follower"},
			"/twitter-%2A/tweet%2Cfollower/_count",
		},
		{
			[]string{"twitter-2014", "twitter-2015"},
			[]string{"tweet", "follower"},
			"/twitter-2014%2Ctwitter-2015/tweet%2Cfollower/_count",
		},
	}

	for _, test := range tests {
		path, _, err := client.Count().Index(test.Indices...).Type(test.Types...).buildURL()
		if err != nil {
			t.Fatal(err)
		}
		if path != test.Expected {
			t.Errorf("expected %q; got: %q", test.Expected, path)
		}
	}
}

func TestCount(t *testing.T) {
	client := setupTestClientAndCreateIndex(t)

	tweet1 := tweet{User: "olivere", Message: "Welcome to Golang and Elasticsearch."}
	tweet2 := tweet{User: "olivere", Message: "Another unrelated topic."}
	tweet3 := tweet{User: "sandrae", Message: "Cycling is fun."}

	// Add all documents
	_, err := client.Index().Index(testIndexName).Type("tweet").Id("1").BodyJson(&tweet1).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	_, err = client.Index().Index(testIndexName).Type("tweet").Id("2").BodyJson(&tweet2).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	_, err = client.Index().Index(testIndexName).Type("tweet").Id("3").BodyJson(&tweet3).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	_, err = client.Flush().Index(testIndexName).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}

	// Count documents
	count, err := client.Count(testIndexName).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}
	if count != 3 {
		t.Errorf("expected Count = %d; got %d", 3, count)
	}

	// Count documents
	count, err = client.Count(testIndexName).Type("tweet").Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}
	if count != 3 {
		t.Errorf("expected Count = %d; got %d", 3, count)
	}

	// Count documents
	count, err = client.Count(testIndexName).Type("gezwitscher").Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}
	if count != 0 {
		t.Errorf("expected Count = %d; got %d", 0, count)
	}

	// Count with query
	query := NewTermQuery("user", "olivere")
	count, err = client.Count(testIndexName).Query(query).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}
	if count != 2 {
		t.Errorf("expected Count = %d; got %d", 2, count)
	}

	// Count with query and type
	query = NewTermQuery("user", "olivere")
	count, err = client.Count(testIndexName).Type("tweet").Query(query).Do(context.TODO())
	if err != nil {
		t.Fatal(err)
	}
	if count != 2 {
		t.Errorf("expected Count = %d; got %d", 2, count)
	}
}


text:
<?php
require_once __DIR__ . '/../library/Zend/_autoload.php';
if (!class_exists('Zend\Controller\Action')) {
    echo "Could not find action class?\n";
} else {
    echo "Found action class!\n";
}
if (!class_exists('Zend\Version')) {
    echo "Could not find version class?\n";
} else {
    echo "Found version class!\n";
}


text: module.exports = '/__open-in-editor'


text:
fox-page-content {
  display: block;
  -webkit-overflow-scrolling: touch;
  overflow: auto;
  background-color: #fff;
  -webkit-box-flex: 1;
  -webkit-flex: 1;
}


text:
#include "ndpi_api.h"

#ifdef NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV

static void ndpi_int_veohtv_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
					   struct ndpi_flow_struct *flow, ndpi_protocol_type_t protocol_type)
{
  ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, protocol_type);
}

void ndpi_search_veohtv_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
	struct ndpi_packet_struct *packet = &flow->packet;

//      struct ndpi_id_struct         *src=ndpi_struct->src;
//      struct ndpi_id_struct         *dst=ndpi_struct->dst;

	if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV)
		return;

	if (flow->l4.tcp.veoh_tv_stage == 1 || flow->l4.tcp.veoh_tv_stage == 2) {
		if (packet->packet_direction != flow->setup_packet_direction &&
			packet->payload_packet_len > NDPI_STATICSTRING_LEN("HTTP/1.1 20")
			&& memcmp(packet->payload, "HTTP/1.1 ", NDPI_STATICSTRING_LEN("HTTP/1.1 ")) == 0 &&
			(packet->payload[NDPI_STATICSTRING_LEN("HTTP/1.1 ")] == '2' ||
			 packet->payload[NDPI_STATICSTRING_LEN("HTTP/1.1 ")] == '3' ||
			 packet->payload[NDPI_STATICSTRING_LEN("HTTP/1.1 ")] == '4' ||
			 packet->payload[NDPI_STATICSTRING_LEN("HTTP/1.1 ")] == '5')) {
#ifdef NDPI_CONTENT_FLASH
			ndpi_parse_packet_line_info(ndpi_struct, flow);
			if (packet->detected_protocol_stack[0] == NDPI_CONTENT_FLASH &&
				packet->server_line.ptr != NULL &&
				packet->server_line.len > NDPI_STATICSTRING_LEN("Veoh-") &&
				memcmp(packet->server_line.ptr, "Veoh-", NDPI_STATICSTRING_LEN("Veoh-")) == 0) {
				NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "VeohTV detected.\n");
				ndpi_int_veohtv_add_connection(ndpi_struct, flow, NDPI_CORRELATED_PROTOCOL);
				return;
			}
#endif
			if (flow->l4.tcp.veoh_tv_stage == 2) {
				NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask,
											   NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV);
				return;
			}
			NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "VeohTV detected.\n");
			ndpi_int_veohtv_add_connection(ndpi_struct, flow, NDPI_CORRELATED_PROTOCOL);
			return;
		} else if (flow->packet_direction_counter[(flow->setup_packet_direction == 1) ? 0 : 1] > 3) {
			if (flow->l4.tcp.veoh_tv_stage == 2) {
				NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask,
											   NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV);
				return;
			}
			NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "VeohTV detected.\n");
			ndpi_int_veohtv_add_connection(ndpi_struct, flow, NDPI_CORRELATED_PROTOCOL);
			return;
		} else {
			if (flow->packet_counter > 10) {
				if (flow->l4.tcp.veoh_tv_stage == 2) {
					NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask,
												   NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV);
					return;
				}
				NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "VeohTV detected.\n");
				ndpi_int_veohtv_add_connection(ndpi_struct, flow, NDPI_CORRELATED_PROTOCOL);
				return;
			}
			return;
		}
	} else if (packet->udp) {
		/* UDP packets from Veoh Client Player
		 *
		 * packet starts with 16 byte random? value
		 * then a 4 byte mode value
		 *   values between 21 and 26 has been seen
		 * then a 4 byte counter */

		if (packet->payload_packet_len == 28 &&
			get_u_int32_t(packet->payload, 16) == htonl(0x00000021) &&
			get_u_int32_t(packet->payload, 20) == htonl(0x00000000) && get_u_int32_t(packet->payload, 24) == htonl(0x01040000)) {
			NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, ndpi_struct, NDPI_LOG_DEBUG, "UDP VeohTV found.\n");
			ndpi_int_veohtv_add_connection(ndpi_struct, flow, NDPI_REAL_PROTOCOL);
			return;
		}
	}

	NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV);
}
#endif


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

    <EditText
        android:id="@+id/et_high_humidity"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:hint="@string/dialog_et_high_humidity"
        android:inputType="number" />

    <EditText
        android:id="@+id/et_low_humidity"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:hint="@string/dialog_et_low_humidity"
        android:inputType="number" />

</LinearLayout>


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

<TITLE>
Uses of Class org.apache.poi.xssf.streaming.SXSSFWorkbook (POI API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.poi.xssf.streaming.SXSSFWorkbook

Packages that use SXSSFWorkbook

org.apache.poi.xssf.streaming

Uses of SXSSFWorkbook in org.apache.poi.xssf.streaming

Methods in org.apache.poi.xssf.streaming that return SXSSFWorkbook

 SXSSFWorkbook
SXSSFSheet.getWorkbook()

          Return the parent workbook

Methods in org.apache.poi.xssf.streaming with parameters of type SXSSFWorkbook

static SXSSFEvaluationWorkbook
SXSSFEvaluationWorkbook.create(SXSSFWorkbook book)

static SXSSFFormulaEvaluator
SXSSFFormulaEvaluator.create(SXSSFWorkbook workbook,
       IStabilityClassifier stabilityClassifier,
       UDFFinder udfFinder)

static void
SXSSFFormulaEvaluator.evaluateAllFormulaCells(SXSSFWorkbook wb,
                        boolean skipOutOfWindow)

          For active worksheets only, will loop over rows and
  cells, evaluating formula cells there.

Constructors in org.apache.poi.xssf.streaming with parameters of type SXSSFWorkbook

SXSSFCreationHelper(SXSSFWorkbook workbook)

SXSSFFormulaEvaluator(SXSSFWorkbook workbook)

SXSSFSheet(SXSSFWorkbook workbook,
           XSSFSheet xSheet)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

                Copyright 2016 The Apache Software Foundation or
        its licensors, as applicable.


text:
// Copyright 2018 Joyent, Inc.  All rights reserved.

var test = require('tape').test;

var sshpk = require('../lib/index');
var fs = require('fs');
var path = require('path');
var crypto = require('crypto');
var sinon = require('sinon');
var asn1 = require('asn1');
var SSHBuffer = require('../lib/ssh-buffer');

var testDir = path.join(__dirname, 'assets');

var GEORGE_KEY, GEORGE_SSH, GEORGE_X509;
var BARRY_KEY;
var JIM_KEY, JIM_SSH, JIM_X509, JIM_X509_TXT;
var EC_KEY, EC_KEY2;
var SUE_KEY;

test('setup', function (t) {
	var d = fs.readFileSync(path.join(testDir, 'id_dsa'));
	GEORGE_KEY = sshpk.parseKey(d);
	GEORGE_SSH = fs.readFileSync(path.join(testDir, 'george-openssh.pub'));
	GEORGE_X509 = fs.readFileSync(path.join(testDir, 'george-x509.pem'));

	d = fs.readFileSync(path.join(testDir, 'id_dsa2'));
	BARRY_KEY = sshpk.parsePrivateKey(d);

	d = fs.readFileSync(path.join(testDir, 'id_rsa'));
	JIM_KEY = sshpk.parsePrivateKey(d);

	JIM_SSH = fs.readFileSync(path.join(testDir, 'jim-openssh.pub'));
	JIM_X509 = fs.readFileSync(path.join(testDir, 'jim-x509.pem'));
	JIM_X509_TXT = fs.readFileSync(path.join(testDir, 'jim-x509-text.pem'));

	d = fs.readFileSync(path.join(testDir, 'id_ecdsa'));
	EC_KEY = sshpk.parsePrivateKey(d);
	d = fs.readFileSync(path.join(testDir, 'id_ecdsa2'));
	EC2_KEY = sshpk.parsePrivateKey(d);

	d = fs.readFileSync(path.join(testDir, 'id_ed25519'));
	SUE_KEY = sshpk.parsePrivateKey(d);

	t.end();
});

test('dsa openssh cert self-signed', function (t) {
	var cert = sshpk.parseCertificate(GEORGE_SSH, 'openssh');
	t.ok(sshpk.Certificate.isCertificate(cert));

	t.ok(GEORGE_KEY.fingerprint().matches(cert.subjectKey));
	t.ok(cert.isSignedByKey(GEORGE_KEY));
	t.ok(!cert.isSignedByKey(BARRY_KEY));

	t.ok(!cert.isExpired(new Date('2016-07-22T00:00:00Z')));
	t.ok(cert.isExpired(new Date('2001-07-01T00:00:00Z')));
	t.ok(cert.isExpired(new Date('2017-07-23T00:00:00Z')));

	t.strictEqual(cert.subjects.length, 1);
	t.strictEqual(cert.subjects[0].toString(), 'UID=george');
	t.strictEqual(cert.subjects[0].type, 'user');
	t.strictEqual(cert.subjects[0].uid, 'george');

	t.throws(function () {
		cert.fingerprint();
	});
	t.end();
});

test('dsa x509 cert self-signed', function (t) {
	var cert = sshpk.parseCertificate(GEORGE_X509, 'pem');
	t.ok(sshpk.Certificate.isCertificate(cert));

	t.ok(GEORGE_KEY.fingerprint().matches(cert.subjectKey));
	t.ok(cert.isSignedByKey(GEORGE_KEY));
	t.ok(!cert.isSignedByKey(BARRY_KEY));

	t.ok(!cert.isExpired(new Date('2016-07-22T00:00:00Z')));
	t.ok(cert.isExpired(new Date('2001-07-01T00:00:00Z')));
	t.ok(cert.isExpired(new Date('2017-07-23T00:00:00Z')));

	t.strictEqual(cert.subjects.length, 1);
	t.strictEqual(cert.subjects[0].toString(), 'UID=george');
	t.strictEqual(cert.subjects[0].type, 'user');
	t.strictEqual(cert.subjects[0].uid, 'george');

	var fp = sshpk.parseFingerprint(
	    'SHA256:rPrIM16iuYN1UkWprtIkRaUzerKz0JkNd/FjKG7OJCU',
	    { type: 'certificate '});
	t.ok(fp.matches(cert));
	t.end();
});

test('rsa openssh cert self-signed', function (t) {
	var cert = sshpk.parseCertificate(JIM_SSH, 'openssh');
	t.ok(sshpk.Certificate.isCertificate(cert));

	t.ok(JIM_KEY.fingerprint().matches(cert.subjectKey));
	t.ok(cert.isSignedByKey(JIM_KEY));
	t.ok(!cert.isSignedByKey(BARRY_KEY));

	t.ok(!cert.isExpired(new Date('2016-07-23T00:00:00Z')));
	t.ok(cert.isExpired(new Date('2001-07-01T00:00:00Z')));
	t.ok(cert.isExpired(new Date('2017-07-23T00:00:00Z')));

	t.strictEqual(cert.subjects.length, 1);
	t.strictEqual(cert.subjects[0].toString(), 'CN=jim.com');
	t.strictEqual(cert.subjects[0].type, 'host');
	t.strictEqual(cert.subjects[0].hostname, 'jim.com');

	t.ok(cert.issuer.equals(cert.subjects[0]));

	t.end();
});

test('rsa x509 cert self-signed', function (t) {
	var cert = sshpk.parseCertificate(JIM_X509, 'pem');
	t.ok(sshpk.Certificate.isCertificate(cert));

	t.ok(JIM_KEY.fingerprint().matches(cert.subjectKey));
	t.ok(cert.isSignedByKey(JIM_KEY));
	t.ok(!cert.isSignedByKey(BARRY_KEY));

	t.ok(!cert.isExpired(new Date('2016-07-23T00:00:00Z')));
	t.ok(cert.isExpired(new Date('2001-07-01T00:00:00Z')));
	t.ok(cert.isExpired(new Date('2017-07-23T00:00:00Z')));

	t.strictEqual(cert.subjects.length, 1);
	t.strictEqual(cert.subjects[0].toString(), 'DC=jim, DC=com');
	t.strictEqual(cert.subjects[0].type, 'host');
	t.strictEqual(cert.subjects[0].hostname, 'jim.com');

	t.ok(cert.issuer.equals(cert.subjects[0]));
	t.ok(cert.isSignedBy(cert));

	t.end();
});

test('x509 pem cert with extra text', function (t) {
	var cert = sshpk.parseCertificate(JIM_X509_TXT, 'pem');
	t.ok(sshpk.Certificate.isCertificate(cert));
	t.ok(JIM_KEY.fingerprint().matches(cert.subjectKey));
	t.ok(cert.isSignedByKey(JIM_KEY));
	t.end();
});

test('create rsa self-signed, loopback', function (t) {
	var id = sshpk.identityForHost('foobar.com');
	var cert = sshpk.createSelfSignedCertificate(id, JIM_KEY);

	var x509 = cert.toBuffer('pem');
	var cert2 = sshpk.parseCertificate(x509, 'pem');
	t.ok(JIM_KEY.fingerprint().matches(cert2.subjectKey));
	t.ok(cert2.subjects[0].equals(cert.subjects[0]));

	var ossh = cert.toBuffer('openssh');
	var cert3 = sshpk.parseCertificate(ossh, 'openssh');
	t.ok(JIM_KEY.fingerprint().matches(cert3.subjectKey));
	t.ok(cert3.subjects[0].equals(cert.subjects[0]));
	t.strictEqual(cert3.subjects[0].hostname, 'foobar.com');

	t.end();
});

test('create ecdsa signed, loopback', function (t) {
	var id = sshpk.identityForUser('jim');
	var ca = sshpk.identityForHost('foobar.com');
	var cacert = sshpk.createSelfSignedCertificate(ca, EC2_KEY);
	var cert = sshpk.createCertificate(id, EC_KEY, ca, EC2_KEY);

	var x509 = cert.toBuffer('pem');
	var cert2 = sshpk.parseCertificate(x509, 'pem');
	t.ok(EC_KEY.fingerprint().matches(cert2.subjectKey));
	t.ok(cert2.subjects[0].equals(cert.subjects[0]));
	t.ok(cert2.isSignedBy(cacert));

	var ossh = cert.toBuffer('openssh');
	var cert3 = sshpk.parseCertificate(ossh, 'openssh');
	t.ok(EC_KEY.fingerprint().matches(cert3.subjectKey));
	t.ok(cert3.subjects[0].equals(cert.subjects[0]));
	t.strictEqual(cert3.subjects[0].uid, 'jim');
	t.ok(cert3.isSignedBy(cacert));

	t.end();
});

test('create ed25519 self-signed, loopback', function (t) {
	var id = sshpk.identityForHost('foobar.com');
	var cert = sshpk.createSelfSignedCertificate(id, SUE_KEY);

	var x509 = cert.toBuffer('pem');
	var cert2 = sshpk.parseCertificate(x509, 'pem');
	t.ok(SUE_KEY.fingerprint().matches(cert2.subjectKey));
	t.ok(cert2.subjects[0].equals(cert.subjects[0]));
	t.ok(cert2.isSignedByKey(SUE_KEY));

	var ossh = cert.toBuffer('openssh');
	var cert3 = sshpk.parseCertificate(ossh, 'openssh');
	t.ok(SUE_KEY.fingerprint().matches(cert3.subjectKey));
	t.ok(cert3.subjects[0].equals(cert.subjects[0]));
	t.strictEqual(cert3.subjects[0].hostname, 'foobar.com');

	t.end();
});

test('subjectaltname', function (t) {
	var ids = [
		sshpk.identityForHost('foobar.com'),
		sshpk.identityForHost('www.foobar.com'),
		sshpk.identityForHost('mail.foobar.com')
	];
	var cert = sshpk.createSelfSignedCertificate(ids, JIM_KEY);

	var x509 = cert.toBuffer('pem');
	var cert2 = sshpk.parseCertificate(x509, 'pem');
	t.ok(JIM_KEY.fingerprint().matches(cert2.subjectKey));
	t.strictEqual(cert2.subjects.length, 3);
	t.ok(cert2.subjects[0].equals(cert.subjects[0]));
	t.ok(cert2.subjects[1].equals(cert.subjects[1]));
	t.strictEqual(cert2.subjects[0].hostname, 'foobar.com');
	t.strictEqual(cert2.subjects[1].hostname, 'www.foobar.com');

	var ossh = cert.toBuffer('openssh');
	var cert3 = sshpk.parseCertificate(ossh, 'openssh');
	t.ok(JIM_KEY.fingerprint().matches(cert3.subjectKey));
	t.ok(cert3.subjects[0].equals(cert.subjects[0]));
	t.strictEqual(cert3.subjects.length, 3);
	t.strictEqual(cert3.subjects[0].hostname, 'foobar.com');
	t.strictEqual(cert3.subjects[1].hostname, 'www.foobar.com');

	t.end();
});

test('napoleon cert (generalizedtime) (x509)', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'napoleon-cert.pem')), 'pem');
	t.strictEqual(cert.subjectKey.type, 'rsa');
	t.ok(cert.isExpired(new Date('1901-01-01T00:00Z')));
	console.log(cert.validFrom.getTime());
	console.log(cert.validUntil.getTime());
	t.ok(!cert.isExpired(new Date('1775-03-01T00:00Z')));
	t.deepEqual(cert.subjects[0].toArray(), [
		{ name: 'c', value: 'FR' },
		{ name: 's', value: 'Île-de-France' },
		{ name: 'l', value: 'Paris' },
		{ name: 'o', value: 'Hereditary Monarchy' },
		{ name: 'ou', value: 'Head of State' },
		{ name: 'emailAddress', value: 'nappi@greatfrenchempire.fr' },
		{ name: 'cn', value: 'Emperor Napoleon I' },
		{ name: 'sn', value: 'Bonaparte' },
		{ name: 'gn', value: 'Napoleon' }
	]);
	t.end();
});

test('example cert: digicert ca (x509)', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'digicert-ca.crt')), 'x509');
	t.strictEqual(cert.subjectKey.type, 'rsa');
	t.strictEqual(cert.subjects.length, 1);
	t.deepEqual(cert.purposes.sort(),
	    ['ca', 'clientAuth', 'crl', 'serverAuth', 'signature']);
	var exts = cert.getExtensions();
	t.strictEqual(exts.length, 8);
	exts.forEach(function (ext) {
		t.strictEqual(ext.format, 'x509');
		t.strictEqual(typeof (ext.oid), 'string');
	});
	var basicExt = cert.getExtension('2.5.29.19');
	t.strictEqual(basicExt.oid, '2.5.29.19');
	t.strictEqual(basicExt.critical, true);
	t.strictEqual(basicExt.format, 'x509');
	t.strictEqual(basicExt.pathLen, 0);
	t.end();
});

test('example cert: digicert (x509)', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'digicert.pem')), 'pem');
	t.strictEqual(cert.subjectKey.type, 'rsa');
	t.strictEqual(cert.subjects.length, 8);
	t.strictEqual(cert.subjects[0].hostname, 'www.digicert.com');
	t.strictEqual(cert.issuer.cn,
	    'DigiCert SHA2 Extended Validation Server CA');
	t.strictEqual(cert.issuer.get('c'), 'US');
	t.strictEqual(cert.issuer.get('o'), 'DigiCert Inc');

	var cacert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'digicert-ca.crt')), 'x509');
	t.ok(cert.isSignedBy(cacert));
	t.end();
});

test('example cert: joyent (x509)', function (t) {
	var data = fs.readFileSync(path.join(testDir, 'joyent.pem'));
	var cert = sshpk.parseCertificate(data, 'pem');
	t.strictEqual(cert.subjectKey.type, 'rsa');
	t.strictEqual(cert.subjects[0].type, 'host');
	t.strictEqual(cert.subjects[0].hostname, '*.joyent.com');
	t.deepEqual(cert.purposes.sort(),
	    ['clientAuth', 'keyEncryption', 'serverAuth', 'signature']);

	var fp = sshpk.parseFingerprint(
	    'SHA1:6UMWRUe9vr93cg8AGS7Nwl1XOAA',
	    { type: 'certificate' });
	t.ok(fp.matches(cert));
	t.end();
});

test('example cert: cloudflare (x509)', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'cloudflare.pem')), 'pem');
	t.strictEqual(cert.subjectKey.type, 'ecdsa');
	var id = sshpk.identityForHost('mail.imeyou.io');
	t.ok(cert.subjects.some(function (subj) {
		return (subj.equals(id));
	}));
	var fp = cert.fingerprint('sha1').toString('hex');
	t.strictEqual(fp.toUpperCase(),
	    'B7:11:BA:8E:83:43:E0:4D:A2:DC:6F:F7:87:2B:5D:78:2C:B1:31:2A');

	var cacert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'comodo.crt')), 'x509');
	t.ok(cert.isSignedBy(cacert));
	t.end();
});

test('example cert: letsencrypt (x509)', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'letsencrypt.pem')), 'pem');
	t.strictEqual(cert.subjectKey.type, 'rsa');
	t.strictEqual(cert.subjects[0].type, 'host');
	t.strictEqual(cert.subjects[0].hostname, 'cr.joyent.us');
	var fp = cert.fingerprint('sha1').toString('hex');
	t.strictEqual(fp.toUpperCase(),
	    '59:8B:FA:BF:F7:DD:D4:B5:7E:8F:53:61:B1:65:0D:DF:F5:4B:CC:72');
	t.end();
});

test('example cert: DSA example (x509 DER)', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, '1024b-dsa-example-cert.der')),
	    'x509');
	t.strictEqual(cert.subjectKey.type, 'dsa');
	t.strictEqual(cert.subjects[0].type, 'host');
	t.strictEqual(cert.subjects[0].hostname, 'www.example.com');

	var cacert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'frank4dd-cacert.der')), 'x509');
	t.ok(cert.isSignedBy(cacert));
	t.end();
});

test('example cert: lots of SAN (x509)', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'google_jp_458san.pem')),
	    'pem');
	t.strictEqual(cert.subjectKey.type, 'rsa');
	t.strictEqual(cert.subjects[0].type, 'host');
	t.strictEqual(cert.subjects[0].hostname, 'google.com');
	var id = sshpk.identityForHost('google.co.jp');
	t.ok(cert.subjects.some(function (subj) {
		return (subj.equals(id));
	}));
	t.end();
});

test('example cert: openssh rsa with sha256 (7.0p1+)', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'openssh-rsa256.pub')),
	    'openssh');
	t.strictEqual(cert.subjectKey.type, 'rsa');
	t.ok(cert.isSignedByKey(cert.subjectKey));
	t.strictEqual(cert.signatures.openssh.signature.hashAlgorithm,
	    'sha256');
	t.end();
});

test('example cert: ed25519 cert from curdle-pkix-04', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'ed25519-pkix-cert.pem')),
	    'pem');
	t.strictEqual(cert.subjectKey.type, 'curve25519');
	t.strictEqual(cert.subjects[0].type, 'user');
	t.strictEqual(cert.subjects[0].cn, 'IETF Test Demo');

	var key = sshpk.parsePrivateKey(
	    fs.readFileSync(path.join(testDir, 'ed25519-pkix.pem')), 'pem');
	t.ok(cert.isSignedByKey(key));

	t.end();
});

test('cert with doubled-up DN attribute', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'double-title-cert.pem')),
	    'pem');

	var id = cert.subjects[0];
	t.throws(function () {
		id.get('title');
	});
	t.deepEqual(id.get('title', true), ['in-zone.key', 'in-zone.key']);

	t.strictEqual(id.get('ou'), 'delegated');
	t.strictEqual(id.get('cn'), '2dc79d36-ea01-c855-eab5-e2c7a24abbf4');

	t.end();
});

test('example cert: yubikey attestation cert', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'yubikey.pem')),
	    'pem');
	t.strictEqual(cert.subjectKey.type, 'ecdsa');
	t.strictEqual(cert.subjects[0].cn, 'YubiKey PIV Attestation 9e');

	var serialExt = cert.getExtension('1.3.6.1.4.1.41482.3.7');
	t.ok(serialExt);
	var der = new asn1.Ber.Reader(serialExt.data);
	t.strictEqual(der.readInt(), 5213681);

	var policyExt = cert.getExtension('1.3.6.1.4.1.41482.3.8');
	t.ok(policyExt);
	t.strictEqual(policyExt.data[0], 0x01); /* never require PIN */
	t.strictEqual(policyExt.data[1], 0x01); /* never require touch */

	t.end();
});

test('example cert: openssh extensions', function (t) {
	var cert = sshpk.parseCertificate(
	    fs.readFileSync(path.join(testDir, 'openssh-exts.pub')),
	    'openssh');
	t.strictEqual(cert.subjectKey.type, 'ecdsa');
	t.strictEqual(cert.subjects[0].uid, 'foo');

	var forceCmdExt = cert.getExtension('force-command');
	t.ok(forceCmdExt);
	t.strictEqual(forceCmdExt.name, 'force-command');
	t.strictEqual(forceCmdExt.critical, true);

	var cmdbuf = new SSHBuffer({ buffer: forceCmdExt.data });
	var cmd = cmdbuf.readString();
	t.strictEqual(cmd, 'foobarcmd');
	t.ok(cmdbuf.atEnd());

	t.ok(cert.getExtension('permit-port-forwarding'));
	t.notOk(cert.getExtension('source-address'));
	t.notOk(cert.getExtension('permit-pty'));

	t.end();
});


text:
package org.apache.flink.util;

import java.util.Iterator;
import java.util.NoSuchElementException;

/**
 * The {@code NumberSequenceIterator} is an iterator that returns a sequence of numbers (as {@code Long})s.
 * The iterator is splittable (as defined by {@link SplittableIterator}, i.e., it can be divided into multiple
 * iterators that each return a subsequence of the number sequence.
 */
public class NumberSequenceIterator implements SplittableIterator<Long> {

	private static final long serialVersionUID = 1L;

	private final long to;

	private long current;

	/**
	 * Internal constructor to allow for empty iterators.
	 *
	 * @param from The first number returned by the iterator.
	 * @param to The last number returned by the iterator.
	 */
	public NumberSequenceIterator(long from, long to) {
		if (from > to) {
			throw new IllegalArgumentException("The 'to' value must not be smaller than the 'from' value.");
		}

		this.current = from;
		this.to = to;
	}

	/**
	 * Internal constructor to allow for empty iterators.
	 *
	 * @param from The first number returned by the iterator.
	 * @param to The last number returned by the iterator.
	 * @param unused A dummy parameter to disambiguate the constructor.
	 */
	private NumberSequenceIterator(long from, long to, boolean unused) {
		this.current = from;
		this.to = to;
	}

	public long getCurrent() {
		return this.current;
	}

	public long getTo() {
		return this.to;
	}

	@Override
	public boolean hasNext() {
		return current <= to;
	}

	@Override
	public Long next() {
		if (current <= to) {
			return current++;
		} else {
			throw new NoSuchElementException();
		}
	}

	@Override
	public void remove() {
		throw new UnsupportedOperationException();
	}

	@Override
	public NumberSequenceIterator[] split(int numPartitions) {
		if (numPartitions < 1) {
			throw new IllegalArgumentException("The number of partitions must be at least 1.");
		}

		if (numPartitions == 1) {
			return new NumberSequenceIterator[] { new NumberSequenceIterator(current, to) };
		}

		// here, numPartitions >= 2 !!!

		long elementsPerSplit;

		if (to - current + 1 >= 0) {
			elementsPerSplit = (to - current + 1) / numPartitions;
		}
		else {
			// long overflow of the range.
			// we compute based on half the distance, to prevent the overflow.
			// in most cases it holds that: current < 0 and to > 0, except for: to == 0 and current == Long.MIN_VALUE
			// the later needs a special case
			final long halfDiff; // must be positive

			if (current == Long.MIN_VALUE) {
				// this means to >= 0
				halfDiff = (Long.MAX_VALUE/2+1) + to/2;
			} else {
				long posFrom = -current;
				if (posFrom > to) {
					halfDiff = to + ((posFrom - to) / 2);
				} else {
					halfDiff = posFrom + ((to - posFrom) / 2);
				}
			}
			elementsPerSplit = halfDiff / numPartitions * 2;
		}

		if (elementsPerSplit < Long.MAX_VALUE) {
			// figure out how many get one in addition
			long numWithExtra = -(elementsPerSplit * numPartitions) + to - current + 1;

			// based on rounding errors, we may have lost one)
			if (numWithExtra > numPartitions) {
				elementsPerSplit++;
				numWithExtra -= numPartitions;

				if (numWithExtra > numPartitions) {
					throw new RuntimeException("Bug in splitting logic. To much rounding loss.");
				}
			}

			NumberSequenceIterator[] iters = new NumberSequenceIterator[numPartitions];
			long curr = current;
			int i = 0;
			for (; i < numWithExtra; i++) {
				long next = curr + elementsPerSplit + 1;
				iters[i] = new NumberSequenceIterator(curr, next-1);
				curr = next;
			}
			for (; i < numPartitions; i++) {
				long next = curr + elementsPerSplit;
				iters[i] = new NumberSequenceIterator(curr, next-1, true);
				curr = next;
			}

			return iters;
		}
		else {
			// this can only be the case when there are two partitions
			if (numPartitions != 2) {
				throw new RuntimeException("Bug in splitting logic.");
			}

			return new NumberSequenceIterator[] {
				new NumberSequenceIterator(current, current + elementsPerSplit),
				new NumberSequenceIterator(current + elementsPerSplit, to)
			};
		}
	}

	@Override
	public Iterator<Long> getSplit(int num, int numPartitions) {
		if (numPartitions < 1 || num < 0 || num >= numPartitions) {
			throw new IllegalArgumentException();
		}

		return split(numPartitions)[num];
	}

	@Override
	public int getMaximumNumberOfSplits() {
		if (to >= Integer.MAX_VALUE || current <= Integer.MIN_VALUE || to-current+1 >= Integer.MAX_VALUE) {
			return Integer.MAX_VALUE;
		}
		else {
			return (int) (to-current+1);
		}
	}
}


text:
// +build linux

package system

import (
	"bufio"
	"fmt"
	"os"
	"os/exec"
	"syscall"
	"unsafe"
)

type ParentDeathSignal int

func (p ParentDeathSignal) Restore() error {
	if p == 0 {
		return nil
	}
	current, err := GetParentDeathSignal()
	if err != nil {
		return err
	}
	if p == current {
		return nil
	}
	return p.Set()
}

func (p ParentDeathSignal) Set() error {
	return SetParentDeathSignal(uintptr(p))
}

func Execv(cmd string, args []string, env []string) error {
	name, err := exec.LookPath(cmd)
	if err != nil {
		return err
	}

	return syscall.Exec(name, args, env)
}

func SetParentDeathSignal(sig uintptr) error {
	if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, sig, 0); err != 0 {
		return err
	}
	return nil
}

func GetParentDeathSignal() (ParentDeathSignal, error) {
	var sig int
	_, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_GET_PDEATHSIG, uintptr(unsafe.Pointer(&sig)), 0)
	if err != 0 {
		return -1, err
	}
	return ParentDeathSignal(sig), nil
}

func SetKeepCaps() error {
	if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_KEEPCAPS, 1, 0); err != 0 {
		return err
	}

	return nil
}

func ClearKeepCaps() error {
	if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_KEEPCAPS, 0, 0); err != 0 {
		return err
	}

	return nil
}

func Setctty() error {
	if _, _, err := syscall.RawSyscall(syscall.SYS_IOCTL, 0, uintptr(syscall.TIOCSCTTY), 0); err != 0 {
		return err
	}
	return nil
}

/*
 * Detect whether we are currently running in a user namespace.
 * Copied from github.com/lxc/lxd/shared/util.go
 */
func RunningInUserNS() bool {
	file, err := os.Open("/proc/self/uid_map")
	if err != nil {
		/*
		 * This kernel-provided file only exists if user namespaces are
		 * supported
		 */
		return false
	}
	defer file.Close()

	buf := bufio.NewReader(file)
	l, _, err := buf.ReadLine()
	if err != nil {
		return false
	}

	line := string(l)
	var a, b, c int64
	fmt.Sscanf(line, "%d %d %d", &a, &b, &c)
	/*
	 * We assume we are in the initial user namespace if we have a full
	 * range - 4294967295 uids starting at uid 0.
	 */
	if a == 0 && b == 0 && c == 4294967295 {
		return false
	}
	return true
}

func Prctl(option int, arg2, arg3, arg4, arg5 uintptr) (err error) {
	_, _, e1 := syscall.Syscall6(syscall.SYS_PRCTL, uintptr(option), arg2, arg3, arg4, arg5, 0)
	if e1 != 0 {
		err = e1
	}
	return
}


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

    <com.example.animatedemo.view.CircleView
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>


text:
using System.Collections.Generic;

namespace QuickIEnumerableToExcelExporter
{
    /// <summary>
    /// Describes an row for the export
    /// </summary>
    internal class ExportRow
    {
        /// <summary>
        /// Indicates if the current row is a header
        /// </summary>
        public bool IsHeaderRow { get; set; }

        /// <summary>
        /// List of all values (columns)
        /// </summary>
        public List<ExportValue> Values { get; set; }
    }
}


text:
package org.sakaiproject.util;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;

/**
 * Utilities based on double and integers such as validation formats.
 */
public class NumberUtil {

	/**
	 * @param origin number that is needed to validate
	 * @param locale specific geographic location to validate format on origin param
	 * @return true if number format is valid for that locale
	 */
	public static boolean isValidLocaleDouble(final String origin, Locale locale) {
		final DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(locale);
		final DecimalFormatSymbols fs = df.getDecimalFormatSymbols();
		final String doublePattern =
			"\\d+\\" + fs.getGroupingSeparator()
			+ "\\d\\d\\d\\" + fs.getDecimalSeparator()
			+ "\\d+|\\d+\\" + fs.getDecimalSeparator()
			+ "\\d+|\\d+\\" + fs.getGroupingSeparator()
			+ "\\d\\d\\d|\\d+";
		return origin.matches(doublePattern);
	}

	/**
	 * @param origin origin number that is needed to validate on the default user's locale
	 * @return true if number format is valid for user's locale
	 */
	public static boolean isValidLocaleDouble(final String origin) {
		return isValidLocaleDouble(origin, new ResourceLoader().getLocale());
	}

}


text:
package org.springframework.autobuilds.ejbtest;

/**
 * @author colin sampaleanu
 */
public class Constants {

	public static final String SERVICE_LAYER_CONTEXT_ID = "servicelayer-context";

}


text:
```cpp
auto operator !=(const integer &v) const noexcept -> bool;
```

Determines if the value of this object (left hand side of the operator) is not equal to `v` (right hand side of the operator).

### Return Value ###

* `true` if the value of this object is not equal to `v`.
* `false` if it is equal.

### Exceptions ###

None.

## See Also ##

* [class integer](c8_integer)
* [c8 library](c8)


text:
namespace tadpole {

GlobalCompiler::~GlobalCompiler() {
}

FunctionObject* GlobalCompiler::compile(VM& vm, const str_t& source_bytes) {
  Lexer lex(source_bytes);

  if (gparser_ = new GlobalParser(vm, lex); gparser_ != nullptr) {
    FunctionObject* fn = gparser_->compile();
    delete gparser_;
    gparser_ = nullptr;

    return fn;
  }
  return nullptr;
}

void GlobalCompiler::iter_objects(ObjectVisitor&& visitor) {
  if (gparser_ != nullptr)
    gparser_->iter_objects(std::move(visitor));
}

}


text:
package org.jetbrains.jps.appengine.model.impl;

import com.intellij.util.xmlb.annotations.AbstractCollection;
import com.intellij.util.xmlb.annotations.Tag;
import org.jetbrains.jps.appengine.model.PersistenceApi;

import java.util.ArrayList;
import java.util.List;

/**
 * @author nik
 */
public class AppEngineModuleExtensionProperties {
  @Tag("sdk-home-path")
  public String mySdkHomePath = "";

  @Tag("run-enhancer-on-make")
  public boolean myRunEnhancerOnMake = false;

  @Tag("files-to-enhance")
  @AbstractCollection(surroundWithTag = false, elementTag = "file", elementValueAttribute = "path")
  public List<String> myFilesToEnhance = new ArrayList<>();

  @Tag("persistence-api")
  public PersistenceApi myPersistenceApi = PersistenceApi.JDO;
}


text:
CKEDITOR.plugins.add('music',
  {
    requires: 'dialog',
    icons: 'music',
    //hidpi: true,
    init: function (editor) {
      editor.addCommand('music', new CKEDITOR.dialogCommand('music', {
        allowedContent: 'iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]',
        requiredContent: 'iframe'
      }));
      editor.ui.addButton && editor.ui.addButton('Music', {
        label: "QQ音乐",
        command: 'music',
        toolbar: 'insert,50'
      });

      CKEDITOR.dialog.add('music', this.path + 'dialogs/music.js');
    }
  });


text:
layout: page
title: Foley Tracker Group Trade Fair
date: 2016-05-24
author: Helen Rush
tags: weekly links, java
status: published
summary: Sed volutpat justo tellus, ut suscipit magna.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 02/12/2019
  endDate: 02/15/2019
  ctyhocn: BHBNRHX
  groupCode: FTGTF
published: true
---
Donec nisi dolor, fermentum a nunc eu, vestibulum commodo mi. Sed placerat ligula tristique mi imperdiet lacinia eu nec neque. Aliquam vel congue ex. Vestibulum cursus posuere tempus. Aliquam erat volutpat. In quis tristique quam, lobortis suscipit libero. Vivamus eget ante quis est mollis gravida vitae in mi. Duis dapibus turpis vel dui tincidunt, vel dapibus sapien maximus. Ut in urna neque. Vestibulum convallis metus a posuere pulvinar. Duis et velit eget ex luctus maximus et nec nunc.

* Integer a neque tristique, congue sem non, pellentesque arcu
* Ut molestie mauris vel nunc fermentum auctor
* Proin non felis sit amet nunc fringilla condimentum
* Integer mattis arcu varius odio pulvinar tristique
* Nunc non leo interdum, egestas neque dictum, viverra sapien
* Etiam sollicitudin nulla vel rhoncus posuere.

Curabitur gravida vitae purus non ultrices. Donec nec mi gravida orci varius suscipit finibus at nisl. Aliquam vehicula eros justo, ut feugiat magna sagittis sit amet. Aenean odio diam, scelerisque et justo id, tempor scelerisque risus. Integer quis convallis dolor. Phasellus ultricies, justo eu porta facilisis, turpis mi interdum ante, sed bibendum odio diam id augue. Nulla consequat lacus nulla, sit amet viverra erat dapibus at. Suspendisse vitae metus a turpis ullamcorper tincidunt. Pellentesque nec sapien imperdiet, auctor diam sed, imperdiet ante. Fusce et diam mi. Nullam id viverra massa, id ornare sem. Pellentesque et ornare nunc. Morbi quis maximus ex. Vivamus rhoncus neque in libero vestibulum, in commodo nibh pretium. Curabitur tellus ipsum, posuere at arcu sed, efficitur eleifend libero. Nulla facilisi.


text:
package org.jdns.jfreechess.timeseal;

/**
 * Represents a source of the current time in nanoseconds.
 */
public interface Clock {
  public long nanoTime();
}


text:
class Dto::Admin::Dashboard < Dto::Base
  DESCRETE_DAYS_NUMBER = 12
  attr_accessor :income, :customers, :traffic, :courses

  def initialize(attributes = {})
    super
    collect_data
  end

  private

  def collect_data
    @income, @customers, @traffic, @courses = {}, {}, {}, {}
    fetch_courses
    assign_total_statistics
    assign_discrete_total_statistics
  end

  def fetch_courses
    @courses[:rub_usd] = Currencies::Course.new("rub", "usd").get.to_f
    @courses[:eur_usd] = Currencies::Course.new("eur", "usd").get.to_f
    @courses[:updated_at] = Currencies::Course.updated_at.try(:to_datetime)
  end

  def assign_total_statistics
    @income[:total] = Payment.sum(:usd_amount)
    @customers[:total] = User.count
    @traffic[:total] = Disconnect.sum(:traffic_out)
  end

  def assign_discrete_total_statistics
    payments = Dto::Admin::DescretePayments.new(DESCRETE_DAYS_NUMBER)
    @income[:discrete] = payments.amounts.sort.map { |date| date[1].to_i }

    traffic = Dto::Admin::DescreteTraffic.new(DESCRETE_DAYS_NUMBER)
    @traffic[:discrete] = traffic.amounts.sort.map { |date| BytesConverter.prettify_float(BytesConverter.bytes_to_gigabytes(date[1])) }

    customers = Dto::Admin::DescreteCustomersRegistrations.new(DESCRETE_DAYS_NUMBER)
    @customers[:discrete] = customers.amounts.sort.map { |date| date[1] }
  end

end


text:
package edu.gemini.wdba.session;

//
// Gemini Observatory/AURA
// $Id: ISessionConfiguration.java 756 2007-01-08 18:01:24Z gillies $
//

public interface ISessionConfiguration {

    public void initialize(ISessionEventProducer producer);

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>utils/api/engine/transform.js - Fireball Engine API</title>
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">

Fireball Engine API
 0.2.0

Fireball is the game engine for the future.

index

top

Classes

Modules

                        <input type="search" id="api-filter" placeholder="Type to filter APIs">

_CallbacksHandler

_DeserializeInfo

_ObjectFlags

Asset

AssetLibrary

AudioClip

AudioSource

BitmapFont

BitmapText

BitmapText.TextAlign

BitmapText.TextAnchor

CallbacksInvoker

Camera

Color

Component

ContentStrategyType

Engine

Entity

EqualToFrame

Event

EventTarget

Fire

FixedHeight

FObject

HashObject

Input

Intersection

JS

KeyboardEvent

LoadManager

Math

Matrix23

ModifierKeyStates

MouseEvent

NoScale

Path

Rect

Renderer

Screen

Screen.ContainerStrategy

Screen.ContentStrategy

Sprite

SpriteAnimation

SpriteAnimationClip

SpriteAnimationClip.StopAction

SpriteAnimationClip.WrapMode

SpriteAnimationState

SpriteRenderer

Texture

Texture.FilterMode

Texture.WrapMode

Time

Transform

Vec2

Editor

Fire

Math

File: utils/api/engine/transform.js

                /**
                 * @module Fire
                 * @class Fire
                 */
                var Transform = (function () {

                    /**
                     * Defines position, rotation and scale of an entity.
                     *
                     * @class Transform
                     * @extends Component
                     * @constructor
                     */
                    var Transform = Fire.extend('Fire.Transform', Component, function () {
                        /**
                         * @property _position;
                         * @type {Vec2}
                         * @default new Vec2(0, 0)
                         * @private
                         */
                        this._position = new Vec2(0, 0);
                        /**
                         * @property _scale;
                         * @type {Vec2}
                         * @default new Vec2(1, 1)
                         * @private
                         */
                        this._scale = new Vec2(1, 1);

                        this._worldTransform = new Matrix23();

                        /**
                         * the cached reference to parent transform
                         * @property _parent
                         * @type {Transform}
                         * @default null
                         * @private
                         */
                        this._parent = null;

                        //this._hierarchyChangedListeners = null;
                    });

                    Fire.executeInEditMode(Transform);

                    Transform.prop('_position', null, Fire.HideInInspector);
                    Transform.prop('_rotation', 0, Fire.HideInInspector);
                    Transform.prop('_scale', null, Fire.HideInInspector);

                    // properties

                    var ERR_NaN = 'The %s must not be NaN';

                    /**
                     * The local position in its parent's coordinate system
                     * @property position
                     * @type {Vec2}
                     * @default new Vec2(0, 0)
                     */
                    Transform.getset('position',
                        function () {
                            return new Vec2(this._position.x, this._position.y);
                        },
                        function (value) {
                            var x = value.x;
                            var y = value.y;
                            if ( !isNaN(x) && !isNaN(y) ) {
                                this._position.x = x;
                                this._position.y = y;
                            }
                            else {
                                Fire.error(ERR_NaN, 'xy of new position');
                            }
                        },
                        Fire.Tooltip("The local position in its parent's coordinate system")
                    );

                    /**
                     * The local x position in its parent's coordinate system
                     * @property x
                     * @type {number}
                     * @default 0
                     */
                    Object.defineProperty(Transform.prototype, 'x', {
                        get: function () {
                            return this._position.x;
                        },
                        set: function (value) {
                            if ( !isNaN(value) ) {
                                this._position.x = value;
                // @ifdef EDITOR
                                // notify change
                                this._position = this._position;
                // @endif
                            }
                            else {
                                Fire.error(ERR_NaN, 'new x');
                            }
                        }
                    });

                    /**
                     * The local y position in its parent's coordinate system
                     * @property y
                     * @type {number}
                     * @default 0
                     */
                    Object.defineProperty(Transform.prototype, 'y', {
                        get: function () {
                            return this._position.y;
                        },
                        set: function (value) {
                            if ( !isNaN(value) ) {
                                this._position.y = value;
                // @ifdef EDITOR
                                // notify change
                                this._position = this._position;
                // @endif
                            }
                            else {
                                Fire.error(ERR_NaN, 'new y');
                            }
                        }
                    });

                    /**
                     * The position of the transform in world space
                     * @property worldPosition
                     * @type {Vec2}
                     * @default new Vec2(0, 0)
                     */
                    Object.defineProperty(Transform.prototype, 'worldPosition', {
                        get: function () {
                            var l2w = this.getLocalToWorldMatrix();
                            return new Vec2(l2w.tx, l2w.ty);
                        },
                        set: function (value) {
                            var x = value.x;
                            var y = value.y;
                            if ( !isNaN(x) && !isNaN(y) ) {
                                if ( this._parent ) {
                                    var w2l = this._parent.getWorldToLocalMatrix();
                                    this.position = w2l.transformPoint(value);
                                }
                                else {
                                    this.position = value;
                                }
                            }
                            else {
                                Fire.error(ERR_NaN, 'xy of new worldPosition');
                            }
                        }
                    });

                    /**
                     * The x position of the transform in world space
                     * @property worldX
                     * @type {number}
                     * @default 0
                     */
                    Object.defineProperty(Transform.prototype, 'worldX', {
                        get: function () {
                            return this.worldPosition.x;
                        },
                        set: function (value) {
                            if ( !isNaN(value) ) {
                                if ( this._parent ) {
                                    var pl2w = this._parent.getLocalToWorldMatrix();
                                    var l2w = this.getLocalMatrix().prepend(pl2w);
                                    if (l2w.tx !== value) {
                                        this._position.x = value;
                                        this._position.y = l2w.ty;
                                        pl2w.invert().transformPoint(this._position, this._position);
                                    }
                                }
                                else {
                                    this._position.x = value;
                                }
                // @ifdef EDITOR
                                // notify change
                                this._position = this._position;
                // @endif
                                //将来优化做好了以后,上面的代码可以简化成下面这些
                                //var pos = this.worldPosition;
                                //if (pos.x !== value) {
                                //    pos.x = value;
                                //    this.worldPosition = pos;
                                //}
                            }
                            else {
                                Fire.error(ERR_NaN, 'new worldX');
                            }
                        }
                    });

                    /**
                     * The y position of the transform in world space
                     * @property worldY
                     * @type {number}
                     * @default 0
                     */
                    Object.defineProperty(Transform.prototype, 'worldY', {
                        get: function () {
                            return this.worldPosition.y;
                        },
                        set: function (value) {
                            if ( !isNaN(value) ) {
                                if ( this._parent ) {
                                    var pl2w = this._parent.getLocalToWorldMatrix();
                                    var l2w = this.getLocalMatrix().prepend(pl2w);
                                    if (l2w.ty !== value) {
                                        this._position.x = l2w.tx;
                                        this._position.y = value;
                                        pl2w.invert().transformPoint(this._position, this._position);
                                    }
                                }
                                else {
                                    this._position.y = value;
                                }
                // @ifdef EDITOR
                                // notify change
                                this._position = this._position;
                // @endif
                            }
                            else {
                                Fire.error(ERR_NaN, 'new worldY');
                            }
                        }
                    });

                    /**
                     * The counterclockwise degrees of rotation relative to the parent
                     * @property rotation
                     * @type {number}
                     * @default 0
                     */
                    Transform.getset('rotation',
                        function () {
                            return this._rotation;
                        },
                        function (value) {
                            if ( !isNaN(value) ) {
                                this._rotation = value;
                            }
                            else {
                                Fire.error(ERR_NaN, 'new rotation');
                            }
                        },
                        Fire.Tooltip('The counterclockwise degrees of rotation relative to the parent')
                    );

                    /**
                     * The counterclockwise degrees of rotation in world space
                     * @property worldRotation
                     * @type {number}
                     * @default 0
                     */
                    Object.defineProperty(Transform.prototype, 'worldRotation', {
                        get: function () {
                            if ( this._parent ) {
                                return this.rotation + this._parent.worldRotation;
                            }
                            else {
                                return this.rotation;
                            }
                        },
                        set: function (value) {
                            if ( !isNaN(value) ) {
                                if ( this._parent ) {
                                    this.rotation = value - this._parent.worldRotation;
                                }
                                else {
                                    this.rotation = value;
                                }
                            }
                            else {
                                Fire.error(ERR_NaN, 'new worldRotation');
                            }
                        }
                    });

                    /**
                     * The local scale factor relative to the parent
                     * @property scale
                     * @type {Vec2}
                     * @default new Vec2(1, 1)
                     */
                    Transform.getset('scale',
                        function () {
                            return new Vec2(this._scale.x, this._scale.y);
                        },
                        function (value) {
                            var x = value.x;
                            var y = value.y;
                            if ( !isNaN(x) && !isNaN(y) ) {
                                this._scale.x = x;
                                this._scale.y = y;
                            }
                            else {
                                Fire.error(ERR_NaN, 'xy of new scale');
                            }
                        },
                        Fire.Tooltip('The local scale factor relative to the parent')
                    );

                    /**
                     * The local x scale factor relative to the parent
                     * @property scaleX
                     * @type {number}
                     * @default 1
                     */
                    Object.defineProperty(Transform.prototype, 'scaleX', {
                        get: function () {
                            return this._scale.x;
                        },
                        set: function (value) {
                            if ( !isNaN(value) ) {
                                this._scale.x = value;
                // @ifdef EDITOR
                                // notify change
                                this._scale = this._scale;
                // @endif
                            }
                            else {
                                Fire.error(ERR_NaN, 'new scaleX');
                            }
                        }
                    });

                    /**
                     * The local y scale factor relative to the parent
                     * @property scaleY
                     * @type {number}
                     * @default 1
                     */
                    Object.defineProperty(Transform.prototype, 'scaleY', {
                        get: function () {
                            return this._scale.y;
                        },
                        set: function (value) {
                            if ( !isNaN(value) ) {
                                this._scale.y = value;
                // @ifdef EDITOR
                                // notify change
                                this._scale = this._scale;
                // @endif
                            }
                            else {
                                Fire.error(ERR_NaN, 'new scaleY');
                            }
                        }
                    });

                    /**
                     * The lossy scale of the transform in world space (Read Only)
                     * @property worldScale
                     * @type {Vec2}
                     * @default new Vec2(1, 1)
                     * @readOnly
                     */
                    Object.defineProperty(Transform.prototype, 'worldScale', {
                        get: function () {
                            var l2w = this.getLocalToWorldMatrix();
                            return l2w.getScale();
                        }
                    });

                    // override functions

                    Transform.prototype.onLoad = function () {
                        this._parent = this.entity._parent && this.entity._parent.transform;
                    };

                    Transform.prototype.destroy = function () {
                        Fire.error("Not allowed to destroy the transform. Please destroy the entity instead.");
                    };

                    // other functions

                    Transform.prototype._updateTransform = function (parentMatrix) {
                        //var mat = this._worldTransform;

                        //var px = this._pivot.x;
                        //var py = this._pivot.y;

                        //var radians = this._rotation * 0.017453292519943295;
                        //var sin = this._rotation === 0 ? 0 : Math.sin(radians);
                        //var cos = this._rotation === 0 ? 1 : Math.cos(radians);

                        //// get local
                        //mat.a = this._scale.x * cos;
                        //mat.b = this._scale.x * sin;   // 这里如果是pixi,b和c是反过来的
                        //mat.c = this._scale.y * - sin;
                        //mat.d = this._scale.y * cos;
                        //mat.tx = this._position.x;
                        //mat.ty = this._position.y;

                        //// parent
                        //var pa = parentMatrix.a;
                        //var pb = parentMatrix.b;
                        //var pc = parentMatrix.c;
                        //var pd = parentMatrix.d;

                        //// local x parent
                        //if (pa !== 1 || pb !== 0 || pc !== 0 || pd !== 1) {
                        //    mat.a = mat.a * pa + mat.b * pc;
                        //    mat.b = mat.a * pb + mat.b * pd;
                        //    mat.c = mat.c * pa + mat.d * pc;
                        //    mat.d = mat.c * pb + mat.d * pd;
                        //    mat.tx = mat.tx * pa + mat.ty * pc + parentMatrix.tx;
                        //    mat.ty = mat.tx * pb + mat.ty * pd + parentMatrix.ty;
                        //}
                        //else {
                        //    mat.tx += parentMatrix.tx;
                        //    mat.ty += parentMatrix.ty;
                        //}

                        var mat = this._worldTransform;
                        this.getLocalMatrix(mat);
                        mat.prepend(parentMatrix);

                        //this._worldAlpha = this._alpha * this._parent._worldAlpha;

                        // update children
                        var children = this.entity._children;
                        for (var i = 0, len = children.length; i < len; i++) {
                            children[i].transform._updateTransform(mat);
                        }
                    };

                    Transform.prototype._updateRootTransform = function () {
                        var mat = this._worldTransform;
                        this.getLocalMatrix(mat);
                        //this._worldAlpha = this._alpha;

                        // update children
                        var children = this.entity._children;
                        for (var i = 0, len = children.length; i < len; i++) {
                            children[i].transform._updateTransform(mat);
                        }
                    };

                    /**
                     * Get the local matrix that transforms a point from local space into parents space.
                     * @method getLocalMatrix
                     * @param {Matrix23} [out] - optional, the receiving vector
                     * @return {Matrix23}
                     */
                    Transform.prototype.getLocalMatrix = function (out) {
                        out = out || new Matrix23();

                        //var px = this._pivot.x;
                        //var py = this._pivot.y;

                        var radians = this._rotation * 0.017453292519943295;
                        var sin = this._rotation === 0 ? 0 : Math.sin(radians);
                        var cos = this._rotation === 0 ? 1 : Math.cos(radians);

                        out.a = this._scale.x * cos;   // scaleMat.a * rotateMat.a(cos) 00
                        // 这里如果是pixi,b和c是反过来的
                        out.b = this._scale.x * sin;   // scaleMat.a * rotateMat.b(sin)
                        out.c = this._scale.y * - sin; // scaleMat.d * rotateMat.c(-sin)
                        //
                        out.d = this._scale.y * cos;   // scaleMat.d * rotateMat.d(cos) 11
                        out.tx = this._position.x;/* * ra + this._position.y * rc*/
                        out.ty = this._position.y;/* * rb + this._position.y * rd*/
                        //out.tx = this._position.x/* - out.a * px - py * out.b*/;    // 02
                        //out.ty = this._position.y/* - out.d * py - px * out.c*/;    // 12

                        //above should equivalent to:
                        //  var t = new Matrix23();
                        //  t.tx = this._position.x;
                        //  t.ty = this._position.y;
                        //  var r = new Matrix23();
                        //  r.rotate(radians);
                        //  var s = new Matrix23();
                        //  s.setScale(this._scale);
                        //  out.set(s.prepend(r).prepend(t));

                        return out;
                    };

                    /**
                     * Get the world transform matrix that transforms a point from local space into world space.
                     * @method getLocalToWorldMatrix
                     * @param {Matrix23} [out] - optional, the receiving vector
                     * @return {Matrix23}
                     */
                    Transform.prototype.getLocalToWorldMatrix = function (out) {
                        // todo, merge with this._worldTransform
                        out = out || new Matrix23();
                        this.getLocalMatrix(out);
                        var t = new Fire.Matrix23();
                        for (var p = this._parent; p !== null; p = p._parent) {
                            out.prepend(p.getLocalMatrix(t));
                        }
                        return out;
                    };

                    /**
                     * Get the inverse world transform matrix that transforms a point from world space into local space.
                     * @method getWorldToLocalMatrix
                     * @param {Matrix23} [out] - optional, the receiving vector
                     * @return {Matrix23}
                     */
                    Transform.prototype.getWorldToLocalMatrix = function (out) {
                        return this.getLocalToWorldMatrix(out).invert();
                    };

                    /**
                     * Rotates this transform through point in world space by angle degrees.
                     * @method rotateAround
                     * @param {Vec2} point - the world point rotates through
                     * @param {number} angle - degrees
                     */
                    Transform.prototype.rotateAround = function (point, angle) {
                        var delta = this.worldPosition.subSelf(point);
                        delta.rotateSelf(Math.deg2rad(angle));
                        this.worldPosition = point.addSelf(delta);
                        this.rotation = this._rotation + angle;
                    };

                    /**
                     * Moves the transform in the direction and distance of translation. The movement is applied relative to the transform's local space.
                     * @method translate
                     * @param {Vec2} translation
                     */
                    Transform.prototype.translate = function (translation) {
                        var rotated = translation.rotate(Math.deg2rad(this._rotation));
                        this.position = this._position.add(rotated, rotated);
                    };

                    /**
                     * up direction in world space, point to the y(green) axis
                     * @property up
                     * @type {Vec2}
                     */
                    Object.defineProperty(Transform.prototype, 'up', {
                        get: function () {
                            return (new Vec2(0.0, 1.0)).rotateSelf(Math.deg2rad(this.worldRotation));
                        },
                        set: function (value) {
                            if (value.x === 0.0 && value.y === 0.0) {
                                Fire.warn("Can't get rotation from zero vector");
                                return;
                            }
                            var radians = Math.atan2(value.y, value.x) - Math.HALF_PI;
                            this.worldRotation = Math.rad2deg(radians);
                        }
                    });

                    /**
                     * right direction in world space, point to the x(red) axis
                     * @property right
                     * @type {Vec2}
                     */
                    Object.defineProperty(Transform.prototype, 'right', {
                        get: function () {
                            return (new Vec2(1.0, 0.0)).rotateSelf(Math.deg2rad(this.worldRotation));
                        },
                        set: function (value) {
                            if (value.x === 0.0 && value.y === 0.0) {
                                Fire.warn("Can't get rotation from zero vector");
                                return;
                            }
                            var radians = Math.atan2(value.y, value.x);
                            this.worldRotation = Math.rad2deg(radians);
                        }
                    });

                    ///**
                    // * Subscribe the `onHierarchyChanged` event.
                    // * When this transform or one of its parents' hierarchy changed, the `onHierarchyChanged`
                    // * method will be invoked on supplied instance of Component. If you want to unsubscribe this event,
                    // * you must destroy the Component.
                    // * 这里不支持自定义回调,因为如果忘了反注册很容易就会内存泄漏。
                    // *
                    // * @method Fire.Transform#_addListener
                    // * @param {Component} component - the component to be invoked.
                    // * @private
                    // */
                    //Transform.prototype._addListener = function (component) {
                    //    //if (component.entity === this.entity) {
                    //        if (this._hierarchyChangedListeners) {
                    //            this._hierarchyChangedListeners.push(component);
                    //        }
                    //        else {
                    //            this._hierarchyChangedListeners = [component];
                    //        }
                    //    //}
                    //    //else {
                    //    //    Fire.error("Can not listen other entity's onHierarchyChanged event");
                    //    //}
                    //};

                    //// 这里就算不调用,内存也不会泄露,因为component本身就会被destroy。
                    //// 只不过调用了以后内存能清理的更及时。
                    //Transform.prototype._removeListener = function (component) {
                    //    if (this._hierarchyChangedListeners) {
                    //        var idx = this._hierarchyChangedListeners.indexOf(component);
                    //        this._hierarchyChangedListeners.splice(idx, 1);
                    //    }
                    //};

                    //Transform.prototype._onHierarchyChanged = function (transform, oldParent) {
                    //    // notify self listener
                    //    if (this._hierarchyChangedListeners) {
                    //        for (var i = this._hierarchyChangedListeners.length - 1; i >= 0; --i) {
                    //            var target = this._hierarchyChangedListeners[i];
                    //            if (target.isValid) {
                    //                if (target.onHierarchyChanged(transform, oldParent)) {
                    //                    // 目前只有一种component会终止事件,如果有多种,这里需要做分类
                    //                    return;
                    //                }
                    //            }
                    //            else {
                    //                this._hierarchyChangedListeners.splice(i, 1);
                    //            }
                    //        }
                    //    }
                    //    // notify children
                    //    for (var c = 0, len = this._children.length; c < len; c++) {
                    //        this._children[c]._onHierarchyChanged(transform, oldParent);
                    //    }
                    //};

                    return Transform;
                })();

                Fire.Transform = Transform;


text:
// -----------------------------------------------------------------------------
// persist
// -----------------------------------------------------------------------------

#define marks_min_len   ILKA_CACHE_LINE
#define marks_block_len ILKA_CACHE_LINE
#define marks_block_bits (marks_block_len * 8)

#define marks_trunc_bits ctz(marks_min_len)
#define marks_low_bits   ctz(marks_block_bits)
#define marks_high_bits  (64 - marks_low_bits - marks_trunc_bits)

#define marks_bits  (marks_high_bits * marks_block_bits)
#define marks_words (marks_bits / 64)

struct ilka_persist
{
    struct ilka_region *region;
    const char *file;

    uint64_t *marks;
    ilka_slock lock;
};

static bool persist_init(
        struct ilka_persist *p, struct ilka_region *r, const char *file)
{
    memset(p, 0, sizeof(struct ilka_persist));

    p->region = r;
    p->file = file;
    slock_init(&p->lock);
    p->marks = calloc(marks_words, sizeof(uint64_t));

    return true;
}

static void persist_close(struct ilka_persist *p)
{
    if (p->marks) free(p->marks);
}

static void persist_mark(struct ilka_persist *p, ilka_off_t off, size_t len)
{
    ilka_off_t end = off + len;
    off >>= marks_trunc_bits;

    do {
        size_t msb = clz(off);
        msb = msb < 64 ? 63 - msb : 0;

        size_t high, low, len;

        if (msb < marks_low_bits) {
            high = 0;
            low = off;
            len = marks_min_len;
        }
        else {
            high = (msb - marks_low_bits) + 1;
            low = (off >> (high - 1)) & ((1UL << marks_low_bits) - 1);
            len = marks_min_len << (high - 1);

            // remove any excess bits to ensure that the off increase will
            // correctly represent the area marked for saving.
            off &= ~((1UL << (high - 1)) - 1);
        }

        size_t i = high * marks_block_bits + low;
        ilka_atomic_fetch_or(&p->marks[i / 64], 1UL << (i % 64), morder_relaxed);

        off += len >> marks_trunc_bits;
    } while ((off << marks_trunc_bits) < end);
}

static void persist_save_journal(
        struct ilka_persist *p, uint64_t *marks, size_t region_len)
{
    struct ilka_journal j;
    if (!journal_init(&j, p->region, p->file)) ilka_abort();

    for (size_t i = bitfields_next(marks, 0, marks_bits);
         i < marks_bits;
         i = bitfields_next(marks, i + 1, marks_bits))
    {
        size_t len = marks_min_len;
        size_t off = i % marks_block_bits;
        size_t high = i / marks_block_bits;

        if (high) {
            len <<= high - 1;
            off = (off | (1UL << marks_low_bits)) << (high - 1);
        }

        off <<= marks_trunc_bits;
        if (off + len > region_len) len = region_len - off;

        if (!journal_add(&j, off, len)) ilka_abort();
    }

    if (!journal_finish(&j)) ilka_abort();
}

static bool persist_wait(pid_t pid)
{
    int status;
    do {
        if (waitpid(pid, &status, WUNTRACED) == -1) {
            ilka_fail_errno("unable to wait on persist process: %d", pid);
            return false;
        }
    } while (!WIFEXITED(status) && !WIFSIGNALED(status));

    if (WIFEXITED(status)) {
        if (!WEXITSTATUS(status)) return true;

        ilka_fail("persist process returned error: %d", WEXITSTATUS(status));
        return false;
    }
    else if (WIFSIGNALED(status)) {
        ilka_fail("persist process signaled: %d", WTERMSIG(status));
        return false;
    }

    return true;
}

static bool persist_save(struct ilka_persist *p)
{
    uint64_t *old_marks;
    uint64_t *new_marks = calloc(marks_words, sizeof(uint64_t));

    slock_lock(&p->lock);

    pid_t pid;
    {
        ilka_world_stop(p->region);

        pid = fork();

        old_marks = p->marks;
        p->marks = new_marks;

        ilka_world_resume(p->region);
    }

    if (pid == -1) {
        ilka_fail_errno("unable to fork for persist");
        slock_unlock(&p->lock);
        return false;
    }

    if (!pid) {
        persist_save_journal(p, old_marks, ilka_len(p->region));
        _exit(0);
    }
    else {
        free(old_marks);
        bool ret = persist_wait(pid);

        slock_unlock(&p->lock);
        return ret;
    }
}


text:
{% extends "admin/change_form.html" %}

{% block object-tools %}
{{ block.super }}

History

{{ form.original.history }}

{% endblock %}


text:
namespace printing {

// PrintBackend which doesn't interact with the OS and responses
// can be overridden as necessary.
class TestPrintBackend : public PrintBackend {
 public:
  TestPrintBackend();

  // PrintBackend overrides
  bool EnumeratePrinters(PrinterList* printer_list) override;
  std::string GetDefaultPrinterName() override;
  bool GetPrinterBasicInfo(const std::string& printer_name,
                           PrinterBasicInfo* printer_info) override;
  bool GetPrinterSemanticCapsAndDefaults(
      const std::string& printer_name,
      PrinterSemanticCapsAndDefaults* printer_info) override;
  bool GetPrinterCapsAndDefaults(const std::string& printer_name,
                                 PrinterCapsAndDefaults* printer_info) override;
  std::string GetPrinterDriverInfo(const std::string& printer_name) override;
  bool IsValidPrinter(const std::string& printer_name) override;

  // Methods for test setup.
  // Add printers to the list returned by EnumeratePrinters.
  void PopulatePrinterList(const PrinterList& printer_list);

  // Set a default printer.  The default is the empty string.
  void SetDefaultPrinterName(const std::string& printer_name);

  // Add a printer to satisfy IsValidPrinter and
  // GetPrinterSemanticCapsAndDefualts.
  void AddValidPrinter(const std::string& printer_name,
                       std::unique_ptr<PrinterSemanticCapsAndDefaults> caps);

 protected:
  ~TestPrintBackend() override;

 private:
  std::string default_printer_name_;
  PrinterList printer_list_;
  std::map<std::string, std::unique_ptr<PrinterSemanticCapsAndDefaults>>
      valid_printers_;
};

}  // namespace printing

#endif  // PRINTING_BACKEND_TEST_PRINT_BACKEND_H_


text:
* no release set
* no PI items set
* failed to get features
* failed to load release (to get dates)
* failed to load user stories for release or PIs
* stories from a release
* TODO stories from a selected PIs

Get stories from features, not stories with release (no release is set)


text:
import CardList from './card-list'

export { CardList }


text: Various pieces of code used in slides, StackOverflow answers, etc.