text:
<!DOCTYPE html>

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="Pierrepont Solutions">
  <link rel="shortcut icon" href="../favicon.ico"/>

  <title>The Pierrepont School</title>

  <link href="../css/bootstrap.min.css" rel="stylesheet">
  <link href="../css/bootstrap-theme.min.css" rel="stylesheet">

  <link href="../css/main.css" rel="stylesheet">
  <link href="../css/page.css" rel="stylesheet">

  <link rel="stylesheet" href="../css/main-port.css"></link>

        Pierrepont

          School

            About

                Overview

                Mission Statement

                Founder's Statement

                From the Head

                Alumni

                Administration

            Faculty

                Faculty

            Curriculum

                Humanities

                Sciences

                Arts

                Lower School

            Community

                Community

                Calendar

            Admissions

                Apply

                FAQs

            Contact

                Contact

Matthew Huggins

Massachusetts Institute of Technology '19

                            Plans to pursue a Master's in Electrical Engineering and Computer Science.

                            "I love everyone in the Pierrepont community because of their insatiable intellectual vitality and the never-ending joy they bring to learning and all other parts of life. Pierrepont has kindled in me the greatest desire for understanding, the highest levels of integrity, and an undying love for learning."

Caleb Shapiro

Swarthmore College '19

                            Considering Majoring in History.

                            "My favorite thing about Pierrepont is how respect and friendship freely flow between students and teachers."

Gabe Groz

Really Good School '19

                            Plans to pursue a moose

                            "Quote"

Michael Berson

Really Good School '19

                            Plans to pursue a moose

                            "Quote"

Noah Arthurs

Stanford University '18

                            Plans on Majoring in Classics. Two time Rubik's Cube Blindfolded National Champion and National Record holder for over two years.

                            "My favorite thing about Pierrepont: The community. There are always people to share ideas with or engage in conversation. Teachers are always there to help you, and crazy ideas like a school-wide Rocks Paper Scissors tournament bring everyone together."

Tyler Leite

Rensselaer Polytechnic Institute '18

                            Pursuing a Master's in Computer Science, considering a dual major in Game Systems and Simulation. Plans to pursue a PhD in Computer science, and hopes to work in natural language processing.

                            "What is truly special about Pierrepont, and what I never really realized was special until I graduated and started talking about high school experiences with people at college, is the sense of intellectual freedom at the school. Being able to take courses that are right for you, and having teachers who really are friends to the students rather than just authority figures, leads to students being able to develop a firm understanding of and real appreciation for the material at hand."

Téa Beer

Yale University '17

                            Majoring in Art. Considering pursuing a Master's in Fine Arts.

                            "At Pierrepont I learned how to love the process of learning, something I find cherished by not as many people as one might hope. I also found a deeply kind, welcoming community, which has driven me to seek communities of similar warmth here at Yale."

Luke Thompson

Stanford University '16

                          Currently pursuing a Bachelor of Arts with Honors in English.

                          "My favorite thing about Pierrepont is feeling that my teachers cared about my well-being."

Sonia Peña

Smith College '16

                          Pursuing a Double Major in Government and Spanish.

                          "I find that I have little difficulty connecting with my professors and reaching out for help because of the relationships I formed with my teachers at Pierrepont due to the small community."

Allie Leite

Hampshire College '16

                          Pursuing a Major in Dance Performance and Choreography and a Minor in Dance Education.

                          "Pierrepont prepared me for graduation by providing an environment where I could find myself and explore my interests, talents and always aspire to follow in the footsteps of my teachers who had achieved so many amazing things."

                          "My favorite thing about Pierrepont is the ability to learn everything. Being able to exercise my mind through so many different mediums is a privilege I really miss."


text:
package sigar

// #include <stdlib.h>
// #include <windows.h>
import "C"

import (
	"fmt"
	"syscall"
)

type WindowsVolumeIterator struct {
	handle     C.HANDLE
	buffer     []uint16
	bufferSize C.DWORD
	volume     FileSystem
	err        error
	hasNext    bool
}

// Get the first mount point for the volume. If we get an ERROR_MORE_DATA,
// don't return an error, but return the expected buffer size.
// You can attempt to call the method again with the larger buffer size
func getVolumePathName(wideName []uint16, bufferSize uint16) (string, error, uint16) {
	charsLen := C.DWORD(bufferSize)
	expectedBuffer := C.DWORD(0)
	chars := make([]uint16, charsLen)

	if C.GetVolumePathNamesForVolumeNameW((*C.WCHAR)(&wideName[0]), (*C.WCHAR)(&chars[0]), charsLen, &expectedBuffer) == C.FALSE {
		errno := syscall.GetLastError()
		err, ok := errno.(syscall.Errno)
		if !ok || err != C.ERROR_MORE_DATA {
			return "", errno, 0
		} else if err == C.ERROR_MORE_DATA {
			return "", nil, uint16(expectedBuffer)
		}
	}
	volumePaths := syscall.UTF16ToString(chars)
	return volumePaths, nil, 0
}

func NewWindowsVolumeIterator() (*WindowsVolumeIterator, error) {
	bufSize := C.DWORD(C.MAX_PATH)
	buf := make([]uint16, bufSize)

	// Get a handle to iterate over all the attached disks
	diskHandle := C.FindFirstVolumeW((*C.WCHAR)(&buf[0]), bufSize)
	if diskHandle == C.HANDLE(uintptr(0xFF)) {
		err := syscall.GetLastError()
		return nil, fmt.Errorf("Got bad handle when calling FindFirstVolume - %v", err)
	}

	return &WindowsVolumeIterator{
		handle:     diskHandle,
		buffer:     buf,
		bufferSize: bufSize,
		hasNext:    true,
	}, nil
}

// Get the last volume from the iterator
func (self *WindowsVolumeIterator) Volume() FileSystem {
	return self.volume
}

// Get the last error that stopped iteration
func (self *WindowsVolumeIterator) Error() error {
	return self.err
}

/* Iterate over the attached volumes. Returns true if there
   is a volume available from Volume(). Always check Error()
   when you're finished iterating. */
func (self *WindowsVolumeIterator) Next() bool {
	/* Because of the weird structure of `FindFirstVolume`,
	   we have a volume buffered before the first `Next()`. */
	if !self.hasNext {
		return false
	}

	// Convert the currently buffered event to a Go struct
	volume := syscall.UTF16ToString(self.buffer)

	// Get the first mount point for the buffered volume
	volumeMount, err, newSize := getVolumePathName(self.buffer, C.MAX_PATH)
	if newSize > 0 {
		// Retry once if we get an error about buffers being too small
		volumeMount, err, _ = getVolumePathName(self.buffer, newSize)
	}

	if err != nil {
		self.err = fmt.Errorf("Error getting volume mountpoints: %v", err)
		return false
	}

	self.volume = FileSystem{
		DevName: volume,
		DirName: volumeMount,
	}

	// Put the next volume in the buffer
	err, hasNext := self.getNextVolume()
	if !hasNext {
		// If there is no buffered event, the next call to Next() will return false
		self.hasNext = false
	}

	// If there was an error getting the next volume, fail immediately
	if err != nil {
		self.err = err
		return false
	}

	return true
}

func (self *WindowsVolumeIterator) Close() {
	C.FindVolumeClose(self.handle)
}

func (self *WindowsVolumeIterator) getNextVolume() (error, bool) {
	if C.FindNextVolumeW(self.handle, (*C.WCHAR)(&self.buffer[0]), self.bufferSize) == C.FALSE {
		err := syscall.GetLastError()
		errno, _ := err.(syscall.Errno)
		if err == nil || errno == C.ERROR_NO_MORE_FILES {
			// There are no more volumes
			return nil, false
		} else {
			// Unknown error
			return err, false
		}
	}
	return nil, true
}

redpajama_set_name: RedPajamaGithub


text:
Adding tests
============

You can test shaping of a unicode sequence against a font like this:
```sh
$ ./hb-unicode-encode 41 42 43 627 | ../../util/hb-shape font.ttf
```
assuming an in-tree build.  The 41 42 43 627 here is a sequence of
Unicode codepoints: U+0041,0042,0043,0627.  When you are happy with
the shape results, you can use the `record-test.sh` script to add
this to the test suite.  `record-test.sh` requires `pyftsubset` to
be installed.  You can get `pyftsubset` by installing
FontTools from <https://github.com/behdad/fonttools>.

To use `record-test.sh`, just put it right before the `hb-shape` invocation:
```sh
$ ./hb-unicode-encode 41 42 43 627 | ./record-test.sh ../../util/hb-shape font.ttf
```
what this does is:
  * Subset the font for the sequence of Unicode characters requested,
  * Compare the `hb-shape` output of the original font versus the subset
    font for the input sequence,
  * If the outputs differ, perhaps it is because the font does not have
    glyph names; it then compares the output of `hb-view` for both fonts.
  * If the outputs differ, recording fails.  Otherwise, it will move the
    subset font file into `fonts/sha1sum` and name it after its hash,
    and prints out the test case input, which you can then redirect to
    an existing or new test file in `tests`, eg.:
```sh
$ ./hb-unicode-encode 41 42 43 627 | ./record-test.sh ../../util/hb-shape font.ttf >> tests/test-name.test
```

If you created a new test file, add it to `Makefile.am` so it is run.
Check that `make check` does indeed run it, and that the test passes.
When everything looks good, `git add` the new font as well as new
test file if you created any.  You can see what new files are there
by running `git status tests fonts/sha1sum`.  And commit!

*Note!*  Please only add tests using Open Source fonts, preferably under
OFL or similar license.


text:
package javas.lang;

import org.junit.Test;

/**
 * ObjectTest
 *
 * @author sunny
 * @version 1.0.0
 * @since 2015-04-13
 */
public class ObjectTest {

    @Test
    public void testObject() {
        Object object = new Object();
        System.out.println(object.getClass());
        System.out.println(object.hashCode());
        System.out.println(object.toString());
        System.out.println(object.equals(new Object()));
        //protected  void finalize() 当垃圾回收器确定不存在对该对象的更多引用时,由对象的垃圾回收器调用此方法。
        //protected  Object clone()  创建并返回此对象的一个副本。
    }

}


text:
class QImage;
class CImageLoader;
class CMipImages;

class Plugin_Canalysis : public PluginInterface_Analysis
{
public:
    Plugin_Canalysis();
    virtual ~Plugin_Canalysis();
    int TC_PluginGetVersion(TC_PluginVersion* pPluginVersion);
    int TC_ImageDiff(const char*       in1,
                     const char*       in2,
                     const char*       out,
                     char*             resultsFile,
                     void*             usrAnalysisData,
                     void*             pluginManager,
                     void**            cmipImages,
                     CMP_Feedback_Proc pFeedbackProc = NULL);
    int TC_PSNR_MSE(const char* in1, const char* in2, char* resultsFile, void* pluginManager, CMP_Feedback_Proc pFeedbackProc = NULL);
    int TC_SSIM(const char* in1, const char* in2, char* resultsFile, void* pluginManager, CMP_Feedback_Proc pFeedbackProc = NULL);

private:
    void write(const REPORT_DATA& data, char* resultsFile, char option);
    void generateBCtestResult(QImage* src, QImage* dest, REPORT_DATA& myReport);  //for testing only
    void setActiveChannels();
    void processSSIMResults();

#if (OPTION_CMP_OPENCV == 1)
    cv::Scalar m_SSIM;
    // removed as of v4.1
    // bool psnr(QImage *src, const cv::Mat& srcimg, QImage *dest, const cv::Mat& destimg, REPORT_DATA &myReport, CMP_Feedback_Proc pFeedbackProc = NULL);
#endif
    char           m_results_path[MAX_PATH];
    std::string    m_srcFile;
    std::string    m_destFile;
    double         m_rmse, m_psnr, m_mabse;
    double         tolerance_mse, tolerance_psnr, tolerance_psnrb, tolerance_psnrg, tolerance_psnrr;
    double         tolerance_ssim, tolerance_ssimb, tolerance_ssimg, tolerance_ssimr;
    PluginManager* m_pluginManager;

#if (OPTION_CMP_QT == 1)
    CImageLoader* m_imageloader;
#endif

