text:
#import <Foundation/Foundation.h>

#import "S3CORSRule.h"

/**
 *
 */
@interface S3BucketCrossOriginConfiguration:NSObject {
}

/** The list of rules */
@property (nonatomic, retain) NSArray *rules;

-(NSString *)toXml;

@end

redpajama_set_name: RedPajamaGithub


text:
using System.ComponentModel;
using System.Runtime.CompilerServices;

namespace SwipeCardView.Sample.ViewModel
{
    public abstract class BasePageViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged([CallerMemberName] string name = null) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
    }
}


text:
mini-obr-runtime-gogo-shell
===========================


text:
\documentclass[math,msc]{uleththesis}

% This is a file that contains all of your \usepackage's and \newcommands
\input{preamble}

% Put your information here.
%  -- If your title is longer than 41 characters, it may be abbreviated.
\title{Biangular Vectors}
\author{Darcy Best}

% This is the year you are getting this degree
\degreeyear{2013}

% Put all of your previous degrees in this format:
\prevdegrees{Bachelor of Science, University of Lethbridge, 2011}

% Put everyone on your Thesis Examination Committee
%  Normally, it will include the following:
%   - Your supervisor(s)
%   - Your committee members
%   - External examiner (maybe)
%   - A chair for your examination
\addsignatureline{Dr. Hadi Kharaghani}{Supervisor}
\addsignatureline{Dr. Howard Cheng}{Committee Member}
\addsignatureline{Dr. Wolfgang Holzmann}{Committee Member}
\addsignatureline{Dr. Mark Walton}{Committee Member}
\addsignatureline{Dr. Amir Akbary-Majdabadno}{Chair, Thesis Examination Committee}

\begin{document}

\frontmatter

\ulethtitle
\ulethapproval

\dedication{
  To all those who pretended to\\know what I was talking about.\\ And to the few that actually understood.
} % End of dedication

\begin{abstract}
This thesis introduces {\it unit weighing matrices}, a generalization of Hadamard matrices. When dealing with unit weighing matrices, a lot of the structure that is held by Hadamard matrices is lost, but this loss of rigidity allows these matrices to be used in the construction of certain combinatorial objects. We are able to fully classify these matrices for many small values by defining equivalence classes analogous to those found with Hadamard matrices. We then proceed to introduce an extension to mutually unbiased bases, called {\it mutually unbiased weighing matrices}, by allowing for different subsets of vectors to be orthogonal. The bounds on the size of these sets of matrices, both lower and upper, are examined. In many situations, we are able to show that these bounds are sharp. Finally, we show how these sets of matrices can be used to generate combinatorial objects such as strongly regular graphs and association schemes.
\end{abstract}

\acknowledgments{
 \noindent This journey started nearly five years ago when a professor was handing out our calculus final exams. As he handed me the exam, he spoke to me for the first time and said ``You're working with me this summer.'' I can never thank Dr. Hadi~Kharaghani enough for taking a chance on me and teaching me what I know today, so I will leave it at {\it Thank~you}.

\vskip10pt

 \noindent I also wish to thank another professor at the University of Lethbridge, Dr. Howard~Cheng, for teaching me almost everything that I know about computer programming -- all of the good habits, and the bad.

\vskip10pt

 \noindent A lot of the ground work in this thesis was laid out while I was working with Hugh~Ramp. I need to thank him for keeping me in line and for the many great insights. You are a great friend.

\vskip10pt

 \noindent There are way too many people to thank, so I will use their initials and leave it to the reader as an exercise to figure out exactly who they are. \Smiley

\vskip10pt

 \noindent As always, my family drives me forward:

\begin{center}BB, KB, TB, BS and MS.\end{center}

\vskip10pt

 \noindent There are many people inside and outside the university that have guided my way through this process. I will list some here -- I'm sure that I will miss someone, and for that, I am sorry.

 \begin{center} AA, JB, ATF, BF, wG, KG,  BH, TH, WH, AL, SL, TT, MW, VW and SY.\end{center}

\vskip5pt

 Thank you.
} % End of acknowledgments

\tableofcontents
\listoftables
% \listoffigures

\mainmatter

\input{ch1}
\input{ch2}
\input{ch3}
\input{ch4}
\input{ch5}

\bibliography{thesis-refs} % References come BEFORE appendices.

\appendix \appendixarray

\input{app-ch3-cases}
\input{app-ch4-cases}
\input{app-unit-wm}
\input{app-sets}
\input{app-comb-objects}

\end{document}


text:
int ComputeSYMGS_ref( const SparseMatrix  & A, const Vector & r, Vector & x);

#endif // COMPUTESYMGS_REF_HPP


text:
require 'spec_helper'

describe Imagga::Image do
  subject { described_class.new(url: 'http://', id: '1234') }

  it "has id" do
    subject.id.should == '1234'
  end

  it "has url" do
    subject.url.should == 'http://'
  end

  context "without url" do
    it "throws ArgumentError" do
      expect{ described_class.new(id: '1234') }.to raise_error(ArgumentError, 'url is missing')
    end
  end

  context "without id" do
    it "assigns id as 0" do
      described_class.new(url: 'http://').id.should == 0
    end
  end
end


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Tokenizer | Typesetter</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="../assets/css/main.css">

						Search
						<input id="tsd-search-field" type="text" />

Preparing search index...

The search index is not available

					Typesetter

						Options

								All

Public

Public/Protected

All

							<input type="checkbox" id="tsd-filter-inherited" checked />
							Inherited
							<input type="checkbox" id="tsd-filter-externals" checked />
							Externals
							<input type="checkbox" id="tsd-filter-only-exported" />
							Only exported

					Menu

					Globals

					Tokenizer

Class Tokenizer

Copyright 2017-present Palantir Technologies, Inc. All rights reserved.
							Licensed under the MIT License (the "License"); you may obtain a copy of the
						license at https://github.com/palantir/typesettable/blob/develop/LICENSE

Hierarchy

						Tokenizer

Index

Properties

Whitespace<wbr>Reg<wbr>Exp

Word<wbr>Divider<wbr>Reg<wbr>Exp

Methods

should<wbr>Create<wbr>New<wbr>Token

tokenize

Properties

Private Whitespace<wbr>Reg<wbr>Exp

Whitespace<wbr>Reg<wbr>Exp: RegExp = new RegExp("\\s")

Defined in utils/tokenizer.ts:9

Private Word<wbr>Divider<wbr>Reg<wbr>Exp

Word<wbr>Divider<wbr>Reg<wbr>Exp: RegExp = new RegExp("\\W")

Defined in utils/tokenizer.ts:8

Methods

Private should<wbr>Create<wbr>New<wbr>Token

should<wbr>Create<wbr>New<wbr>Token(token: string, newCharacter: string): Array<string>

Defined in utils/tokenizer.ts:18

Parameters

token: string

newCharacter: string

Returns Array<string>

tokenize

tokenize(line: string): string[]

Defined in utils/tokenizer.ts:11

Parameters

line: string

Returns string[]

						Globals

						Abstract<wbr>Measurer

						Cache

						Cache<wbr>Character<wbr>Measurer

						Cache<wbr>Measurer

						Canvas<wbr>Context

						Character<wbr>Measurer

						Html<wbr>Context

						Html<wbr>Utils

						Measurer

						Methods

						Single<wbr>Line<wbr>Wrapper

						String<wbr>Methods

						Svg<wbr>Context

						Svg<wbr>Utils

						Tokenizer

								Whitespace<wbr>Reg<wbr>Exp

								Word<wbr>Divider<wbr>Reg<wbr>Exp

								should<wbr>Create<wbr>New<wbr>Token

								tokenize

						Typesetter

						Wrapper

						Writer

						IBreaking<wbr>Token<wbr>Result

						ICanvas<wbr>Font<wbr>Style

						IDimensions

						IEllipsis<wbr>Result

						IIterative<wbr>Wrapping<wbr>State

						IPen

						IPen<wbr>Factory<wbr>Context

						IRuler<wbr>Factory<wbr>Context

						ITemporary<wbr>Text<wbr>Element<wbr>Harness

						ITransform

						ITypesetter<wbr>Context

						IWrapping<wbr>Result

						IWrite<wbr>Options

						IAnchor

						IPen<wbr>Factory

						IRuler

						IRuler<wbr>Factory

						IXAlign

						IYAlign

						DEFAULT_<wbr>FILL_<wbr>COLOR

						DEFAULT_<wbr>WRITE_<wbr>OPTIONS

Legend

Module

Object literal

Variable

Function

Function with type parameter

Index signature

Type alias

Enumeration

Enumeration member

Property

Method

Interface

Interface with type parameter

Constructor

Property

Method

Index signature

Class

Class with type parameter

Constructor

Property

Method

Accessor

Index signature

Inherited constructor

Inherited property

Inherited method

Inherited accessor

Protected property

Protected method

Protected accessor

Private property

Private method

Private accessor

Static property

Static method

Generated using TypeDoc


text:
package im.bci.jnuit.lwjgl.animation;