    CMipImages*    m_MipSrcImages;
    CMipImages*    m_MipDestImages;
    CMipImages*    m_MipDiffImages;
    CMP_FORMAT     m_Compressformat;
    unsigned int   m_RGBAChannels;
    MY_REPORT_DATA report;
};

#endif


text:
#region License

#endregion

#region Imports

using System;
using AopAlliance.Aop;
using Spring.Core;

#endregion

namespace Spring.Aop.Support
{
	///
	/// Convenient superclass for <see cref="Spring.Aop.IAdvisor"/>s that
	/// are also static pointcuts.
	///
	/// <author>Rod Johnson</author>
	/// <author>Aleksandar Seovic (.Net)</author>
	[Serializable]
	public abstract class StaticMethodMatcherPointcutAdvisor
		: StaticMethodMatcherPointcut, IPointcutAdvisor, IOrdered
	{
		private int _order = Int32.MaxValue;
		private IAdvice _advice;

		///
		/// Creates a new instance of the
		/// <see cref="Spring.Aop.Support.StaticMethodMatcherPointcutAdvisor"/>
		/// class.
		///
		/// <remarks>
		///

		/// This is an abstract class, and as such has no publicly
		/// visible constructors.
		///

		/// </remarks>
		protected StaticMethodMatcherPointcutAdvisor()
		{
		}

		///
		/// Creates a new instance of the
		/// <see cref="Spring.Aop.Support.AbstractRegularExpressionMethodPointcut"/>
		/// class for the supplied <paramref name="advice"/>
		///
		/// <remarks>
		///

		/// This is an abstract class, and as such has no publicly
		/// visible constructors.
		///

		/// </remarks>
		/// <param name="advice">
		/// The advice to use.
		/// </param>
		public StaticMethodMatcherPointcutAdvisor(IAdvice advice)
		{
			this._advice = advice;
		}

		///
		/// Is this advice associated with a particular instance?
		///
		/// <value>
		/// <see langword="true"/> if this advice is associated with a
		/// particular instance.
		/// </value>
		/// <exception cref="System.NotSupportedException">
		/// Always; this property is not yet supported.
		/// </exception>
		public virtual bool IsPerInstance
		{
			get
			{
				throw new NotSupportedException(
					"The 'IsPerInstance' property of the IAdvisor interface is " +
					"not yet supported in Spring.NET.");
			}
		}

		///
		/// Returns this <see cref="Spring.Aop.IAdvisor"/>s order in the
		/// interception chain.
		///
		/// <returns>
		/// This <see cref="Spring.Aop.IAdvisor"/>s order in the
		/// interception chain.
		/// </returns>
		public virtual int Order
		{
			get { return this._order; }
			set { this._order = value; }
		}

		///
		/// Return the advice part of this advisor.
		///
		/// <returns>
		/// The advice that should apply if the pointcut matches.
		/// </returns>
		/// <see cref="Spring.Aop.IAdvisor.Advice"/>
		public virtual IAdvice Advice
		{
			get { return this._advice; }
			set { this._advice = value; }
		}

		///
		/// The <see cref="Spring.Aop.IPointcut"/> that drives this advisor.
		///
		public virtual IPointcut Pointcut
		{
			get { return this; }
		}
	}
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>dialog</title>
    <meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <link rel="stylesheet" href="../../dist/cmu.css">

        

        弹框

    <button class="cmu-button cmu-button-primary" id="domInit">DOM渲染方式 提示弹框</button>

    <button class="cmu-button cmu-button-primary" id="jsInit">Js渲染方式 常规弹框</button>

    <button class="cmu-button cmu-button-primary" id="custome">自定义dialog</button>

    <button class="cmu-button cmu-button-primary" id="validateInit">错误提示dialog</button>

<textarea id="result"></textarea>

这是个h3标题

这是个自定义的h4标题

    哈哈这个地方是斜体

因为是自定义的,所以没有绑定默认事件,可以点击mask关闭

        这是提示弹框

        取消
        确认

正在载入...

提示信息错误

        这是提示弹框

        确认


text:
param (

   [string]$url = "$(Read-Host 'url [e.g. http://moss]')"
)

function main() {

	[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

	Get-SPWeb -url $url
}

function Get-SPSite([string]$url) {

	New-Object Microsoft.SharePoint.SPSite($url)
}

function Get-SPWeb([string]$url) {

	$SPSite = Get-SPSite $url
	return $SPSite.OpenWeb()
	$SPSite.Dispose()
}

main


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <title>Mocha Tests</title>
        <link rel="stylesheet" href="../node_modules/mocha/mocha.css" />


text:
//
//  GTLYouTubeContentRating.m
//

// ----------------------------------------------------------------------------
// NOTE: This file is generated from Google APIs Discovery Service.
// Service:
//   YouTube Data API (youtube/v3)
// Description:
//   Supports core YouTube features, such as uploading videos, creating and
//   managing playlists, searching for content, and much more.
// Documentation:
//   https://developers.google.com/youtube/v3
// Classes:
//   GTLYouTubeContentRating (0 custom class methods, 66 custom properties)

#import "GTLYouTubeContentRating.h"

// ----------------------------------------------------------------------------
//
//   GTLYouTubeContentRating
//

@implementation GTLYouTubeContentRating
@dynamic acbRating, agcomRating, anatelRating, bbfcRating, bfvcRating,
         bmukkRating, catvfrRating, catvRating, cbfcRating, cccRating,
         cceRating, chfilmRating, chvrsRating, cicfRating, cnaRating, cncRating,
         csaRating, cscfRating, czfilmRating, djctqRating, djctqRatingReasons,
         ecbmctRating, eefilmRating, egfilmRating, eirinRating, fcbmRating,
         fcoRating, fmocRating, fpbRating, fskRating, grfilmRating, icaaRating,
         ifcoRating, ilfilmRating, incaaRating, kfcbRating, kijkwijzerRating,
         kmrbRating, lsfRating, mccaaRating, mccypRating, mdaRating,
         medietilsynetRating, mekuRating, mibacRating, mocRating, moctwRating,
         mpaaRating, mtrcbRating, nbcplRating, nbcRating, nfrcRating,
         nfvcbRating, nkclvRating, oflcRating, pefilmRating, rcnofRating,
         resorteviolenciaRating, rtcRating, rteRating, russiaRating,
         skfilmRating, smaisRating, smsaRating, tvpgRating, ytRating;

+ (NSDictionary *)arrayPropertyToClassMap {
  NSDictionary *map = @{
    @"djctqRatingReasons" : [NSString class]
  };
  return map;
}

@end


text:
<script>
  (function() {
    var cx = '013769182564158614814:vdyz7waqya4';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cse.google.com/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:search></gcse:search>


text:
package com.groupdocs.conversion.examples.advanced_usage.converting.common;

import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.examples.Constants;
import com.groupdocs.conversion.options.convert.PdfConvertOptions;

import java.io.File;

/**
* This example demonstrates how to convert range of pages
*/
public class ConvertNConsecutivePages {
    public static void run()
    {
        String convertedFile = Constants.getConvertedPath("ConvertNConsecutivePages.pdf");
        Converter converter = new Converter(Constants.SAMPLE_DOCX);
        PdfConvertOptions options = new PdfConvertOptions();
        options.setPageNumber(2);
        options.setPagesCount(2);

        converter.convert(convertedFile, options);

        System.out.print("\nDocument converted successfully. \nCheck output in "+ convertedFile);
    }
}


text:
using namespace arangodb;

/// @brief add a collection to the transaction

int AqlTransaction::processCollection(aql::Collection* collection) {
  int state = setupState();

  if (state != TRI_ERROR_NO_ERROR) {
    return state;
  }

  if (ServerState::instance()->isCoordinator()) {
    return processCollectionCoordinator(collection);
  }
  return processCollectionNormal(collection);
}

/// @brief add a coordinator collection to the transaction

int AqlTransaction::processCollectionCoordinator(aql::Collection*  collection) {
  TRI_voc_cid_t cid =
      this->resolver()->getCollectionId(collection->getName());

  return this->addCollection(cid, collection->getName().c_str(),
                             collection->accessType);
}

/// @brief add a regular collection to the transaction

int AqlTransaction::processCollectionNormal(aql::Collection* collection) {
  TRI_vocbase_col_t const* col =
      this->resolver()->getCollectionStruct(collection->getName());
  TRI_voc_cid_t cid = 0;

  if (col != nullptr) {
    cid = col->_cid;
  }

  int res =
      this->addCollection(cid, collection->getName(), collection->accessType);

  if (res == TRI_ERROR_NO_ERROR && col != nullptr) {
    collection->setCollection(const_cast<TRI_vocbase_col_t*>(col));
  }

  return res;
}

/// @brief lockCollections, this is needed in a corner case in AQL: we need
/// to lock all shards in a controlled way when we set up a distributed
/// execution engine. To this end, we prevent the standard mechanism to
/// lock collections on the DBservers when we instantiate the query. Then,
/// in a second round, we need to lock the shards in exactly the right
/// order via an HTTP call. This method is used to implement that HTTP action.

int AqlTransaction::lockCollections() {
  auto trx = getInternals();

  for (auto& trxCollection : trx->_collections) {
    int res = TRI_LockCollectionTransaction(trxCollection,
                                            trxCollection->_accessType, 0);
    if (res != TRI_ERROR_NO_ERROR) {
      return res;
    }
  }
  return TRI_ERROR_NO_ERROR;
}


text:
@interface PhotosByPhotographerImageViewController ()
// the embedded PhotosByPhotographerMapViewController
@property (nonatomic, strong) PhotosByPhotographerMapViewControlller *mapvc;
@end

@implementation PhotosByPhotographerImageViewController

- (void)setPhotographer:(Photographer *)photographer
{
    _photographer = photographer;
    self.title = photographer.name;
    self.mapvc.photographer = self.photographer;
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.destinationViewController isKindOfClass:[PhotosByPhotographerMapViewControlller class]]) {
        PhotosByPhotographerMapViewControlller *pbpmapvc =
        (PhotosByPhotographerMapViewControlller *)segue.destinationViewController;
        // set the embedded PhotosByPhotographerMapViewController's Model
        pbpmapvc.photographer = self.photographer;
        // hold onto the embedded PhotosByPhotographerMapViewController
        // in case our Model is nil right now
        // and then set it later when our Model gets set by the photographer property's setter
        self.mapvc = pbpmapvc;
    } else {
        // not embedding, let our superclass do any segues it can do
        [super prepareForSegue:segue sender:sender];
    }
}

@end


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.HttpModules.Compression
{
    using System.IO;
    using System.IO.Compression;

    /// <summary>
    /// Summary description for DeflateFilter.
    /// </summary>
    public class DeflateFilter : CompressingFilter
    {
        private readonly DeflateStream stream;

        /// <summary>Initializes a new instance of the <see cref="DeflateFilter"/> class.</summary>
        /// <param name="baseStream">The base stream.</param>
        public DeflateFilter(Stream baseStream)
            : base(baseStream)
        {
            this.stream = new DeflateStream(baseStream, CompressionMode.Compress);
        }

        /// <inheritdoc/>
        public override string ContentEncoding
        {
            get
            {
                return "deflate";
            }
        }

        /// <inheritdoc/>
        public override void Write(byte[] buffer, int offset, int count)
        {
            if (!this.HasWrittenHeaders)
            {
                this.WriteHeaders();
            }

            this.stream.Write(buffer, offset, count);
        }

        /// <inheritdoc/>
        public override void Close()
        {
            this.stream.Close();
        }

        /// <inheritdoc/>
        public override void Flush()
        {
            this.stream.Flush();
        }
    }
}


text:
'use strict';

angular.module('mean.league').controller('PlayerStatsController', ['$scope', 'Global', 'Players',
  function($scope, Global, Player){
    $scope.global = Global;
    $scope.package = {
      name: 'league'
    };

    $scope.init = function() {
      Player.query(
        {},
        function(players) {
          $scope.players = players;
        }
      );
    };
  }
]);


text:
import template from './template.pug';
import QueryActionsButton from './controller';

export const component: ng.IComponentOptions = {
    controller: QueryActionsButton,
    template,
    bindings: {
        actions: '<',
        item: '<'
    }
};


text:
<?php /* Smarty version 2.5.0, created on 2004-04-12 14:48:46
         compiled from import.tpl */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include("./header.tpl", array('title' => "Election Administration - Import Students"));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php if ($this->_tpl_vars['action'] == ""): ?>
<form name="import" action="import.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="action" value="import">
Import CSV file: <input type="file" name="import">

<input type="submit" name="submit" value="Import">

<<Back

</form>
<?php endif; ?>
<?php if ($this->_tpl_vars['action'] == 'done'): ?>
<?php echo $this->_tpl_vars['count']; ?>
 students have been added to the database. Click here to view all students.

<<Back

<?php endif; ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include("./footer.tpl", array());
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.ili.base.dao.authority;

import net.ili.base.dao.SuperJpaDao;
import net.ili.base.entities.authority.Modules;

/**
 *
 * @author Weir
 */
public interface ModulesDao extends SuperJpaDao< Modules, Long> {
}


text:
package org.basex.query.up.atomic;

import org.basex.data.*;

/**
 * Abstract atomic update.
 * Atomic updates can only be initialized via {@link AtomicUpdateCache}.
 *
 * @author BaseX Team 2005-15, BSD License
 * @author Lukas Kircher
 */
public abstract class BasicUpdate {
  /** PRE value of the target location. */
  final int location;
  /** Parent PRE of nodes to insert. */
  final int parent;

  /**
   * Constructor.
   * @param location target node location PRE
   * @param parent parent node PRE value
   */
  BasicUpdate(final int location, final int parent) {
    this.location = location;
    this.parent = parent;
  }

  /**
   * Getter for accumulated shifts.
   * @return accumulated shifts, or zero if non-structural update.
   */
  int accumulatedShifts() {
    return 0;
  }

  /**
   * Applies the update to the given data instance.
   * @param data data instance on which to execute the update
   */
  abstract void apply(final Data data);

  /**
   * Returns the data to be inserted (for inserts,...).
   * @return Insertion sequence data instance
   */
  abstract DataClip getInsertionData();

  /**
   * Returns whether this updates destroys the target nodes identity. Used to determine
   * superfluous operations on the subtree of the target.
   * @return {@code true} if target node identity destroyed
   */
  abstract boolean destructive();

  /**
   * Merges the given update and this update if possible.
   * @param data data reference
   * @param bu update to merge with
   * @return merged atomic update or null if merge not possible
   */
  @SuppressWarnings("unused")
  public BasicUpdate merge(final Data data, final BasicUpdate bu) {
    return null;
  }

  @Override
  public String toString() {
    return "L" + location;
  }
}


text:
CoreDataTortureTest
===================

A (currently broken) example of loading 25k records with relationships into Core Data


text:
import math
import numpy as np

import torch
import torch.nn as nn
import torch.nn.functional as F

from torch.autograd import Variable

from utils import normalized_columns_initializer, weights_init

class ActorCriticLSTM(torch.nn.Module):
    def __init__(self, num_inputs, num_outputs):
        super(ActorCriticLSTM, self).__init__()
        self.conv1 = nn.Conv2d(num_inputs, 32, 5, stride=1, padding=2)
        self.conv2 = nn.Conv2d(32, 32, 5, stride=1, padding=1)
        self.conv3 = nn.Conv2d(32, 64, 4, stride=1, padding=1)
        self.conv4 = nn.Conv2d(64, 64, 3, stride=1, padding=1)

        self.lstm = nn.LSTMCell(1024, 512)

        self.critic_linear = nn.Linear(512, 1)
        self.actor_linear = nn.Linear(512, num_outputs)

        self.apply(weights_init)
        self.actor_linear.weight.data = normalized_columns_initializer(
            self.actor_linear.weight.data, 0.01)
        self.actor_linear.bias.data.fill_(0)
        self.critic_linear.weight.data = normalized_columns_initializer(
            self.critic_linear.weight.data, 1.0)
        self.critic_linear.bias.data.fill_(0)

        self.lstm.bias_ih.data.fill_(0)
        self.lstm.bias_hh.data.fill_(0)

        self.reset()

    def reset(self):
        self.require_init = True

    def forward(self, inputs, keep_same_state=False):
        batch = inputs.size(0)

        if self.require_init:
            self.require_init = False
            self.hx = Variable(inputs.data.new().resize_((batch, 512)).zero_())
            self.cx = Variable(inputs.data.new().resize_((batch, 512)).zero_())

        x = F.relu(F.max_pool2d(self.conv1(inputs), kernel_size=2, stride=2))
        x = F.relu(F.max_pool2d(self.conv2(x), kernel_size=2, stride=2))
        x = F.relu(F.max_pool2d(self.conv3(x), kernel_size=2, stride=2))
        x = F.relu(F.max_pool2d(self.conv4(x), kernel_size=2, stride=2))

        x = x.view(batch, -1)
        hx, cx = self.lstm(x, (self.hx, self.cx))
        x = hx

        if not keep_same_state:
            self.hx, self.cx = hx, cx

        return self.critic_linear(x), self.actor_linear(x)

    def detach(self):
        if self.require_init:
            return

        self.hx.detach_()
        self.cx.detach_()


text:
This example describes how to *globally* configure a data format provided by Camunda Spin.
The example showcases the configuration of the Jackson-based JSON data format that Spin provides out-of-the-box. JSON serialization is customized by registering a Jackson module with a custom serializer and deserializer.

Global configuration means that every application that uses Spin is going to work with the configured data format. In consequence, the configuration applies to every process application in a shared engine scenario. See the example on [process-application-specific configuration](../dataformat-configuration-in-process-application) as well.

In particular, we examine how to customize the serialization of the class [Car](src/main/java/org/camunda/bpm/example/spin/dataformat/configuration/Car.java):

```java
public class Car {

  protected Money price;

  public Money getPrice() {
    return price;
  }

  public void setPrice(Money price) {
    this.price = price;
  }
}
```

`Car` references [Money](src/main/java/org/camunda/bpm/example/spin/dataformat/configuration/Money.java):

```java
public class Money {

  protected int amount;

  public Money(int amount) {
    this.amount = amount;
  }

  public int getAmount() {
    return amount;
  }
}
```

With default Jackson serialization, an object `new Car(1000)` is serialized as `{"price" : {"amount" : 1000}}`. In the following, we describe how to configure the serialization such that the result is `{"price" : 1000}` and give an example how this integrates with process variables and process execution.

We use the following process:

![JSON serialization process](src/main/resources/testProcess.png)

The script task *Extract price* expects a `Car` JSON object in the format of `{"price" : 1000}` and fails otherwise.

# Overview

## Embedded Process Engine

### How to run it

1. Checkout the project with Git
2. Read and run the [unit test](src/test/java/org/camunda/bpm/example/spin/dataformat/configuration/JacksonConfiguratorTest.java)

### How it works

When a data format is accessed for the very first time, Spin performs a look up of all data formats on the classpath. After having instantiated the data formats, Spin detects so-called data format configurators and calls these with the detected format instances. Users can provide custom configurators to influence the way a data format serializes and deserializes objects, which is what this example shows.

Configuring data formats requires to implement the SPI [DataFormatConfigurator](https://github.com/camunda/camunda-spin/blob/master/core/src/main/java/org/camunda/spin/spi/DataFormatConfigurator.java) and declare implementations of it in a file `META-INF/services/org.camunda.spin.spi.DataFormatConfigurator`. Here, the class [JacksonDataFormatConfigurator](src/main/java/org/camunda/bpm/example/spin/dataformat/configuration/JacksonDataFormatConfigurator.java) is such an implementation. It has the following contents:

```java
import org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormat;
import org.camunda.spin.spi.DataFormatConfigurator;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;

public class JacksonDataFormatConfigurator implements DataFormatConfigurator<JacksonJsonDataFormat> {

  public void configure(JacksonJsonDataFormat dataFormat) {
    ObjectMapper objectMapper = dataFormat.getObjectMapper();
    SimpleModule module = new SimpleModule();
    module.addDeserializer(Money.class, new MoneyJsonDeserializer());
    module.addSerializer(Money.class, new MoneyJsonSerializer());
    objectMapper.registerModule(module);
  }

  public Class<JacksonJsonDataFormat> getDataFormatClass() {
    return JacksonJsonDataFormat.class;
  }

}
```

The method `getDataFormatClass` declares the kind of data formats a configurator is able to configure. The method `configure` is the callback invoked by the Spin runtime after data format instantiation. Here, we register in form of the classes [MoneyJsonSerializer](src/main/java/org/camunda/bpm/example/spin/dataformat/configuration/MoneyJsonSerializer.java) and [MoneyJsonDeserializer](src/main/java/org/camunda/bpm/example/spin/dataformat/configuration/MoneyJsonDeserializer.java) a Jackson serializer and deserializer for the `Money` class. These make sure that a `Car` object is serialized in the way we need it.

The script task *Extract price* makes use of that structure by defining the following script:

```javascript
var carJson = execution.getVariableTyped("car").getValueSerialized();
var price = S(carJson ).prop("price").numberValue();
execution.setVariable("price", price);
```

In the [test case](src/test/java/org/camunda/bpm/example/spin/dataformat/configuration/JacksonConfiguratorTest.java), we assert that the *price* property was successfully populated.

For this to work, it is crucial that the Spin runtime is able to lookup the `DataFormatConfigurator` implementation. That means, the artifact containing the data format configurator and the corresponding `META-INF/services` file must be on the classpath of the Camunda Spin process engine plugin.

You can find the Spin documentation on configuring data formats [here](https://docs.camunda.org/manual/7.18/reference/spin/extending-spin/#configuring-data-formats).

## Shared Process Engine (Application Server)

In order to configure the data format globally for all process applications, perform the following steps:

1. Build the JAR with `mvn clean install`
2. Make it available on the classpath of the artifact `camunda-engine-plugin-spin`. Depending on the application server in use, this may be in varying places (see below).

Where to place the data format configuration JAR on which application server:

| Application Server           | Configuration                                                           |
| ---------------------------- | ----------------------------------------------------------------------- |
| JBoss/Wildfly                | Deploy the JAR as a JBoss module. Create appropriate module dependencies for the JAR's dependencies. Keep in mind that all transitive dependencies must be declared as well. For this example, the dependencies should be `org.camunda.spin.camunda-spin-dataformat-json-jackson`, `org.camunda.spin.camunda-spin-core`, `com.fasterxml.jackson.core.jackson-databind` (with same version that `camunda-spin-dataformat-json-jackson` uses). Edit `${JBOSS_HOME}/modules/org/camunda/bpm/camunda-engine-plugin-spin/main/module.xml`. Declare a dependency on the JAR module and make sure to set the attribute `services="import"`. |
| Glassfish/WebLogic/Websphere | Add the JAR and any dependencies that are not yet present to the Camunda EAR. Replace the deployed Camunda EAR by the updated one. |


text:
function formatImapPath(pathStr) {
  if (!pathStr) {
    throw new Error("Can not format an empty path!");
  }

  // https://regex101.com/r/yeyZJh/1
  const s = pathStr.replace(/^\[Gmail]\//, '');
  return s;
}

module.exports = {formatImapPath}


text:
> **Please note that this template is not optional.** If you proceed with this form,
please fill out _all_ fields, or your issue may be closed as "invalid."
Please do not delete this template. Please ask questions on StackOverflow or the
webpack Gitter (https://gitter.im/webpack/webpack). _General questions, how-to
questions, and support requests will be closed._
**Please do remove this header to acknowledge this message.**

* Operating System:
* Node Version:
* NPM Version:
* webpack Version:
* webpack-dev-server Version:

<!-- Please place an x, no spaces, in all [ ] that apply -->

- [ ] This is a **bug**
- [ ] This is a **feature** request
- [ ] This is a **modification** request

### Code

<!--
  If you have a large amount of code to share which demonstrates the problem
  you're experiencing, or your webpack config is very large, please provide a link
  to your repository rather than pasting code. We'd also encourage you to use a
  Github Gist link instead of pasting code. Otherwise, please paste relevant
  short snippets below.

  For bugs, please do consider providing a link to a stripped-down, bare-bones
  repo that can reproduce the problem you're experiencing. Many times, bugs
  aren't actual bugs, but rather specific issues with loaders, plugins, or
  an environment/OS. Problems with complicated or large applications will almost
  always require this to be triaged.
-->

```js
  // webpack.config.js
```

```js
  // additional code, remove if not needed.
```

### Expected Behavior

### Actual Behavior

### For Bugs; How can we reproduce the behavior?

### For Features; What is the motivation and/or use-case for the feature?


text:
namespace Finsternis
{
    using UnityEngine;
    using System.Collections.Generic;
    using System;

    public class OpeneableEntity : Entity, IOpeneable
    {
        public static readonly int LockedBool = Animator.StringToHash("locked");
        public static readonly int OpenBool = Animator.StringToHash("open");

        [Serializable]
        public struct OpeneableEvts
        {
            public EntityEvent onOpen;
            public EntityEvent onClose;
            public EntityEvent onLockRemoved;
        }

        [Header("OpeneableEntity fields")]
        [Space]

        [SerializeField]
        private OpeneableEvts openeableEvents;

        private bool isOpen;

        private List<Lock> locks;

        public bool IsLocked { get { return this.locks.Count > 0; } }

        public bool IsOpen { get { return this.isOpen; } }

        public OpeneableEvts OpeneableEvents { get { return this.openeableEvents; } }

        protected override void Awake()
        {
            base.Awake();
            locks = new List<Lock>();
            GetComponents<Lock>(locks);
            foreach (Lock l in locks)
            {
                l.OnUnlock.AddListener(RemoveLock);
            }
        }

        private void RemoveLock(Lock removedLock)
        {
            locks.Remove(removedLock);
            OpeneableEvents.onLockRemoved.Invoke(this);
            Open();
        }

        public virtual void Open()
        {
            if (this.isOpen || IsLocked)
                return;

            this.isOpen = true;
            OpeneableEvents.onOpen.Invoke(this);
        }

        public virtual void Close()
        {
            if (!this.isOpen)
                return;

            this.isOpen = false;
            OpeneableEvents.onClose.Invoke(this);
        }
    }
}


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class DadosComuns extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('dados_comuns', function(Blueprint $table)
        {
            $table->increments('id');
            $table->string('nome', 100);
            $table->date('data_nasc');
            $table->integer('idade');
            $table->enum('genero', ['Masculino', 'Femenino']);
            $table->string('nacionalidade', 40);
            $table->enum('estado_civil', ['Solteiro/a', 'Casado/a','Divorciado/a','Vivu/a']);
            $table->string('n_bi', 40)->unique();
            $table->string('nif', 40);
            $table->text('foto')->nullable();
            $table->integer('contacto_id')->unsigned();
            $table->foreign('contacto_id')->references('id')->on('contactos');
            $table->integer('user_id')->unsigned();
            $table->foreign('user_id')->references('id')->on('users');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}


text:
<?php
namespace report\dues;

class Owed {
  function get($num_months = 6) {
    $db_conn = \Db::conn();

    $members = $this->members($db_conn);

    $sql = <<<SQL
select members.id, derby_name, sum(amount) as amount
from members
  left join member_ledger on members.id = member_ledger.member_id and month(period) = ? and year(period) = ?
  left join ledger_types on ledger_types.id = member_ledger.ledger_type_id
where active = 'Y'
group by derby_name, period
SQL;
    $stmt = $db_conn->prepare($sql) or die(mysqli_error($db_conn));

    $month = new \DateTime("-{$num_months} months");
    // go to the first of the month to save some odd math at the end of the month
    $month->modify('first day of this month');
    $interval = new \DateInterval('P1M');

    $month_names = array();
    for ($i = 0; $i < $num_months; $i++) {
      // advance the month for the next loop. It's either add when we start or
      // manipulate $num_months.
      $month->add($interval);

      $month_name = $month->format('M');
      $month_names[] = $month_name;

      $year = $month->format('Y');
      $month_num = $month->format('m');

      $stmt->bind_param('ss', $month_num, $year);
      $stmt->execute();
      if ($results = $stmt->get_result()) {
        while ($dues = $results->fetch_assoc()) {
          $key = $this->member_key($dues);
          $amount = '';

          // negative value means money is owed
          if ($dues['amount'] < 0) {
            $amount = -$dues['amount'];
          }
          $members[$key]['amount'][] = $amount;
        }
      }
    }

    //foreach ($members as $key => $member) {
    //  $amount_owed = array_sum($member['amount']);
    //  if ($amount_owed == 0) {
    //    unset($members[$key]);
    //  }
    //}

    $data = array(
      'month_names' => $month_names,
      'members' => array_values($members),
    );

    if (isset($_GET['print']) && $_GET['print'] == 'true') {
      new \Template('report/dues/owed', $data, true, false, false);
    } else {
      new \Template('report/dues/owed', $data);
    }
  }

  /**
   *
   */
  private function members($db_conn) {
    $sql = <<<SQL
select m.id, derby_name, on_plan, date_format(max(date_paid), '%Y-%m-%d') as date_paid
from members m
  left join member_ledger ml on m.id = ml.member_id and ledger_type_id not in (5, 6, 9)
where active = 'Y'
group by derby_name
order by derby_name
SQL;

    $members = array();
    $results = $db_conn->query($sql) or die(mysqli_error($db_conn));
    while ($member = $results->fetch_assoc()) {
      $key = $this->member_key($member);
      $members[$key] = $member;
    }

    return $members;
  }

  private function member_key($member) {
    return $member['derby_name'];
  }
}


text:
<?php

namespace api\models;

use common\models\Tat;
use Yii;

{class Tat extends \common\models\Tat

}


text:
namespace AjRuby.Tests
{
    using System;
    using System.Text;
    using System.Collections.Generic;
    using System.Linq;

    using AjRuby;
    using AjRuby.Expressions;
    using AjRuby.Language;
    using AjRuby.Compiler;
    using AjRuby.Tests.Mocks;

    using Microsoft.VisualStudio.TestTools.UnitTesting;

    [TestClass]
    public class EvaluationTests
    {
        private BindingEnvironment environment;

        [TestInitialize]
        public void SetupEnvironment()
        {
            this.environment = new BindingEnvironment();
            this.environment.SetValue("one", 1);
            this.environment.SetValue("two", 2);
            this.environment.SetValue("foo", "bar");
            this.environment.SetValue("mock", new MockObject());
        }

        [TestMethod]
        public void EvaluateSimpleConstants()
        {
            Assert.AreEqual(1, this.Evaluate("1"));
            Assert.AreEqual(2, this.Evaluate("2"));
            Assert.AreEqual("bar", this.Evaluate("\"bar\""));
        }

        [TestMethod]
        public void EvaluateLocalVariables()
        {
            Assert.AreEqual(1, this.Evaluate("one"));
            Assert.AreEqual(2, this.Evaluate("two"));
            Assert.AreEqual("bar", this.Evaluate("foo"));
        }

        [TestMethod]
        public void EvaluateSimpleAddUsingConstants()
        {
            Assert.AreEqual(1, this.Evaluate("1+0"));
            Assert.AreEqual(2, this.Evaluate("1+1"));
            Assert.AreEqual(0, this.Evaluate("-1+1"));
            Assert.AreEqual(3, this.Evaluate("1 + 2"));
        }

        [TestMethod]
        public void EvaluateSimpleSubtractUsingConstants()
        {
            Assert.AreEqual(1, this.Evaluate("1-0"));
            Assert.AreEqual(0, this.Evaluate("1-1"));
            Assert.AreEqual(-2, this.Evaluate("-1-1"));
            Assert.AreEqual(-1, this.Evaluate("1 - 2"));
        }

        [TestMethod]
        public void EvaluateArithmeticUsingConstants()
        {
            Assert.AreEqual(4, this.Evaluate("1+1+2"));
            Assert.AreEqual(4, this.Evaluate("1-1+4"));
            Assert.AreEqual(2, this.Evaluate("-1-1+4"));
            Assert.AreEqual(4, this.Evaluate("1 - 2 + 5"));
        }

        [TestMethod]
        public void EvaluateArithmeticUsingConstantsAndMultipleLevels()
        {
            Assert.AreEqual(7, this.Evaluate("1+3*2"));
            Assert.AreEqual(5.0, this.Evaluate("1/1+4"));
            Assert.AreEqual(5, this.Evaluate(@"1\1+4"));
            Assert.AreEqual(5, this.Evaluate("-1*-1+4"));
            Assert.AreEqual(-9, this.Evaluate("1 - 2 * 5"));
        }

        [TestMethod]
        public void EvaluateMockInvocation()
        {
            Assert.AreEqual("foo", this.Evaluate("mock.foo"));
            Assert.AreEqual("foo", this.Evaluate("mock.foo()"));
            Assert.AreEqual("foo:1:2", this.Evaluate("mock.foo(1,2)"));
            Assert.AreEqual("foo:1:2", this.Evaluate("mock.foo(one,two)"));
        }

        private object Evaluate(string text)
        {
            using (Parser parser = new Parser(text))
            {
                IExpression expression = parser.ParseExpression();
                Assert.IsNull(parser.ParseExpression());
                return expression.Evaluate(this.environment);
            }
        }
    }
}


text:
using namespace std;
using xcc::Compiler;

int main() {
    auto compiler = Compiler();

    ifstream in("../test/src.c");
    ofstream out("../test/out.S");

    compiler.compile(in, out);

    return 0;
}


text:
<?php

namespace A11yc\Controller;

class Auth
{
	/**
	 * Login
	 *
	 * @return Void
	 */
	public static function actionLogin()
	{
		View::assign('title', A11YC_LANG_AUTH_TITLE);
		View::assign('body', View::fetchTpl('auth/login.php'), false);
	}

	/**
	 * Logout
	 *
	 * @param String $redirect
	 * @return Void
	 */
	public static function actionLogout($redirect = A11YC_URL)
	{
		\Kontiki\Auth::logout();
		Util::redirect($redirect);
	}
}


text:
cGuiWidgetContainer::cGuiWidgetContainer(std::string _name, std::string _title, int x, int y, int w, int h){
	name = _name;
	title = _title;
	type = GUI_WIDGET_CONTAINER;
	loc.x = x;
	loc.y = y;
	loc.w = w;
	loc.h = h;
	showTitleBar = true;
	showCloseButton = true;
	isResizable = true;
	isMovable = true;
	closeButtonState = 0;
	resizeDir = 0;
	isResize = false;
}
cGuiWidgetContainer::cGuiWidgetContainer(std::string _name, std::string _title, int x, int y,
		int w, int h, bool showTitle, bool showClose, bool _isResizable, bool _isMovable){
	name = _name;
	title = _title;
	type = GUI_WIDGET_CONTAINER;
	loc.x = x;
	loc.y = y;
	loc.w = w;
	loc.h = h;
	showTitleBar = showTitle;
	showCloseButton = showClose;
	isResizable = _isResizable;
	isMovable = _isMovable;
	closeButtonState = 0;
	resizeDir = 0;
	isResize = false;
}
cGuiWidgetContainer::~cGuiWidgetContainer(){
	for(int i = 0; i < (int)children.size(); i++){
		delete children[i];
	}
}

void cGuiWidgetContainer::AddChild(cGuiWidget *_child){
	if(_child->skin == NULL)
		_child->skin = skin;
        if(showTitleBar) {
		_child->SetLoc(_child->loc.x + loc.x,
                                _child->loc.y + loc.y + titleBarRect[0].h);
        } else {
		_child->SetLoc(_child->loc.x + loc.x, _child->loc.y + loc.y);
        }
	_child->Render();
	children.push_back(_child);
}
int cGuiWidgetContainer::GetChildCount(){
	return (int)children.size();
}
cGuiWidget *cGuiWidgetContainer::GetChild(int id){
	return children[id];
}
void cGuiWidgetContainer::UpdatePosition(int newX, int newY){
	for(int i = 0; i < (int)children.size(); i++){
		children[i]->UpdatePosition(children[i]->loc.x + (newX - loc.x),
			children[i]->loc.y + (newY - loc.y));
	}
	loc.x = newX;
	loc.y = newY;
	titleBarRect[0].x = newX;
	titleBarRect[0].y = newY;
	titleBarRect[1].x = newX + titleBarRect[0].w;
	titleBarRect[1].y = newY;
	closeButton.x = newX + loc.w - closeButton.w - 5;
	closeButton.y = titleBarRect[1].y + closeButton.w / 3;

}
void cGuiWidgetContainer::HandleWidgetEvent(bool isMouseOver){
	if(isMouseOver){
		if(S_IsMouseLeft() || S_IsMouseRight())
			toReturnEvent = GUI_WIDGET_EVENT_HANDLED;

		if(closeButton.IsCollision(S_GetMouseX(), S_GetMouseY())){
			if(S_IsMouseLeft()){
				closeButtonState = 2; //Down event
				toReturnEvent = GUI_WIDGET_EVENT_HANDLED;
			}else if(closeButtonState == 2){
				closeButtonState = 0;
				isOnScreen = false;
			}else{
				closeButtonState = 1;
			}
			return;
		}else{
			closeButtonState = 0;
		}
		if(titleBarRect[0].IsCollision(S_GetMouseX(), S_GetMouseY())){
			if(!isDragging && !isResize && isMovable){
				resizeDir = -1;
				isDragging = true;
				dragStart.x = S_GetMouseX() - loc.x;
				dragStart.y = S_GetMouseY() - loc.y;
			}
		}else if(!isResize && !S_IsMouseLeft()){
			resizeDir = -1;
			if(S_GetMouseX() >= loc.x + loc.w - BORDER_SIZE){
				resizeDir = 1;
			}else if(S_GetMouseX() - loc.x <= BORDER_SIZE && S_GetMouseX() - loc.x > 0){
				resizeDir = 0;
			}
			if(S_GetMouseY() > loc.y + loc.h - BORDER_SIZE){
				if(resizeDir == 0){	//Resize left
					resizeDir = 3;	//Resize left-down
				}else if(resizeDir == 1){	//Resize right
					resizeDir = 4;	//Resize right-down
				}else{
					resizeDir = 2;	//Resize down
				}
			}
		}
		if(!isResize && S_IsMouseLeft() && resizeDir != -1){
			dragStart.x = S_GetMouseX();
			dragStart.y = S_GetMouseY();
			isResize = true;
		}
	}
	if(isDragging){
		if(S_IsMouseLeft()){
			UpdatePosition(S_GetMouseX() - dragStart.x, S_GetMouseY() - dragStart.y);
		}else{
			isDragging = false;
		}
	}
	HandleResizeEvent();

	for(int i = 0; i < (int)children.size(); i++){
		if(children[i]->HandleEvents() != GUI_WIDGET_EVENT_NOTHING){
			toReturnEvent = GUI_WIDGET_EVENT_HANDLED;
		}
	}
}
void cGuiWidgetContainer::Render(){
	if(loc.w < 45){
		loc.w = 45;
	}
	if(loc.h < 45){
		loc.h = 45;
	}
	uint *tmp = skin->GetSkin(GUI_WIDGET_CONTAINER);
	titleBarRect[0] = loc;
	titleBarRect[0].h = S_GetSection(tmp[1])->height;
	if(showCloseButton){
		titleBarRect[0].w -= S_GetSection(tmp[2])->width / 2;
		titleBarRect[1] = titleBarRect[0];
		titleBarRect[1].x += titleBarRect[0].w;
		titleBarRect[1].w = S_GetSection(tmp[2])->width / 2;
		closeButton = loc;
		closeButton.x += loc.w - S_GetSection(tmp[3])->width - 5;
		closeButton.y += S_GetSection(tmp[3])->height / 3;
		closeButton.w = S_GetSection(tmp[3])->width;
		closeButton.h = S_GetSection(tmp[3])->height;
	}
}
void cGuiWidgetContainer::Draw(){
	DrawBackground();
	if(showTitleBar){
		DrawTitle();
	}
	for(int i = 0; i < (int)children.size(); i++){
		children[i]->Draw();
	}
}
void cGuiWidgetContainer::HandleResizeEvent(){
	if(isResize && isResizable){
		if(S_IsMouseLeft()){
			switch(resizeDir){
				case 0:	//Left
					//dragStart.x += loc.w;
					// loc.w -= S_GetMouseX() - dragStart.x;
					// dragStart.x = S_GetMouseX();
					// if(loc.w > 46)
					// 	loc.x = S_GetMouseX();
					break;
				case 1:	//Right
					loc.w += (S_GetMouseX() - dragStart.x);
					dragStart.x = S_GetMouseX();
					break;
				case 2:	//Down
					loc.h += (S_GetMouseY() - dragStart.y);
					dragStart.y = S_GetMouseY();
					break;
				case 3:	//LeftDown
					break;
				case 4:	//RightDown
					loc.w += (S_GetMouseX() - dragStart.x);
					dragStart.x = S_GetMouseX();
					loc.h += (S_GetMouseY() - dragStart.y);
					dragStart.y = S_GetMouseY();
					break;
			}
			Render();
		}else{
			isResize = false;
		}
	}
}
void cGuiWidgetContainer::DrawBackground(){
	uint *tmp = skin->GetSkin(GUI_WIDGET_CONTAINER);
	S_DrawSectionScaled(tmp[0], &loc);
}
void cGuiWidgetContainer::DrawTitle(){
	uint *tmp = skin->GetSkin(GUI_WIDGET_CONTAINER);
	S_DrawSectionScaled(tmp[1], &titleBarRect[0]);
	S_RenderText(title, titleBarRect[0].x + 50, titleBarRect[0].y, skin->GetFont()
			,(float)tmp[7] / 255, (float)tmp[8] / 255, (float)tmp[9] / 255);
	if(showCloseButton){
		S_DrawSectionScaled(tmp[2], &titleBarRect[1]);
		switch(closeButtonState){
			case 0:
				S_DrawSection(tmp[3], closeButton.x, closeButton.y);
				break;
			case 1:
				S_DrawSection(tmp[4], closeButton.x, closeButton.y);
				break;
			case 2:
				S_DrawSection(tmp[5], closeButton.x, closeButton.y);
				break;
		}
	}
}


text:
module Schemaform
module Adapters
module GenericSQL
class Name

   def initialize( components, separator )
      @separator  = separator
      @components = components.flatten.compact.collect{|name| name.is_a?(Name) ? name.components : name.to_s.identifier_case}.flatten
      @tail       = (@components.last == "?" ? @components.pop : "")
      @full_name  = @components.join(separator) + @tail
   end

   attr_reader :components

   def last()
      @components.last
   end

   def +( name )
      case name
      when Name
         self.class.new(@components + name.components, @separator)
      when Array
         self.class.new(@components + name, @separator)
      else
         self.class.new(@components + [name], @separator)
      end
   end

   def to_s()
      @full_name
   end

   def hash()
      to_s.hash()
   end

   def ==( rhs )
      to_s == rhs.to_s
   end

end # Name
end # GenericSQL
end # Adapters
end # Schemaform


text:
/*
 * drivers/power/process.c - Functions for starting/stopping processes on
 *                           suspend transitions.
 *
 * Originally from swsusp.
 */

#undef DEBUG

#include <linux/interrupt.h>
#include <linux/oom.h>
#include <linux/suspend.h>
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/freezer.h>

/*
 * Timeout for stopping processes
 */
#define TIMEOUT	(20 * HZ)

static inline int freezeable(struct task_struct * p)
{
	if ((p == current) ||
	    (p->flags & PF_NOFREEZE) ||
	    (p->exit_state != 0))
		return 0;
	return 1;
}

static int try_to_freeze_tasks(bool sig_only)
{
	struct task_struct *g, *p;
	unsigned long end_time;
	unsigned int todo;
	struct timeval start, end;
	u64 elapsed_csecs64;
	unsigned int elapsed_csecs;

	do_gettimeofday(&start);

	end_time = jiffies + TIMEOUT;
	do {
		todo = 0;
		read_lock(&tasklist_lock);
		do_each_thread(g, p) {
			if (frozen(p) || !freezeable(p))
				continue;

			if (!freeze_task(p, sig_only))
				continue;

			/*
			 * Now that we've done set_freeze_flag, don't
			 * perturb a task in TASK_STOPPED or TASK_TRACED.
			 * It is "frozen enough".  If the task does wake
			 * up, it will immediately call try_to_freeze.
			 */
			if (!task_is_stopped_or_traced(p) &&
			    !freezer_should_skip(p))
				todo++;
		} while_each_thread(g, p);
		read_unlock(&tasklist_lock);
		yield();			/* Yield is okay here */
		if (time_after(jiffies, end_time))
			break;
	} while (todo);

	do_gettimeofday(&end);
	elapsed_csecs64 = timeval_to_ns(&end) - timeval_to_ns(&start);
	do_div(elapsed_csecs64, NSEC_PER_SEC / 100);
	elapsed_csecs = elapsed_csecs64;

	if (todo) {
		/* This does not unfreeze processes that are already frozen
		 * (we have slightly ugly calling convention in that respect,
		 * and caller must call thaw_processes() if something fails),
		 * but it cleans up leftover PF_FREEZE requests.
		 */
		printk("\n");
		printk(KERN_ERR "Freezing of tasks failed after %d.%02d seconds "
				"(%d tasks refusing to freeze):\n",
				elapsed_csecs / 100, elapsed_csecs % 100, todo);
		show_state();
		read_lock(&tasklist_lock);
		do_each_thread(g, p) {
			task_lock(p);
			if (freezing(p) && !freezer_should_skip(p))
				printk(KERN_ERR " %s\n", p->comm);
			cancel_freezing(p);
			task_unlock(p);
		} while_each_thread(g, p);
		read_unlock(&tasklist_lock);
	} else {
		printk("(elapsed %d.%02d seconds) ", elapsed_csecs / 100,
			elapsed_csecs % 100);
	}

	return todo ? -EBUSY : 0;
}

/**
 *	freeze_processes - tell processes to enter the refrigerator
 */
int freeze_processes(void)
{
	int error;

	printk("Freezing user space processes ... ");
	error = try_to_freeze_tasks(true);
	if (error)
		goto Exit;
	printk("done.\n");

	printk("Freezing remaining freezable tasks ... ");
	error = try_to_freeze_tasks(false);
	if (error)
		goto Exit;
	printk("done.");

	oom_killer_disable();
 Exit:
	BUG_ON(in_atomic());
	printk("\n");

	return error;
}

static void thaw_tasks(bool nosig_only)
{
	struct task_struct *g, *p;

	read_lock(&tasklist_lock);
	do_each_thread(g, p) {
		if (!freezeable(p))
			continue;

		if (nosig_only && should_send_signal(p))
			continue;

		if (cgroup_frozen(p))
			continue;

		thaw_process(p);
	} while_each_thread(g, p);
	read_unlock(&tasklist_lock);
}

void thaw_processes(void)
{
	oom_killer_enable();

	printk("Restarting tasks ... ");
	thaw_tasks(true);
	thaw_tasks(false);
	schedule();
	printk("done.\n");
}


text:
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
		 <title>electionZ </title>
         <!--   <link rel="stylesheet" href="https://yui.yahooapis.com/pure/0.6.0/pure-min.css"> -->

	        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css">
		 <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css">
		 <link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">
		 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.min.css">
		 <script src="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
		  <link rel="stylesheet" href="{{url_for('static', filename='css/base.css')}}"/>

</head>

<body>
	<div class="content">


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
        android:id="@+id/main_content"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context="ui.about.AboutActivity">
    <ScrollView
            android:layout_width="match_parent"
            android:fadeScrollbars="false"
            android:layout_height="wrap_content">

        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="#FFFFFF"
                android:fitsSystemWindows="true"
                android:orientation="vertical"
                android:paddingBottom="@dimen/activity_vertical_margin"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin"
                android:weightSum="1">

            <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_weight="0.36"
                    android:layout_height="wrap_content">

                <ImageView
                        android:id="@+id/barcodeLogo"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:adjustViewBounds="true"
                        android:src="@drawable/privacyfriendlyappslogo"/>

            </LinearLayout>

            <TextView
                    android:id="@+id/appName"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="20sp"
                    android:text="@string/app_name_long"/>

            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="5dp"
                android:gravity="center">

                <TextView
                    android:id="@+id/textFieldVersion"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="5dp"
                    android:text="@string/version_number" />

                <TextView
                    android:id="@+id/textFieldVersionName"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="4dp"
                    android:layout_marginTop="5dp"
                    android:layout_toEndOf="@+id/textFieldVersion" />

            </RelativeLayout>

            <TextView
                    android:id="@+id/textFieldAuthor"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="5sp"
                    android:text="@string/about_developper"/>

            <TextView

                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="5sp"
                    android:text="@string/about_author_greb"/>

            <TextView

                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="5sp"
                    android:text="@string/about_author_cri"/>

            <TextView
                    android:id="@+id/textFieldAffiliation"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="15sp"
                    android:text="@string/about_affiliation"
                    android:textStyle="bold"/>

            <ImageView
                    android:id="@+id/imageView1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:adjustViewBounds="true"
                    android:src="@drawable/secuso_logo_blau_blau"/>

            <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10sp"
                    android:layout_gravity="center_horizontal"
                    android:text="@string/privacy_friendly"
                    android:gravity="center_horizontal"/>

            <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:gravity="center"
                    android:layout_marginTop="15sp"
                    android:text="@string/more_info"/>

            <TextView
                android:id="@+id/secusoWebsite"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:text="@string/url"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/githubURL"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:gravity="center_horizontal"
                android:textStyle="bold"
                android:text="@string/github" />
        </LinearLayout>
    </ScrollView>
</LinearLayout>


text:
package io.undertow.websockets.jsr.test.stress;

import javax.websocket.OnMessage;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Stuart Douglas
 */
@ServerEndpoint(value = "/stress", subprotocols = {"foo", "bar", "configured-proto"})
public class StressEndpoint {

    public static Set<String> MESSAGES = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());

    @OnMessage
    public void handleMessage(Session session, final String message) throws IOException {
        if(message.equals("close")) {
            session.close();
            return;
        }
        MESSAGES.add(message);
    }
}


text:
package array_test

import (
	"testing"

	"github.com/apache/arrow/go/arrow"
	"github.com/apache/arrow/go/arrow/array"
	"github.com/apache/arrow/go/arrow/internal/testing/tools"
	"github.com/apache/arrow/go/arrow/memory"
	"github.com/stretchr/testify/assert"
)

type testDataType struct {
	id arrow.Type
}

func (d *testDataType) ID() arrow.Type { return d.id }
func (d *testDataType) Name() string   { panic("implement me") }
func (d *testDataType) BitWidth() int  { return 8 }

func TestMakeFromData(t *testing.T) {
	tests := []struct {
		name     string
		d        arrow.DataType
		size     int
		child    []*array.Data
		expPanic bool
		expError string
	}{
		// supported types
		{name: "null", d: &testDataType{arrow.NULL}},
		{name: "bool", d: &testDataType{arrow.BOOL}},
		{name: "uint8", d: &testDataType{arrow.UINT8}},
		{name: "uint16", d: &testDataType{arrow.UINT16}},
		{name: "uint32", d: &testDataType{arrow.UINT32}},
		{name: "uint64", d: &testDataType{arrow.UINT64}},
		{name: "int8", d: &testDataType{arrow.INT8}},
		{name: "int16", d: &testDataType{arrow.INT16}},
		{name: "int32", d: &testDataType{arrow.INT32}},
		{name: "int64", d: &testDataType{arrow.INT64}},
		{name: "float32", d: &testDataType{arrow.FLOAT32}},
		{name: "float64", d: &testDataType{arrow.FLOAT64}},
		{name: "string", d: &testDataType{arrow.STRING}, size: 3},
		{name: "binary", d: &testDataType{arrow.BINARY}, size: 3},
		{name: "fixed_size_binary", d: &testDataType{arrow.FIXED_SIZE_BINARY}},
		{name: "date32", d: &testDataType{arrow.DATE32}},
		{name: "date64", d: &testDataType{arrow.DATE64}},
		{name: "timestamp", d: &testDataType{arrow.TIMESTAMP}},
		{name: "time32", d: &testDataType{arrow.TIME32}},
		{name: "time64", d: &testDataType{arrow.TIME64}},
		{name: "month_interval", d: arrow.FixedWidthTypes.MonthInterval},
		{name: "day_time_interval", d: arrow.FixedWidthTypes.DayTimeInterval},
		{name: "decimal", d: &testDataType{arrow.DECIMAL}},

		{name: "list", d: &testDataType{arrow.LIST}, child: []*array.Data{
			array.NewData(&testDataType{arrow.INT64}, 0, make([]*memory.Buffer, 4), nil, 0, 0),
			array.NewData(&testDataType{arrow.INT64}, 0, make([]*memory.Buffer, 4), nil, 0, 0),
		}},

		{name: "struct", d: &testDataType{arrow.STRUCT}},
		{name: "struct", d: &testDataType{arrow.STRUCT}, child: []*array.Data{
			array.NewData(&testDataType{arrow.INT64}, 0, make([]*memory.Buffer, 4), nil, 0, 0),
			array.NewData(&testDataType{arrow.INT64}, 0, make([]*memory.Buffer, 4), nil, 0, 0),
		}},

		{name: "fixed_size_list", d: arrow.FixedSizeListOf(4, arrow.PrimitiveTypes.Int64), child: []*array.Data{
			array.NewData(&testDataType{arrow.INT64}, 0, make([]*memory.Buffer, 4), nil, 0, 0),
			array.NewData(&testDataType{arrow.INT64}, 0, make([]*memory.Buffer, 4), nil, 0, 0),
		}},
		{name: "duration", d: &testDataType{arrow.DURATION}},

		// unsupported types
		{name: "union", d: &testDataType{arrow.UNION}, expPanic: true, expError: "unsupported data type: UNION"},
		{name: "dictionary", d: &testDataType{arrow.DICTIONARY}, expPanic: true, expError: "unsupported data type: DICTIONARY"},
		{name: "map", d: &testDataType{arrow.Type(27)}, expPanic: true, expError: "unsupported data type: MAP"},
		{name: "extension", d: &testDataType{arrow.Type(28)}, expPanic: true, expError: "unsupported data type: EXTENSION"},

		// invalid types
		{name: "invalid(-1)", d: &testDataType{arrow.Type(-1)}, expPanic: true, expError: "invalid data type: Type(-1)"},
		{name: "invalid(31)", d: &testDataType{arrow.Type(31)}, expPanic: true, expError: "invalid data type: Type(31)"},
	}
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			var b [4]*memory.Buffer
			var n = 4
			if test.size != 0 {
				n = test.size
			}
			data := array.NewData(test.d, 0, b[:n], test.child, 0, 0)

			if test.expPanic {
				assert.PanicsWithValue(t, test.expError, func() {
					array.MakeFromData(data)
				})
			} else {
				assert.NotNil(t, array.MakeFromData(data))
			}
		})
	}
}

func bbits(v ...int32) []byte {
	return tools.IntsToBitsLSB(v...)
}

func TestArray_NullN(t *testing.T) {
	tests := []struct {
		name string
		l    int
		bm   []byte
		n    int
		exp  int
	}{
		{name: "unknown,l16", l: 16, bm: bbits(0x11001010, 0x00110011), n: array.UnknownNullCount, exp: 8},
		{name: "unknown,l12,ignores last nibble", l: 12, bm: bbits(0x11001010, 0x00111111), n: array.UnknownNullCount, exp: 6},
		{name: "unknown,l12,12 nulls", l: 12, bm: bbits(0x00000000, 0x00000000), n: array.UnknownNullCount, exp: 12},
		{name: "unknown,l12,00 nulls", l: 12, bm: bbits(0x11111111, 0x11111111), n: array.UnknownNullCount, exp: 0},
	}
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			buf := memory.NewBufferBytes(test.bm)
			data := array.NewData(arrow.FixedWidthTypes.Boolean, test.l, []*memory.Buffer{buf, nil}, nil, test.n, 0)
			buf.Release()
			ar := array.MakeFromData(data)
			data.Release()
			got := ar.NullN()
			ar.Release()
			assert.Equal(t, test.exp, got)
		})
	}
}