import im.bci.jnuit.animation.IAnimationImage;
import im.bci.jnuit.lwjgl.assets.Texture;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import org.lwjgl.opengl.GL11;

/**
 *
 * @author devnewton
 */
public class NanimationImage implements IAnimationImage {

    private final int id;
    private final boolean alpha;

    public NanimationImage(boolean alpha) {
        ByteBuffer temp = ByteBuffer.allocateDirect(4);
        temp.order(ByteOrder.nativeOrder());
        IntBuffer intBuffer = temp.asIntBuffer();
        GL11.glGenTextures(intBuffer);
        id = intBuffer.get(0);
        this.alpha = alpha;
    }

    public NanimationImage(Texture texture) {
        this.id = texture.getId();
        this.alpha = texture.hasAlpha();
    }

    @Override
    public Object getId() {
        return id;
    }

    @Override
    public boolean hasAlpha() {
        return alpha;
    }
}


text:
import SwaggerUI from 'swagger-ui-dist/swagger-ui-es-bundle.js';
import 'swagger-ui-dist/swagger-ui.css';

window.addEventListener('load', async () => {
  const url = document.getElementById('swagger-ui').dataset.source;
  const res = await fetch(url);
  const spec = await res.json();

  // Make the page's protocol be at the top of the schemes list
  const proto = window.location.protocol.slice(0, -1);
  spec.schemes.sort((a, b) => {
    if (a === proto) return -1;
    if (b === proto) return 1;
    return 0;
  });

  const ui = SwaggerUI({
    spec,
    dom_id: '#swagger-ui',
    deepLinking: true,
    docExpansion: 'none',
    defaultModelRendering: 'model', // don't show examples by default, because they may be incomplete
    presets: [
      SwaggerUI.presets.apis
    ],
    plugins: [
      SwaggerUI.plugins.DownloadUrl
    ]
  });

  window.ui = ui;
});


text:
<?php

namespace Zend\Form\View\Helper;

use Zend\Form\FieldsetInterface;
use Zend\Form\FormInterface;
use Zend\View\Helper\Doctype;

/**
 * View helper for rendering Form objects
 */
class Form extends AbstractHelper
{
    /**
     * Attributes valid for this tag (form)
     *
     * @var array
     */
    protected $validTagAttributes = [
        'accept-charset' => true,
        'action'         => true,
        'autocomplete'   => true,
        'enctype'        => true,
        'method'         => true,
        'name'           => true,
        'novalidate'     => true,
        'target'         => true,
    ];

    /**
     * Invoke as function
     *
     * @param  null|FormInterface $form
     * @return Form|string
     */
    public function __invoke(FormInterface $form = null)
    {
        if (!$form) {
            return $this;
        }

        return $this->render($form);
    }

    /**
     * Render a form from the provided $form,
     *
     * @param  FormInterface $form
     * @return string
     */
    public function render(FormInterface $form)
    {
        if (method_exists($form, 'prepare')) {
            $form->prepare();
        }

        $formContent = '';

        foreach ($form as $element) {
            if ($element instanceof FieldsetInterface) {
                $formContent.= $this->getView()->formCollection($element);
            } else {
                $formContent.= $this->getView()->formRow($element);
            }
        }

        return $this->openTag($form) . $formContent . $this->closeTag();
    }

    /**
     * Generate an opening form tag
     *
     * @param  null|FormInterface $form
     * @return string
     */
    public function openTag(FormInterface $form = null)
    {
        $doctype    = $this->getDoctype();
        $attributes = [];

        if (! (Doctype::HTML5 === $doctype || Doctype::XHTML5 === $doctype)) {
            $attributes = [
                'action' => '',
                'method' => 'get',
            ];
        }

        if ($form instanceof FormInterface) {
            $formAttributes = $form->getAttributes();
            if (!array_key_exists('id', $formAttributes) && array_key_exists('name', $formAttributes)) {
                $formAttributes['id'] = $formAttributes['name'];
            }
            $attributes = array_merge($attributes, $formAttributes);
        }

        if ($attributes) {
            return sprintf('<form %s>', $this->createAttributesString($attributes));
        }

        return '<form>';
    }

    /**
     * Generate a closing form tag
     *
     * @return string
     */
    public function closeTag()
    {
        return '</form>';
    }
}


text:
using System;

using System.Windows;

using System.Windows.Controls;

using Rhino.UI.Controls;
using Eto.Forms;
using Eto.Drawing;
using Wind.Geometry.Vectors;

namespace Parrot.Controls
{
    public class pViewport : pControl
    {
        public StackPanel Element = new StackPanel();
        public ViewportControl RhinoViewer = new ViewportControl();

        public bool Status;