func TestArraySlice(t *testing.T) {
	pool := memory.NewCheckedAllocator(memory.NewGoAllocator())
	defer pool.AssertSize(t, 0)

	var (
		valids = []bool{true, true, true, false, true, true}
		vs     = []float64{1, 2, 3, 0, 4, 5}
	)

	b := array.NewFloat64Builder(pool)
	defer b.Release()

	for _, tc := range []struct {
		i, j   int
		panics bool
		len    int
	}{
		{i: 0, j: len(valids), panics: false, len: len(valids)},
		{i: len(valids), j: len(valids), panics: false, len: 0},
		{i: 0, j: 1, panics: false, len: 1},
		{i: 1, j: 1, panics: false, len: 0},
		{i: 0, j: len(valids) + 1, panics: true},
		{i: 2, j: 1, panics: true},
		{i: len(valids) + 1, j: len(valids) + 1, panics: true},
	} {
		t.Run("", func(t *testing.T) {
			b.AppendValues(vs, valids)

			arr := b.NewFloat64Array()
			defer arr.Release()

			if got, want := arr.Len(), len(valids); got != want {
				t.Fatalf("got=%d, want=%d", got, want)
			}

			if tc.panics {
				defer func() {
					e := recover()
					if e == nil {
						t.Fatalf("this should have panicked, but did not")
					}
				}()
			}

			slice := array.NewSlice(arr, int64(tc.i), int64(tc.j)).(*array.Float64)
			defer slice.Release()

			if got, want := slice.Len(), tc.len; got != want {
				t.Fatalf("invalid slice length: got=%d, want=%d", got, want)
			}
		})
	}
}