        public enum CameraProjection { Parallel, Perspective, TwoPoint };
        public CameraProjection ProjectionMode = CameraProjection.Parallel;

        public pViewport(string InstanceName)
        {
            RhinoViewer = new ViewportControl();
            Element = new StackPanel();
            Element.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            Element.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;

            Element.MinWidth = 300;
            Element.MinHeight = 300;

            RhinoViewer.Width = 300;
            RhinoViewer.Height = 300;

            Element.Name = InstanceName;
            Type = "Viewport";

        }

        public void BuildView()
        {

            var nativeControl = RhinoViewer.ToNative(false);
            nativeControl.Width = RhinoViewer.Width;
            nativeControl.Height = RhinoViewer.Height;

            Element.Children.Clear();
            Element.Children.Add(nativeControl);

        }

        public void SetViewPort(Rhino.Display.RhinoViewport SampleViewPort)
        {
            RhinoViewer.Viewport.DisplayMode = SampleViewPort.DisplayMode;
        }

        public void SetProperties(string Text)
        {
            RhinoViewer.Viewport.Name = Text;
        }

        public void SetCameraProjection(CameraProjection SetProjectionMode, double Length)
        {
            ProjectionMode = SetProjectionMode;

            switch (ProjectionMode)
            {
                default:
                    RhinoViewer.Viewport.ChangeToParallelProjection(true);
                    break;
                case CameraProjection.Perspective:
                    RhinoViewer.Viewport.ChangeToPerspectiveProjection(true, 50);
                RhinoViewer.Viewport.Camera35mmLensLength = Length;
                    break;
                case CameraProjection.TwoPoint:
                    RhinoViewer.Viewport.ChangeToTwoPointPerspectiveProjection(50);
                    RhinoViewer.Viewport.Camera35mmLensLength = Length;
                    break;
            }

        }

        public void SetCameraPosition(wPoint LocationPoint, wPoint TargetPoint, wVector UpVector)
        {
            RhinoViewer.Viewport.SetCameraLocation(new Rhino.Geometry.Point3d(LocationPoint.X, LocationPoint.Y, LocationPoint.Z), false);
            RhinoViewer.Viewport.SetCameraTarget(new Rhino.Geometry.Point3d(TargetPoint.X, TargetPoint.Y, TargetPoint.Z), false);
            RhinoViewer.Viewport.CameraUp = new Rhino.Geometry.Vector3d(UpVector.X, UpVector.Y, UpVector.Z);
        }

        public void SetViewShading(Rhino.Display.DisplayModeDescription Shader)
        {

            RhinoViewer.Viewport.DisplayMode = Shader;
        }

        public void SetGridAxis(bool HasGrid, bool HasAxis, bool HasGizmo)
        {
            RhinoViewer.Viewport.ConstructionGridVisible = HasGrid;
            RhinoViewer.Viewport.ConstructionAxesVisible = HasAxis;
            RhinoViewer.Viewport.WorldAxesVisible = HasGizmo;
        }

        public void ZoomExtents()
        {
            RhinoViewer.Viewport.ZoomExtents();
        }

        public void ZoomSelected()
        {
            RhinoViewer.Viewport.ZoomExtentsSelected();
        }

        public override void SetFill()
        {
        }

        public override void SetStroke()
        {
        }

        public override void SetSize()
        {

            if (Graphics.Width < 1)
            {
                RhinoViewer.Width = 300;
            }
            else
            {
                RhinoViewer.Width = (int)Graphics.Width;
            }

            if (Graphics.Height < 1)
            {
                RhinoViewer.Height = 300;
            }
            else
            {
                RhinoViewer.Height = (int)Graphics.Height;
            }
        }

        public void ResetGraphics()
        {
            Element.Margin = new Thickness(0);

        }

        public override void SetMargin()
        {
            Element.Margin = new Thickness(Graphics.Margin[0], Graphics.Margin[1], Graphics.Margin[2], Graphics.Margin[3]);
        }

        public override void SetPadding()
        {
        }

        public override void SetFont()
        {
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/mapfile_item"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="3dip"
    android:background="?background_color"
    android:orientation="vertical"
    android:paddingBottom="7dip"
    android:paddingLeft="5dip"
    android:paddingRight="5dip"
    android:paddingTop="7dip"
    tools:context=".ui.FileSelectionListAdapter" >

    <TextView
        android:id="@+id/mapfilepath"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:gravity="right"
        android:lines="1"
        android:scrollHorizontally="true"
        android:textColor="?text_color_grey"
        android:textIsSelectable="false"
        android:textSize="12sp"
        tools:text="file path"
        android:maxLines="1" />

    <TextView
        android:id="@+id/mapfilename"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:gravity="left"
        android:lines="1"
        android:scrollHorizontally="true"
        android:textColor="?text_color"
        android:textIsSelectable="false"
        android:textSize="22sp"
        tools:text="file name"
        android:maxLines="1" />

</LinearLayout>


text:
#ifndef __UTIL_DOT_H__
#define __UTIL_DOT_H__

#include <linux/mempool.h>

#include "incore.h"

#define fs_printk(level, fs, fmt, arg...) \
	printk(level "GFS2: fsid=%s: " fmt , (fs)->sd_fsname , ## arg)

#define fs_info(fs, fmt, arg...) \
	fs_printk(KERN_INFO , fs , fmt , ## arg)

#define fs_warn(fs, fmt, arg...) \
	fs_printk(KERN_WARNING , fs , fmt , ## arg)

#define fs_err(fs, fmt, arg...) \
	fs_printk(KERN_ERR, fs , fmt , ## arg)

void gfs2_assert_i(struct gfs2_sbd *sdp);

#define gfs2_assert(sdp, assertion) \
do { \
	if (unlikely(!(assertion))) { \
		gfs2_assert_i(sdp); \
		BUG(); \
        } \
} while (0)

int gfs2_assert_withdraw_i(struct gfs2_sbd *sdp, char *assertion,
			   const char *function, char *file, unsigned int line);

#define gfs2_assert_withdraw(sdp, assertion) \
((likely(assertion)) ? 0 : gfs2_assert_withdraw_i((sdp), #assertion, \
					__func__, __FILE__, __LINE__))

int gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion,
		       const char *function, char *file, unsigned int line);

#define gfs2_assert_warn(sdp, assertion) \
((likely(assertion)) ? 0 : gfs2_assert_warn_i((sdp), #assertion, \
					__func__, __FILE__, __LINE__))

int gfs2_consist_i(struct gfs2_sbd *sdp, int cluster_wide,
		   const char *function, char *file, unsigned int line);

#define gfs2_consist(sdp) \
gfs2_consist_i((sdp), 0, __func__, __FILE__, __LINE__)

int gfs2_consist_inode_i(struct gfs2_inode *ip, int cluster_wide,
			 const char *function, char *file, unsigned int line);

#define gfs2_consist_inode(ip) \
gfs2_consist_inode_i((ip), 0, __func__, __FILE__, __LINE__)

int gfs2_consist_rgrpd_i(struct gfs2_rgrpd *rgd, int cluster_wide,
			 const char *function, char *file, unsigned int line);

#define gfs2_consist_rgrpd(rgd) \
gfs2_consist_rgrpd_i((rgd), 0, __func__, __FILE__, __LINE__)

int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
		       const char *type, const char *function,
		       char *file, unsigned int line);

static inline int gfs2_meta_check(struct gfs2_sbd *sdp,
				    struct buffer_head *bh)
{
	struct gfs2_meta_header *mh = (struct gfs2_meta_header *)bh->b_data;
	u32 magic = be32_to_cpu(mh->mh_magic);
	if (unlikely(magic != GFS2_MAGIC)) {
		printk(KERN_ERR "GFS2: Magic number missing at %llu\n",
		       (unsigned long long)bh->b_blocknr);
		return -EIO;
	}
	return 0;
}

int gfs2_metatype_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
			   u16 type, u16 t,
			   const char *function,
			   char *file, unsigned int line);

static inline int gfs2_metatype_check_i(struct gfs2_sbd *sdp,
					struct buffer_head *bh,
					u16 type,
					const char *function,
					char *file, unsigned int line)
{
	struct gfs2_meta_header *mh = (struct gfs2_meta_header *)bh->b_data;
	u32 magic = be32_to_cpu(mh->mh_magic);
	u16 t = be32_to_cpu(mh->mh_type);
	if (unlikely(magic != GFS2_MAGIC))
		return gfs2_meta_check_ii(sdp, bh, "magic number", function,
					  file, line);
        if (unlikely(t != type))
		return gfs2_metatype_check_ii(sdp, bh, type, t, function,
					      file, line);
	return 0;
}

#define gfs2_metatype_check(sdp, bh, type) \
gfs2_metatype_check_i((sdp), (bh), (type), __func__, __FILE__, __LINE__)

static inline void gfs2_metatype_set(struct buffer_head *bh, u16 type,
				     u16 format)
{
	struct gfs2_meta_header *mh;
	mh = (struct gfs2_meta_header *)bh->b_data;
	mh->mh_type = cpu_to_be32(type);
	mh->mh_format = cpu_to_be32(format);
}

int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function,
		    char *file, unsigned int line);

#define gfs2_io_error(sdp) \
gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__);

int gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
		       const char *function, char *file, unsigned int line);

#define gfs2_io_error_bh(sdp, bh) \
gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__);