func TestArraySliceTypes(t *testing.T) {
	pool := memory.NewCheckedAllocator(memory.NewGoAllocator())
	defer pool.AssertSize(t, 0)

	valids := []bool{true, true, true, false, true, true}

	for _, tc := range []struct {
		values  interface{}
		builder array.Builder
		append  func(b array.Builder, vs interface{})
	}{
		{
			values:  []bool{true, false, true, false, true, false},
			builder: array.NewBooleanBuilder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.BooleanBuilder).AppendValues(vs.([]bool), valids) },
		},
		{
			values:  []uint8{1, 2, 3, 0, 4, 5},
			builder: array.NewUint8Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Uint8Builder).AppendValues(vs.([]uint8), valids) },
		},
		{
			values:  []uint16{1, 2, 3, 0, 4, 5},
			builder: array.NewUint16Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Uint16Builder).AppendValues(vs.([]uint16), valids) },
		},
		{
			values:  []uint32{1, 2, 3, 0, 4, 5},
			builder: array.NewUint32Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Uint32Builder).AppendValues(vs.([]uint32), valids) },
		},
		{
			values:  []uint64{1, 2, 3, 0, 4, 5},
			builder: array.NewUint64Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Uint64Builder).AppendValues(vs.([]uint64), valids) },
		},
		{
			values:  []int8{1, 2, 3, 0, 4, 5},
			builder: array.NewInt8Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Int8Builder).AppendValues(vs.([]int8), valids) },
		},
		{
			values:  []int16{1, 2, 3, 0, 4, 5},
			builder: array.NewInt16Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Int16Builder).AppendValues(vs.([]int16), valids) },
		},
		{
			values:  []int32{1, 2, 3, 0, 4, 5},
			builder: array.NewInt32Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Int32Builder).AppendValues(vs.([]int32), valids) },
		},
		{
			values:  []int64{1, 2, 3, 0, 4, 5},
			builder: array.NewInt64Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Int64Builder).AppendValues(vs.([]int64), valids) },
		},
		{
			values:  []float32{1, 2, 3, 0, 4, 5},
			builder: array.NewFloat32Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Float32Builder).AppendValues(vs.([]float32), valids) },
		},
		{
			values:  []float64{1, 2, 3, 0, 4, 5},
			builder: array.NewFloat64Builder(pool),
			append:  func(b array.Builder, vs interface{}) { b.(*array.Float64Builder).AppendValues(vs.([]float64), valids) },
		},
	} {
		t.Run("", func(t *testing.T) {
			defer tc.builder.Release()

			b := tc.builder
			tc.append(b, tc.values)

			arr := b.NewArray()
			defer arr.Release()

			if got, want := arr.Len(), len(valids); got != want {
				t.Fatalf("invalid length: got=%d, want=%d", got, want)
			}

			slice := array.NewSlice(arr, 2, 5)
			defer slice.Release()

			if got, want := slice.Len(), 3; got != want {
				t.Fatalf("invalid slice length: got=%d, want=%d", got, want)
			}
		})
	}
}


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