extern struct kmem_cache *gfs2_glock_cachep;
extern struct kmem_cache *gfs2_glock_aspace_cachep;
extern struct kmem_cache *gfs2_inode_cachep;
extern struct kmem_cache *gfs2_bufdata_cachep;
extern struct kmem_cache *gfs2_rgrpd_cachep;
extern struct kmem_cache *gfs2_quotad_cachep;
extern struct kmem_cache *gfs2_rsrv_cachep;
extern mempool_t *gfs2_page_pool;

static inline unsigned int gfs2_tune_get_i(struct gfs2_tune *gt,
					   unsigned int *p)
{
	unsigned int x;
	spin_lock(&gt->gt_spin);
	x = *p;
	spin_unlock(&gt->gt_spin);
	return x;
}

#define gfs2_tune_get(sdp, field) \
gfs2_tune_get_i(&(sdp)->sd_tune, &(sdp)->sd_tune.field)

int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...);

#endif /* __UTIL_DOT_H__ */


text:
 #         @@workers = 0
#          p "workers was nil"
#        else
#          p "workers was not nil: " + @@workers.to_s + " " + Time.now.to_s
#        end
#        if @@workers == 0
#          Autoscale.add_workers(1)
#          p "adding workers: " + @@workers.to_s + " " + Time.now.to_s
#        else
#          Autoscale.reset_worker_close
#          p "delete workers: " + Time.now.to_s
#          #logic to check if the queue is too long and more workers are needed
#        end
#      end
#    end
#
#    def self.add_workers(number)
#      if ENV["RAILS_ENV"] == "production"
#        @@heroku.set_workers(APP_NAME, @workers + number)
#      else
#        @@workers = 1
#      end
#      Autoscale.set_worker_close
#    end
#
#    def self.reset_worker_close
#      Autoscale.delete_worker_close
#      Autoscale.set_worker_close
#    end
#
#    def self.set_worker_close
#      Autoscale.delay(:run_at => 30.seconds.from_now).worker_close
#    end
#
#    def self.worker_close
#      #Do I need to stop worker processing?
#      if ENV["RAILS_ENV"] == "production"
#        p Delayed_Job.where(:run_at => Time.now.to_date..2.days.from_now.to_date, :last_error => nil).all.count.to_i
#        if Delayed_Job.where(:run_at => Time.now.to_date..2.days.from_now.to_date, :last_error => nil).all.count.to_i > 0
#          @@heroku.set_workers(APP_NAME, 0)
#        else
#          p Delayed_Job.where(:run_at => Time.now.to_date..2.days.from_now.to_date, :last_error => nil).all.inspect
#          Autoscale.set_worker_close
#        end
#      else
#        if Delayed_Job.where(:run_at => Time.now.to_date..2.days.from_now.to_date, :last_error => nil).all.count.to_i <= 1
#          p @@workers = 0
#        else
#          p Autoscale.set_worker_close
#        end
#      end
#    end
#
#    def self.delete_worker_close
#      close_instructions = Delayed_Job.where(["handler LIKE ?","%method_name: :worker_close%"]).all
#      close_instructions.each do |e|
#        p e.destroy
#      end
#    end

#end


text:
Check our cats location

Find out more


text:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

          <title>PathParser - apollo-util 1.7 API - org.apache.activemq.apollo.util.path.PathParser</title>
          <meta name="description" content="PathParser - apollo - util 1.7 API - org.apache.activemq.apollo.util.path.PathParser" />
          <meta name="keywords" content="PathParser apollo util 1.7 API org.apache.activemq.apollo.util.path.PathParser" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

org.apache.activemq.apollo.util.path

PathParser

        class

        PathParser extends AnyRef

          Linear Supertypes

AnyRef, Any

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By inheritance

                Inherited

PathParser

AnyRef

Any

Hide All

Show all

            Learn more about member selection

            Visibility

Public

All

Instance Constructors

        new

        PathParser()

Type Members

        class

        LitteralPathFilter extends PartFilter

Value Members

        final
        def

        !=(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

Any

        var

        any_child_wildcard: String

        var

        any_descendant_wildcard: String

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws()

        def

        copy(other: PathParser): PathParser

        def

        decode_filter(path: String): PathFilter

        def

        decode_path(subject: String): Path

        def

        decode_path(parts: Iterable[String]): Path

        def

        encode_path(path: Path): String

Converts the path back to the string representation.

Converts the path back to the string representation.

returns

        def

        encode_path_iter(parts: Iterable[String]): String

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws()

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        var

        part_pattern: Pattern

        def

        parts(subject: String): Array[String]

        def

        path_parts(path: Path): Array[String]

        var

        path_separator: String

        def

        regex_map[T](text: String, pattern: Pattern)(func: (Either[CharSequence, Matcher]) ⇒ T): List[T]

        var

        regex_wildcard_end: String

        var

        regex_wildcard_start: String

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        toString(): String

Definition Classes

AnyRef → Any

        def

        url_decode(value: String): String

        def

        url_encode(value: String, allowed: Pattern): String

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws()

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws()

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws()

        lazy val

        wildcard_part_pattern: Pattern

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
require_relative 'helper'

class TestPhoneNumberTW < Test::Unit::TestCase
  include DeterministicHelper

  assert_methods_are_deterministic(
    FFaker::PhoneNumberTW,
    :mobile_phone_number, :home_work_phone_number, :phone_number,
    :international_mobile_phone_number, :international_home_work_phone_number,
    :international_phone_number
  )

  def setup
    @tester = FFaker::PhoneNumberTW
  end

  def test_mobile_phone_number
    assert_match(/09\d{2}-\d{3}-\d{3}/, @tester.mobile_phone_number)
  end

  def test_home_work_phone_number
    assert_match(/\(0\d\) \d{3,4}-\d{4}/, @tester.home_work_phone_number)
  end

  def test_phone_number
    10.times do
      assert_match(/\(*0\d{1,3}\)*[\s-]\d{3,4}-\d{3,4}/, @tester.phone_number)
    end
  end

  def test_international_mobile_phone_number
    assert_match(/\+886-9\d{2}-\d{3}-\d{3}/,
                 @tester.international_mobile_phone_number)
  end

  def test_international_home_work_phone_number
    assert_match(/\+886-\d{1}-\d{3,4}-\d{4}/,
                 @tester.international_home_work_phone_number)
  end
end


text:
package com.once.crosscloud.cores.shiro.filter;

import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.DefaultSessionKey;
import org.apache.shiro.session.mgt.SessionManager;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.AccessControlFilter;
import org.apache.shiro.web.util.WebUtils;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.Serializable;
import java.util.Deque;
import java.util.LinkedList;

/**
 * 当同一用户在多个地方登录时,如果超出最大会话数,则最早登录的用户会被强制退出
 * @author wjggwm
 *
 */
public class KickoutSessionFilter extends AccessControlFilter {

	/*
	 * 强制退出后跳转地址
	 */
    private String kickoutUrl;
    /*
     * 强制退出之前登录的/之后登录的用户,默认退出之前登录的用户
     */
    private boolean kickoutAfter = false; //
    /*
     * 同一个帐号最大会话数,默认1
     */
    private int maxSession = 1;
    /*
     * 会话管理器
     */
    private SessionManager sessionManager;
    /*
     * 缓存,记录用户登录信息
     * 存储格式	Cache<userName,Deque>
     */
    private Cache<String, Deque<Serializable>> cache;

    public void setKickoutUrl(String kickoutUrl) {
        this.kickoutUrl = kickoutUrl;
    }

    public void setKickoutAfter(boolean kickoutAfter) {
        this.kickoutAfter = kickoutAfter;
    }

    public void setMaxSession(int maxSession) {
        this.maxSession = maxSession;
    }

    public void setSessionManager(SessionManager sessionManager) {
        this.sessionManager = sessionManager;
    }

    public void setCacheManager(CacheManager cacheManager) {
        this.cache = cacheManager.getCache("shiro-kickout-session");
    }

    @Override
    protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) throws Exception {
        return false;
    }

    @Override
    protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
        Subject subject = getSubject(request, response);
        if(!subject.isAuthenticated() && !subject.isRemembered()) {
            //如果没有登录,直接进行之后的流程
            return true;
        }

        Session session = subject.getSession();
        String username = (String) subject.getPrincipal();
        Serializable sessionId = session.getId();

        //TODO 同步控制
        Deque<Serializable> deque = cache.get(username);
        if(deque == null) {
            deque = new LinkedList<Serializable>();
            cache.put(username, deque);
        }

        //如果队列里没有此sessionId,且用户没有被踢出;放入队列
        if(!deque.contains(sessionId) && session.getAttribute("kickout") == null) {
            deque.push(sessionId);
        }

        //如果队列里的sessionId数超出最大会话数,开始踢人
        while(deque.size() > maxSession) {
            Serializable kickoutSessionId = null;
            if(kickoutAfter) { //如果踢出后者
                kickoutSessionId = deque.removeFirst();
            } else { //否则踢出前者
                kickoutSessionId = deque.removeLast();
            }
            try {
                Session kickoutSession = sessionManager.getSession(new DefaultSessionKey(kickoutSessionId));
                if(kickoutSession != null) {
                    //设置会话的kickout属性表示踢出了
                    kickoutSession.setAttribute("kickout", true);
                }
            } catch (Exception e) {//ignore exception
            }
        }

        //如果被踢出了,直接退出,重定向到踢出后的地址
        if (session.getAttribute("kickout") != null) {
            //会话被踢出了
            try {
                subject.logout();
            } catch (Exception e) { //ignore
            }
            saveRequest(request);
            WebUtils.issueRedirect(request, response, kickoutUrl);
            return false;
        }

        return true;
    }
}