namespace Panda_Player.Models.Manage.Admin
{
    public class Role
    {
        public string Name { get; set; }

        public bool IsSelected { get; set; }
    }
}


text:
About
-----

The sphinx(full text search server) client package for the Go programming language.

## Installation

`go get github.com/yunge/sphinx`

## Testing

Import "documents.sql" to "test" database in mysql;

Change the mysql password in sphinx.conf;

Copy the test.xml to default dir in sphinx.conf:
`cp test.xml /usr/local/sphinx/var/data`

Index the test data:
`indexer -c sphinx_lib_path/sphinx.conf --all --rotate`

Start sphinx searchd with "sphinx.conf":
`searchd -c sphinx_lib_path/sphinx.conf`

Then "cd" to sphinx_lib_path:

`go test`

## Examples
```Go
import (
  "github.com/yunge/sphinx"
)

// Get sphinx client
opts := &Options{
	Host:    host,
	Port:    9312,
	Timeout: 5000,
}

sc := sphinx.NewClient(opts)

// Or use this style:
// Note: SetServer("", 0) means use default value.
sc := sphinx.NewClient().SetServer(host, 0).SetConnectTimeout(5000)
if err := sc.Error(); err != nil {
	// handle err
}

res, err := sc.Query(words, index, "Some comment...")
if err != nil {
	// handle err
}

for _, match := range res.Matches {
	// handle match.DocId
}

```
More examples can be found in test files.