text:
package com.vaadin.tests.server.component.abstractcomponent;

import junit.framework.TestCase;

import com.vaadin.ui.AbstractComponent;

public class AbstractComponentStyleNamesTest extends TestCase {

    public void testSetMultiple() {
        AbstractComponent component = getComponent();
        component.setStyleName("style1 style2");
        assertEquals(component.getStyleName(), "style1 style2");
    }

    public void testSetAdd() {
        AbstractComponent component = getComponent();
        component.setStyleName("style1");
        component.addStyleName("style2");
        assertEquals(component.getStyleName(), "style1 style2");
    }

    public void testAddSame() {
        AbstractComponent component = getComponent();
        component.setStyleName("style1 style2");
        component.addStyleName("style1");
        assertEquals(component.getStyleName(), "style1 style2");
    }

    public void testSetRemove() {
        AbstractComponent component = getComponent();
        component.setStyleName("style1 style2");
        component.removeStyleName("style1");
        assertEquals(component.getStyleName(), "style2");
    }

    public void testAddRemove() {
        AbstractComponent component = getComponent();
        component.addStyleName("style1");
        component.addStyleName("style2");
        component.removeStyleName("style1");
        assertEquals(component.getStyleName(), "style2");
    }

    public void testRemoveMultipleWithExtraSpaces() {
        AbstractComponent component = getComponent();
        component.setStyleName("style1 style2 style3");
        component.removeStyleName(" style1  style3 ");
        assertEquals(component.getStyleName(), "style2");
    }

    public void testSetWithExtraSpaces() {
        AbstractComponent component = getComponent();
        component.setStyleName(" style1  style2 ");
        assertEquals(component.getStyleName(), "style1 style2");
    }

    private AbstractComponent getComponent() {
        return new AbstractComponent() {
        };
    }
}


text:
package ru.technoserv.config;

import org.springframework.cache.annotation.EnableCaching;
import net.sf.ehcache.CacheManager;
import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.cache.ehcache.EhCacheManagerFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;

@Configuration
@EnableCaching
public class CacheConfig {

    @Bean
    public EhCacheCacheManager cacheManager(CacheManager cacheManager) {
        return new EhCacheCacheManager(cacheManager);
    }

    @Bean
    public EhCacheManagerFactoryBean ehcache(){
        EhCacheManagerFactoryBean ehCacheManagerFactoryBean = new EhCacheManagerFactoryBean();
        ehCacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml"));
        ehCacheManagerFactoryBean.setShared(true);
        return ehCacheManagerFactoryBean;
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>RiBuild Sampling — Delphin Automation 0.1 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Sampling" href="sampling_sampling.html" />
    <link rel="prev" title="Weather Parser" href="weather_parser.html" />

  <link rel="stylesheet" href="_static/custom.css" type="text/css" />

  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

RiBuild Sampling¶

This module handles the probabilistic sampling for the simulation

Contents:

Sampling

Inputs

Sobol Library

Related Topics

Documentation overview

Previous: Weather Parser

Next: Sampling

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

      ©2018, Christian Kongsgaard, Thomas Perkov.

      |
      Powered by Sphinx 1.7.7
      & Alabaster 0.7.11

      |
      Page source


text:
class BinaryFileLogger
{
public:
	BinaryFileLogger(LoggerParameters loggerParams, double(SystemState::* loggedField), std::string coordinateName);
	~BinaryFileLogger();
	void save(const SystemState* systemState);

private:
	void flush();

	static constexpr std::size_t _buffsize = 4096 / sizeof(double); //previous buffer 4096
	std::ofstream _file;
	double(SystemState::* _loggedField);
	std::vector <double> _buffer;
};