## LICENSE

BSD License
[http://opensource.org/licenses/bsd-license](http://opensource.org/licenses/bsd-license)


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

<title>AgentSpeakSideKickParser (Jason - AgentSpeak Java Interpreter)</title>
<meta name="date" content="2013-12-12">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

jason.jeditplugin

Class AgentSpeakSideKickParser

<map id="G" name="G">
<area shape="rect" id="node1_0" href="./AgentSpeakSideKickParser.html" title="jason.jeditplugin.AgentSpeakSideKickParser" alt="" coords="15,118,193,143"/>
<area shape="rect" id="node1" href="./AgentSpeakSideKickParser.html" title="<TABLE>" alt="" coords="5,107,203,155"/>
<area shape="rect" id="node2_1" href="http://java.sun.com/j2se/1.4.2/docs/api/sidekick/SideKickParser.html" title="sidekick.SideKickParser" alt="" coords="57,11,151,53"/>
<area shape="rect" id="node2" href="http://java.sun.com/j2se/1.4.2/docs/api/sidekick/SideKickParser.html" title="<TABLE>" alt="" coords="47,6,161,58"/>
</map>

java.lang.Object

sidekick.SideKickParser

jason.jeditplugin.AgentSpeakSideKickParser

public class AgentSpeakSideKickParser
extends sidekick.SideKickParser

Field Summary

Fields

Modifier and Type
Field and Description

static java.lang.String
ID

Fields inherited from class sidekick.SideKickParser

SERVICE

Constructor Summary

Constructors

Constructor and Description

AgentSpeakSideKickParser()

Method Summary

Methods

Modifier and Type
Method and Description

static void
addError(jason.asSyntax.parser.ParseException ex,
        errorlist.DefaultErrorSource errorSource,
        java.lang.String path)

sidekick.SideKickParsedData
parse(org.gjt.sp.jedit.Buffer buf,
     errorlist.DefaultErrorSource errorSource)

java.lang.String
toString()

Methods inherited from class sidekick.SideKickParser

activate, activate, canCompleteAnywhere, canHandleBackspace, complete, deactivate, deactivate, getInstantCompletionTriggers, getName, getParseTriggers, stop, supportsCompletion

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

ID

public static final java.lang.String ID

See Also:

Constant Field Values

Constructor Detail

AgentSpeakSideKickParser

public AgentSpeakSideKickParser()

Method Detail

parse

public sidekick.SideKickParsedData parse(org.gjt.sp.jedit.Buffer buf,
                                errorlist.DefaultErrorSource errorSource)

Specified by:

parse in class sidekick.SideKickParser

addError

public static void addError(jason.asSyntax.parser.ParseException ex,
            errorlist.DefaultErrorSource errorSource,
            java.lang.String path)

toString

public java.lang.String toString()

Overrides:

toString in class java.lang.Object

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package org.apache.geode.test.dunit.examples;

import static org.apache.geode.test.dunit.VM.getAllVMs;

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

import org.junit.Rule;
import org.junit.Test;

import org.apache.geode.test.dunit.AsyncInvocation;
import org.apache.geode.test.dunit.VM;
import org.apache.geode.test.dunit.rules.DistributedRule;

public class AsyncInvokeRunnableExampleTest {

  @Rule
  public DistributedRule distributedRule = new DistributedRule();

  @Test
  public void invokeAsyncHelloWorldInEachVM() {
    for (VM vm : getAllVMs()) {
      vm.invokeAsync(() -> System.out.println(vm + " says Hello World!"));
    }
  }

  @Test
  public void invokeAsyncHelloWorldInEachVMWithAwait() throws Exception {
    List<AsyncInvocation> invocations = new ArrayList<>();
    for (VM vm : getAllVMs()) {
      AsyncInvocation invocation =
          vm.invokeAsync(() -> System.out.println(vm + " says Hello World!"));
      invocations.add(invocation);
    }
    for (AsyncInvocation invocation : invocations) {
      invocation.await();
    }
  }
}


text:
<?php
/**
 * This is a Zeus pagecontroller.
 *
 */
// Include the essential config-file which also creates the $zeus variable with its defaults.
include(__DIR__.'/config.php');

// Check if user is authenticated.
//$acronym = isset($_SESSION['user']) ? $_SESSION['user']->acronym : null;

if($acronym) {
  $output = "Du är inloggad som: $acronym ({$CUse->GetName()})";
  $output = "
{$output}
";
}
else {
  $output = "Du är INTE inloggad.";
  $output = "
{$output}
";
}

// Check if user and password is okey
if(isset($_POST['login'])) {
	$CUse->Login($_POST['acronym'], $_POST['password']);
	header('Location: admin.php');
}

// Do it and store it all in variables in the Zeus container.
$zeus['title'] = "Logga in";

$zeus['main'] = <<<EOD

{$zeus['title']}

			<form class="form-horizontal" method=post>

					Användarnamn

						<input type="text" class="form-control" id="acronym" name="acronym"/>

					Lösenord

						<input type="password" class="form-control" id="password" name="password"/>

						<input class='btn btn-default' type='submit' name='login' value='Logga in'/>

						<output class='text-center'>{$output}</output>

			</form>

EOD;

// Finally, leave it all to the rendering phase of Zeus.
include(ZEUS_THEME_PATH);


text:
package org.apache.flink.runtime.util;

import org.junit.Test;

import java.util.Random;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeoutException;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class AtomicDisposableReferenceCounterTest {

    @Test
    public void testSerialIncrementAndDecrement() {
        AtomicDisposableReferenceCounter counter = new AtomicDisposableReferenceCounter();

        assertTrue(counter.increment());

        assertTrue(counter.decrement());

        assertFalse(counter.increment());

        assertFalse(counter.decrement());
    }

    @Test
    public void testSerialIncrementAndDecrementWithCustomDisposeCount() {
        AtomicDisposableReferenceCounter counter = new AtomicDisposableReferenceCounter(-2);

        assertTrue(counter.increment());

        assertFalse(counter.decrement());

        assertFalse(counter.decrement());

        assertTrue(counter.decrement());
    }

    @Test
    public void testConcurrentIncrementAndDecrement()
            throws InterruptedException, ExecutionException, TimeoutException {
        final Random random = new Random();

        final ExecutorService executor = Executors.newFixedThreadPool(2);

        try {
            final MockIncrementer incrementer = new MockIncrementer();

            final MockDecrementer decrementer = new MockDecrementer();

            // Repeat this to provoke races
            for (int i = 0; i < 256; i++) {
                final AtomicDisposableReferenceCounter counter =
                        new AtomicDisposableReferenceCounter();
                incrementer.setCounter(counter);
                decrementer.setCounter(counter);

                counter.increment();

                // Randomly decide which one should be first as the first task usually will win the
                // race
                boolean incrementFirst = random.nextBoolean();

                Future<Boolean> success1 =
                        executor.submit(incrementFirst ? incrementer : decrementer);
                Future<Boolean> success2 =
                        executor.submit(incrementFirst ? decrementer : incrementer);

                // Only one of the two should win the race and return true
                assertTrue(success1.get() ^ success2.get());
            }
        } finally {
            executor.shutdownNow();
        }
    }

    private static class MockIncrementer implements Callable<Boolean> {

        private AtomicDisposableReferenceCounter counter;

        void setCounter(AtomicDisposableReferenceCounter counter) {
            this.counter = counter;
        }

        @Override
        public Boolean call() throws Exception {
            return counter.increment();
        }
    }

    private static class MockDecrementer implements Callable<Boolean> {

        private AtomicDisposableReferenceCounter counter;

        void setCounter(AtomicDisposableReferenceCounter counter) {
            this.counter = counter;
        }

        @Override
        public Boolean call() throws Exception {
            return counter.decrement();
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/task"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:task="http://www.springframework.org/schema/task"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xsi:schemaLocation="http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    <!-- Open and Close Lucene Index Directory to write and index information -->
     <beans:bean name="indexWriter" class="org.encuestame.business.search.IndexWriterManager" scope="prototype">
           <beans:property name="directoryStore" ref="indexRamDirectory"></beans:property>
    </beans:bean>
      <beans:bean name="indexerManager" class="org.encuestame.business.search.IndexerManager" scope="prototype">
        <!-- Extensions files allowed to index -->
        <beans:property name="extensionFilesAllowed">
            <beans:list>
                <!-- Document word 2007 -->
                <beans:value >docx</beans:value>
                <!-- PDF Document -->
                <beans:value>pdf</beans:value>
                <!-- Spreadsheets Documents(Excel 2003) -->
                <beans:value>xls</beans:value>
                <!-- Text Document -->
                <beans:value>txt</beans:value>
            </beans:list>
        </beans:property>
     </beans:bean>
      <beans:bean name="searchManager" class="org.encuestame.business.search.SearchAttachmentManager" scope="singleton">
        <beans:property name="directoryIndexStore" ref="indexRamDirectory"></beans:property>
     </beans:bean>
    <!-- Index directory description.-->
    <beans:bean id="indexRamDirectory" class="org.encuestame.business.search.IndexRAMDirectory" scope="singleton"/>
</beans:beans>


text:
package com.example.volleytest;

import java.io.File;
import java.util.Map;

/**
 * @author ZhiCheng Guo
 * @version 2014年10月7日 上午11:04:36
 */
public interface MultiPartRequest {

    public void addFileUpload(String param,File file);

    public void addStringUpload(String param,String content);

    public Map<String,File> getFileUploads();

    public Map<String,String> getStringUploads();
}


text:
"""Retrieve method tests
"""
import os
import shutil
import unittest
import httpretty
import pytest_check as check
from dcmweb import dcmweb

URL = "https://dicom.com/"

RETRIEVE_CASES = {"": ["1/2/3.dcm", "1/2/4.dcm", "3/2/1.dcm"],
                  "studies/1": ["1/2/3.dcm"],
                  "studies/1/series/2/instances/3": ["1/2/3.dcm"],
                  "studies/3/series/2/instances/1": ["3/2/1.dcm"],
                  "studies/1/series/2/instances/3/frames/1": ["1/2/3_frame_1.png"]}

class RetrieveTests(unittest.TestCase):
    """class to handle http mock and retrieve tests"""

    def setUp(self):
        httpretty.enable()
        httpretty.register_uri(
            httpretty.GET,
            generate_page_url(URL, 0),
            body=generate_array_response(
                [generate_response(1, 2, 3), generate_response(1, 2, 4)]),
            match_querystring=True
        )
        httpretty.register_uri(
            httpretty.GET,
            generate_page_url(URL, 5000),
            body=generate_array_response([generate_response(3, 2, 1)]),
            match_querystring=True
        )
        httpretty.register_uri(
            httpretty.GET,
            generate_page_url(URL, 10000),
            status=204,
            match_querystring=True
        )
        httpretty.register_uri(
            httpretty.GET,
            generate_page_url(URL+"studies/1/", 0),
            body=generate_array_response([generate_response(1, 2, 3)]),
            match_querystring=True
        )
        httpretty.register_uri(
            httpretty.GET,
            generate_page_url(URL+"studies/1/", 5000),
            status=204,
            match_querystring=True
        )
        httpretty.register_uri(
            httpretty.GET,
            URL+"studies/1/series/2/instances/3",
            body="3.dcm",
            adding_headers={
                'Content-Type': 'application/dicom'},
        )
        httpretty.register_uri(
            httpretty.GET,
            URL+"studies/1/series/2/instances/4",
            body="4.dcm",
            adding_headers={
                'Content-Type': 'application/dicom'},
        )
        httpretty.register_uri(
            httpretty.GET,
            URL+"studies/3/series/2/instances/1",
            body="1.dcm",
            adding_headers={
                'Content-Type': 'application/dicom'},
        )

        httpretty.register_uri(
            httpretty.GET,
            URL+"studies?limit=1",
            match_querystring=True
        )

        mock_data = [
            b'1C\r\n--456 Content-Type:image/png\r\n4\r\ndata\r\n5\r\n--456\r\n0\r\n\r\n']
        httpretty.register_uri(
            httpretty.GET,
            URL+"studies/1/series/2/instances/3/frames/1",
            body=(l for l in mock_data),
            adding_headers={
                'Content-Type': 'multipart/related; type="image/png"; boundary=456;',
                'transfer-encoding': 'chunked'},
            streaming=True
        )

    def tearDown(self):
        httpretty.disable()
        httpretty.reset()

    def test_retrieve(self):  # pylint: disable=no-self-use; method in class for cleaner look by setup method
        """should get all avalible files and single one"""
        output = "./testData/"
        for multithreading in (True, False):
            dcmweb_cli = dcmweb.Dcmweb(
                URL, multithreading, None)
            for path, files in RETRIEVE_CASES.items():
                dcmweb_cli.retrieve(path, output)
                for file in files:
                    file_path = output + file
                    file_exists = os.path.isfile(file_path)
                    check.is_true(file_exists, "can't find file {} in {} mode after retrieving {}"\
                        .format(file_path, "parallel" if multithreading else "sequential", path))
                    if file_exists:
                        os.remove(file_path)
                shutil.rmtree(output)

def generate_response(study_id, series_id, instance_id):
    """generates json string for instance"""
    return '{"00080018":{"vr":"UI","Value":["'+str(instance_id)+'"]},\
    "0020000D":{"vr":"UI","Value":["'+str(study_id)+'"]},\
    "0020000E":{"vr":"UI","Value":["'+str(series_id)+'"]}}'

def generate_array_response(responses):
    """generates json string for list of instances"""
    return "[" + ",".join(responses) + "]"

def generate_page_url(base, offset):
    """generates url"""
    return base + "instances?includefield=0020000D&\
includefield=0020000E&limit=5000&offset={}".format(offset)


text:
Easy Minecraft Server Management
===================
```
Usage:
    minecraft.sh <start|stop|restart|clean-backups|upgrade|status|attach> [options]
    minecraft.sh help
    minecraft.sh log [number-of-lines]
    minecraft.sh backup [message]
    minecraft.sh cmd <minecraft command>
Options:
    --type=<type>
        Server type: vanilla or paper. Defaults to the last started type: 'vanilla'
    --min-ram=<memory value>
        Minimum memory for the JVM for the server. Defaults to '2048M'
    --max-ram=<memory value>
        Maximum memory for the JVM for the server. Defaults to '6144M'
    --cpu-count=<number>
        Amount of CPUs dedicated to this server. Defaults to '3'
    --delay=<seconds>
        Number of seconds to wait until the server stops (useful to warn players). Defaults to '30'
```


text:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/cause_toggle_background" />
    <item android:drawable="@drawable/cause_bullying" />
</layer-list>


text:
let chai_jasmine = require('chai-jasmine');

let polylock = require('./../lib/index.js');

describe('wait read', function () {
    let db = new polylock();

    it('operation 1 promise resolves to return value', function (done) {
        let retval = 4365;

        db.wait({resource: 'read'}).then(function (release) {
            release();
            return retval;
        }).then(function (resolve_val) {
            expect(resolve_val).toBe(retval);
            done();
        }).catch(function (err) {
            done.fail(err);
        });
    });

    it('operation 2 promise resolves to return value', function (done) {
        let retval = 3654;

        db.wait({resource: 'read'}).then(function (release) {
            release();
            return retval;
        }).then(function (resolve_val) {
            expect(resolve_val).toBe(retval);
            done();
        }).catch(function (err) {
            done.fail(err);
        });
    });
});

describe('wait write', function () {
    let db = new polylock();

    it('operation 1 promise resolves to return value', function (done) {
        let retval = 4356;

        db.wait({resource: 'write'}).then(function (release) {
            release();
            return retval;
        }).then(function (resolve_val) {
            expect(resolve_val).toBe(retval);
            done();
        }).catch(function (err) {
            done.fail(err);
        });
    });

    it('operation 2 promise resolves to return value', function (done) {
        let retval = 5436;

        db.wait({resource: 'write'}).then(function (release) {
            release();
            return retval;
        }).then(function (resolve_val) {
            expect(resolve_val).toBe(retval);
            done();
        }).catch(function (err) {
            done.fail(err);
        });
    });
});


text:
require 'test_helper'

class ListingProductsTest < ActionDispatch::IntegrationTest
  setup do
    Product.create!(title: 'Rocketman Gem')
    Product.create!(title: 'Dirtclod Gem')
  end

  test 'listing products' do
    get '/products'

    assert_equal 200, response.status
    assert_equal Mime::JSON, response.content_type

    assert_equal Product.count, json(response.body).size
  end
end


text:
package com.camnter.newlife.ui.activity.jsbridge;

/**
 * 协议:  JsBridge://className:callbackAddress/methodName?jsonObject
 *
 * Description:IBridge
 * Created by:CaMnter
 */

public interface IBridge {
}