text:
package uk.org.ngo.squeezer.test.mock;

import android.util.Log;

import junit.framework.AssertionFailedError;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

import uk.org.ngo.squeezer.itemlist.dialog.ViewDialog.AlbumsSortOrder;

/**
 * Emulates LMS for testing purposes
 *

 * Each instance will wait for an incoming connection, accept it, read commands from the
 * inputstream, and reply to the outputstream, until the connection is broken or the exit command is
 * received, at which point the connection is terminated.
 *

 * To make a new connection a new instance must be started.
 *
 * @author Kurt Aaholst <kaaholst@gmail.com>
 */
public class SqueezeboxServerMock extends Thread {

    private static final String TAG = SqueezeboxServerMock.class.getSimpleName();

    public static final int CLI_PORT = 9091;

    private final Object serverReadyMonitor = new Object();

    private boolean accepting;

    public static class Starter {

        public SqueezeboxServerMock start() {
            SqueezeboxServerMock server = new SqueezeboxServerMock(this);
            server.start();
            synchronized (server.serverReadyMonitor) {
                while (!server.accepting) {
                    try {
                        server.serverReadyMonitor.wait(2000);
                        if (!server.accepting) {
                            throw new AssertionFailedError("Expected the mock server to start");
                        }
                    } catch (InterruptedException e) {
                        Log.w(TAG, "Interrupted while waiting for the mock server to start");
                    }
                }
            }
            return server;
        }

        public Starter username(String username) {
            this.username = username;
            return this;
        }

        public Starter password(String password) {
            this.password = password;
            return this;
        }

        public Starter canRandomplay(boolean canRandomplay) {
            this.canRandomplay = canRandomplay;
            return this;
        }

        public Starter canMusicFolder(boolean canMusicFolder) {
            this.canMusicFolder = canMusicFolder;
            return this;
        }

        public Starter albumsSortOrder(AlbumsSortOrder albumsSortOrder) {
            this.albumsSortOrder = albumsSortOrder;
            return this;
        }

        private String username;

        private String password;

        private boolean canRandomplay = true;

        private boolean canMusicFolder = true;

        private AlbumsSortOrder albumsSortOrder = AlbumsSortOrder.album;
    }

    public static Starter starter() {
        return new Starter();
    }

    private SqueezeboxServerMock(Starter starter) {
        username = starter.username;
        password = starter.password;
        canRandomplay = starter.canRandomplay;
        canMusicFolder = starter.canMusicFolder;
        albumsSortOrder = starter.albumsSortOrder;
    }

    private String username;

    private String password;

    private boolean canMusicFolder;

    private boolean canRandomplay;

    private AlbumsSortOrder albumsSortOrder;

    @Override
    public void run() {
        ServerSocket serverSocket;
        Socket socket;
        BufferedReader in;
        PrintWriter out;
        try {
            // Establish server socket
            serverSocket = new ServerSocket(CLI_PORT);
            serverSocket.setReuseAddress(true);

            // Wait for incoming connection
            Log.d(TAG, "Mock server listening on port: " + serverSocket.getLocalPort());
            synchronized (serverReadyMonitor) {
                accepting = true;
                serverReadyMonitor.notifyAll();
            }
            socket = serverSocket.accept();

            Log.d(TAG, "Mock server connected to: " + socket.getRemoteSocketAddress());
            in = new BufferedReader(new InputStreamReader(socket.getInputStream()), 128);
            out = new PrintWriter(socket.getOutputStream(), true);
        } catch (IOException e) {
            throw new Error(e);
        }

        boolean loggedIn = (username == null || password == null);

        while(! Thread.interrupted()) {
            // read data from Socket
            String line;
            try {
                line = in.readLine();
            } catch (IOException e) {
                line = null;
            }
            Log.d(TAG, "Mock server got: " + line);
            if (line == null) {
                break; // Client disconnected
            }

            String[] tokens = line.split(" ");

            if ("login".equals(tokens[0])) {
                out.println(tokens[0] + ' ' + tokens[1] + " ******");
                if (username != null && password != null) {
                    if (tokens.length < 2 || !username.equals(tokens[1])) {
                        break;
                    }
                    if (tokens.length < 3 || !password.equals(tokens[2])) {
                        break;
                    }
                }
                loggedIn = true;
            } else {
                if (!loggedIn) {
                    break;
                }

                if ("exit".equals(line)) {
                    out.println(line);
                    break;
                } else if ("listen 1".equals(line)) {
                    //Just ignore, mock doesn't support server side events
                    out.println("listen 1");
                } else if ("can musicfolder ?".equals(line)) {
                    out.println("can musicfolder " + (canMusicFolder ? 1 : 0));
                } else if ("can randomplay ?".equals(line)) {
                    out.println("can randomplay " + (canRandomplay ? 1 : 0));
                } else if ("pref httpport ?".equals(line)) {
                    out.println("pref httpport 9092");
                } else if ("pref jivealbumsort ?".equals(line)) {
                    out.println("pref jivealbumsort " + albumsSortOrder);
                } else if ("version ?".equals(line)) {
                    out.println("version 7.7.2");
                } else if ("players".equals(tokens[0])) {
                    //TODO implement
                } else {
                    out.println(line);
                }
            }
        }
        try {
            Log.d(TAG, "Mock server closing socket");
            socket.close();
            serverSocket.close();
        } catch (IOException e) {}
    }

}


text:
<?php declare(strict_types=1);

namespace App\Entity;

use DateTime;
use Doctrine\ORM\Event\PreUpdateEventArgs;
use Doctrine\ORM\Mapping as ORM;
use Tracy\Debugger;

/**
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks
 */
class Part
{
	use Attributes\Identifier;
	use Attributes\Activable;
	use Attributes\Statusable;
	use Attributes\Timestamp;

	/**
	 * @ORM\Column(type="string")
	 * @var string
	 */
	private $name;

	/**
	 * @ORM\Column(type="integer", precision=2)
	 * @var float
	 */
	private $price;

	/**
     * @ORM\ManyToOne(targetEntity="Vehicle", inversedBy="parts")
	 * @ORM\JoinColumn(nullable=false)
	 * @var Vehicle
	 */
	private $vehicle;

	/**
	 * @param string  $name
	 * @param int  $price
	 * @param Vehicle  $vehicle
	 */
	public function __construct(string $name, int $price, Vehicle $vehicle)
	{
		$this->parts = new ArrayCollection;
		$this->created = new DateTime;

		$this->name = $name;
		$this->price = $price;
		$this->vehicle = $vehicle;
	}

	/**
	 * @param  string  $name
	 * @return void
	 */
	public function setName(string $name): void
	{
		$this->name = $name;
	}

	/**
	 * @return string
	 */
	public function getName(): string
	{
		return $this->name;
	}

	/**
	 * @param  int  $price
	 * @return void
	 */
	public function setPrice(int $price): void
	{
		$this->price = $price;
	}

	/**
	 * @return int
	 */
	public function getPrice(): int
	{
		return $this->price;
	}

	/**
	 * @return Vehicle
	 */
	public function getVehicle(): Vehicle
	{
		return $this->vehicle;
	}

	/**
	 * @ORM\PreUpdate
	 * @param  PreUpdateEventArgs  $e
	 * @return void
	 * @internal
	 */
	public function onPreUpdate(PreUpdateEventArgs $e): void
	{
		Debugger::log(json_encode(['id' => $this->id] + $e->getEntityChangeSet()), 'changes/part');
		$this->setModified(null);
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
<Class name="CPM.Source.Xml">
<IncludeCode>CPM.License,CPM.DataTypes</IncludeCode>
<Super>%RegisteredObject,CPM.Source.IBase</Super>
<TimeCreated>63578,69857.787389</TimeCreated>

<Parameter name="EXTENSIONS">
<Type>%String</Type>
<Default>XML</Default>
</Parameter>

<Parameter name="MANIFEST">
<Type>%String</Type>
<Default>manifest.xml</Default>
</Parameter>

<Property name="xmlArrayReader">
<Type>CPM.Utils.XmlArray</Type>
</Property>

<Property name="DebugMode">
<Type>%Boolean</Type>
<InitialExpression>0</InitialExpression>
</Property>

<Method name="IsPackedGet">
<Description>
override IsPacked property to be always returning 1</Description>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[    quit 0
]]></Implementation>
</Method>

<Method name="IsPackedSet">
<FormalSpec>Val:%Boolean</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #; simply ignore
    quit $$$OK
]]></Implementation>
</Method>

<Property name="RepoRootDir">
<Type>%String</Type>
<Private>1</Private>
</Property>

<Property name="DirectoryPath">
<Type>%String</Type>
<Private>1</Private>
</Property>

<Property name="ManifestPath">
<Type>%String</Type>
<Private>1</Private>
</Property>

<Property name="PackagePath">
<Type>%String</Type>
<Private>1</Private>
</Property>

<Method name="iCalcPaths">
<FormalSpec>FileName:%String</FormalSpec>
<Private>1</Private>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    if '##class(%File).Exists(FileName) {
        if ##class(%File).DirectoryExists(FileName) {
        // directory, not file name given
            set ..DirectoryPath = FileName
            set ..ManifestPath = ##class(%Library.File).NormalizeFilename(..#MANIFEST,..DirectoryPath)
            // ..PackagePath will be calculated later, upon parsing of manifest
        }
    } else {
        // file name given, assume it's manifest
        set ..DirectoryPath = ##class(%Library.File).GetDirectory(FileName)
        set ..ManifestPath = FileName
    }
    set ..RepoRootDir = ##class(%Library.File).ParentDirectoryName(..DirectoryPath)

    quit ..ManifestPath
]]></Implementation>
</Method>

<Method name="iFullPackagePath">
<FormalSpec>FileName:%String</FormalSpec>
<Private>1</Private>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    quit:FileName="" ""
    quit ##class(%Library.File).NormalizeFilename(FileName,..DirectoryPath)
]]></Implementation>
</Method>

<Method name="Open">
<FormalSpec>fileName:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    set ..xmlArrayReader = ##class(CPM.Utils.XmlArray).%OpenFile(..iCalcPaths(fileName))
    quit $isobject(..xmlArrayReader)
]]></Implementation>
</Method>

<Method name="Unpack">
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[    quit '$$$OK
]]></Implementation>
</Method>

<Method name="Parse">
<PublicList>xmltree</PublicList>
<ReturnType>CPM.IPackage</ReturnType>
<Implementation><![CDATA[
    new xmltree
    do ..xmlArrayReader.ParseXml($name(xmltree))
    merge pkg       = xmltree("Manifest", 1, "Package")
    merge localdeps = xmltree("Manifest", 2, "Dependencies")
    merge ..PackageContent.Data = xmltree kill xmltree

    #dim p As CPM.IPackage = ##class(CPM.IPackage).%New()
    do p.DirectoryPathSet(..DirectoryPath)
    set p.name      = ##class(CPM.IPackage).NormalizeName(pkg("Name"))
    set p.path      = $get(pkg("Path"))
    set p.version   = $get(pkg("Version"))
    set p.license   = $get(pkg("License"))

    if ..DebugMode { write p.name,":", p.path,":", p.version,! }

    #dim deps As %ArrayOfDataTypes

    set i = $order(localdeps(""))
    while i'="" {
        #dim depName As %String = localdeps(i,"Dependency","Name")

        #dim depItemsList  = $lb("version",$get(localdeps(i,"Dependency","Version")),
                                 "path",$get(localdeps(i,"Dependency","Path")))

        set deps(depName) = depItemsList
        if ..DebugMode {
            #dim depVersion As %String = $get(localdeps(i,"Dependency","Version"),
                                         $get(localdeps(i,"Dependency","Path"))) ; create exportable list of deps
            write ?4, depName, ?20, depVersion, !
        }
        set i = $order(localdeps(i))
    }
    set i="" for  {
        #dim value As %String
        set i=$order(deps(i),1,value) quit:i=""
        do p.dependencies.Insert(value)
    }

    quit p
]]></Implementation>
</Method>

<Method name="iPackageBaseDir">
<Description>
create repo-based path using given package symbolic name</Description>
<FormalSpec>packageName:%String</FormalSpec>
<Private>1</Private>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    if $Length(..RepoRootDir)=0 {
        quit ""
    }
    #dim dir As %String = ##class(%Library.File).NormalizeDirectory(packageName,..RepoRootDir)
    quit dir
]]></Implementation>
</Method>

<Method name="iManifestPath">
<FormalSpec>packageName:%String</FormalSpec>
<Private>1</Private>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[    quit ##class(%Library.File).NormalizeFilename(..#MANIFEST,..iPackageBaseDir(packageName))
]]></Implementation>
</Method>

<Method name="DumpManifest">
<ClassMethod>1</ClassMethod>
<FormalSpec>FileName:%String,Recursive:%Boolean=0,Debug:%Boolean=1</FormalSpec>
<Implementation><![CDATA[
    $$$InitQueue(queue) $$$Enqueue(queue,"*")

    do {
        $$$Dequeue(queue)
        #dim parser As CPM.Source.Xml = ..%New()
        set parser.DebugMode = Debug
        do parser.Open(FileName)
        #dim package As CPM.IPackage = parser.Parse()
        if Debug {
            write ?4, package.name, ?32, package.dependencies.Count(), !
        }
        if Recursive {
            set known(package.name) = 1 ; mark itself as visited
            #dim name As %String = ""
            for {
                #dim listItems = package.dependencies.GetNext(.name)
                quit:name=""
                if '$data(known(name)) {
                    $$$Enqueue(queue,name)
                    set known(name) = 1
                }
            }
            set FileName = parser.iManifestPath( $$$QueueHead(queue) )
        }
    } while Recursive && $$$QueueLen(queue)
]]></Implementation>
</Method>

<Method name="Install">
<FormalSpec>dryrun:%Boolean=0,package:CPM.IPackage</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    #dim status As %Status = $$$OK
    #dim fullPath As %String = package.GetFullPath()
    if ##class(%Library.File).Exists(fullPath) {
        // 1. load list of items in the container
        do $system.OBJ.Load(fullPath,"-d",,.list,1)
        write !,"About to load these items from the package ", package.name,!
        #dim itemName As %String = ""
        for  {
            set itemName = $order(list(itemName))
            quit:itemName=""
            write ?8,itemName,!
        }
        // TODO: 2. Ask interactively to install
        // TODO: 3. Actual installation
        if 'dryrun {
            do $system.OBJ.Load(fullPath,"ck",.errorlog,.list)
            set itemName = "" for {
                set itemName = $order(list(itemName))
                quit:itemName=""
                do package.items.Insert(itemName)
            }
            // TODO - check errorlog

            // 4.0. check whether there is same name duplicate
            #dim storedPackage As CPM.Registry.Package
            if ##class(CPM.Registry.Package).%ExistsId(package.name) {
                // TODO - later we need to be more vocal, at the moment - just overwrite
                //        it sliently
                set storedPackage = ##class(CPM.Registry.Package).%OpenId(package.name)
                do storedPackage.%OnNew(package)
            } else {
                set storedPackage = ##class(CPM.Registry.Package).%New(package)
            }
            // 4. save package instance to the registry
            set status = storedPackage.%Save()
        }

        quit status
   }
]]></Implementation>
</Method>
</Class>
</Export>


text:
interface PaginationPropTypes {
  prefixCls?: string;
  className?: string;
  mode?: 'button' | 'number' | 'pointer';
  simple?: Boolean;
  style?: any;
  current: number;
  total: number;
  prevText?: string;
  nextText?: string;
  onPrev?: () => void;
  onNext?: () => void;
  onChange?: Function;
  indicatorStyle?: any;
  /** rn only **/
  styles?: any;
}

export default PaginationPropTypes;


text:
package net.sf.jasperreports.engine.export.zip;

import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

/**
 * @author Teodor Danciu (teodord@users.sourceforge.net)
 * @version $Id: AbstractZip.java 7199 2014-08-27 13:58:10Z teodord $
 */
public abstract class AbstractZip
{

	/**
	 *
	 */
	protected List<ExportZipEntry> exportZipEntries = new ArrayList<ExportZipEntry>();

	/**
	 *
	 */
	public abstract ExportZipEntry createEntry(String name);

	/**
	 *
	 */
	public void addEntry(ExportZipEntry entry)
	{
		exportZipEntries.add(entry);
	}

	/**
	 *
	 */
	public void zipEntries(OutputStream os) throws IOException
	{
		ZipOutputStream zipos = new ZipOutputStream(os);
		zipos.setMethod(ZipOutputStream.DEFLATED);

		for (int i = 0; i < exportZipEntries.size(); i++)
		{
			ExportZipEntry exportZipEntry = exportZipEntries.get(i);
			ZipEntry zipEntry = new ZipEntry(exportZipEntry.getName());
			zipos.putNextEntry(zipEntry);
			exportZipEntry.writeData(zipos);
		}

		zipos.flush();
		zipos.finish();
	}

	/**
	 *
	 */
	public void dispose()
	{
		for (int i = 0; i < exportZipEntries.size(); i++)
		{
			ExportZipEntry exportZipEntry = exportZipEntries.get(i);
			exportZipEntry.dispose();
		}
	}

}


text:
Edgy provides a bidirectional value-semantic `Graph` type that can be used to form arbitrary graphs containing hashable nodes. Any `Hashable` type can be used as a node, such as an `Int` or a `String`. If two nodes have identity equality, then they represent the same exact node.
```swift
var codeGraph = Graph(nodes: ["Swift", "Haskell", "Rust", "C", "C++", "Objective-C", "Ruby"])
codeGraph.addEdge("Swift", "Haskell")
codeGraph.addEdge("Swift", "Objective-C")
codeGraph.addEdge("C", "Objective-C")
codeGraph.addEdge("C++", "C")
codeGraph.addEdge("C++", "Rust")
```

If you do desire to create multiple nodes storing the same value but with different identity, use the `UniqueNode` wrapper type which uses class identity.
```swift
let (a, b, c) = (UniqueNode(1), UniqueNode(1), UniqueNode(2))
var testGraph = Graph(nodes: [a, b, c])
testGraph.addEdge(b, c)
print(testGraph.connectedComponents.count) // -> 2 (since a & b are distinct nodes)
```

Traverse the object graph by following adjacent nodes.
```swift
for node in codeGraph.adjacentNodes("Swift") {
  print(node + " is pretty similiar to Swift")
}
```


text:
require 'test_helper'

class IntegrantsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @integrant = integrants(:one)
  end

  test "should get index" do
    get integrants_url
    assert_response :success
  end

  test "should get new" do
    get new_integrant_url
    assert_response :success
  end

  test "should create integrant" do
    assert_difference('Integrant.count') do
      post integrants_url, params: { integrant: { email: @integrant.email, lastName: @integrant.lastName, name: @integrant.name } }
    end

    assert_redirected_to integrant_url(Integrant.last)
  end

  test "should show integrant" do
    get integrant_url(@integrant)
    assert_response :success
  end

  test "should get edit" do
    get edit_integrant_url(@integrant)
    assert_response :success
  end

  test "should update integrant" do
    patch integrant_url(@integrant), params: { integrant: { email: @integrant.email, lastName: @integrant.lastName, name: @integrant.name } }
    assert_redirected_to integrant_url(@integrant)
  end

  test "should destroy integrant" do
    assert_difference('Integrant.count', -1) do
      delete integrant_url(@integrant)
    end

    assert_redirected_to integrants_url
  end
end


text:
Welcome, enter a headcount

    <form ng-submit='submit()'>

        How many people?
        <input type='number'
              class='form-control'
              id='howManyInput'
              name='howMany'
              placeholder='How Many'
              ng-model='how_many'
              required
              autofocus>

        What are your initials?
        <input type='text'
               class='form-control'
               name='initials'
               placeholder='Initials'
               ng-model='initials'
               required>

        When was the count taken?
        <datetime-picker-rounded picker-model='when' />

        <button type='submit'
               value='Submit'
               class='btn btn-primary col-md-2 col-sm-2 col-xs-12'
          >Submit</button>

    </form>

Recent Headcounts

        Date / Time
        Initials
        Count

        {{headcount.ts.format('M/D/YYYY h:mm A')}}
        {{headcount.initials}}
        {{headcount.how_many}}

    <button class="btn btn-default"
            ng-class="{disabled: headcounts.pages[0] == 1}"
            ng-click="setHeadcountPage(0)"
    ></button>
    <button class="btn btn-default"
            ng-class="{disabled: headcounts.page == 0}"
            ng-click="setHeadcountPage(headcounts.page-1)"
    ></button>
    <button ng-repeat="i in headcounts.pages"
            class="btn btn-default"
            ng-class="{active: headcounts.page == i-1}"
            ng-click="setHeadcountPage(i-1)"
      >{{ i }}</button>
    <button class="btn btn-default"
            ng-class="{disabled: headcounts.page == headcounts.total_pages-1}"
            ng-click="setHeadcountPage(headcounts.page+1)"
    ></button>
    <button class="btn btn-default"
            ng-class="{disabled: headcounts.pages[headcounts.pages.length-1] == headcounts.total_pages}"
            ng-click="setHeadcountPage(headcounts.total_pages-1)"
    ></button>


text:
#ifndef WebPageSerializer_h
#define WebPageSerializer_h

#include "../platform/WebCString.h"
#include "../platform/WebCommon.h"
#include "../platform/WebURL.h"
#include "WebFrame.h"

namespace blink {

class WebPageSerializerClient;
class WebString;
class WebView;
template <typename T> class WebVector;

// Get html data by serializing all frames of current page with lists
// which contain all resource links that have local copy.
class WebPageSerializer {
public:
    // Serializes the WebView contents to a MHTML representation.
    BLINK_EXPORT static WebCString serializeToMHTML(WebView*);

    // Similar to serializeToMHTML but uses binary encoding for the MHTML parts.
    // This results in a smaller MHTML file but it might not be supported by other browsers.
    BLINK_EXPORT static WebCString serializeToMHTMLUsingBinaryEncoding(WebView*);

    // IMPORTANT:
    // The API below is an older implementation of a pageserialization that
    // will be removed soon.

    // This function will serialize the specified frame to HTML data.
    // We have a data buffer to temporary saving generated html data. We will
    // sequentially call WebPageSeriazlierClient once the data buffer is full.
    //
    // Return false means if no data has been serialized (i.e. because
    // the target frame didn't have a valid url).
    //
    // The parameter frame specifies which frame need to be serialized.
    // The parameter client specifies the pointer of interface
    // WebPageSerializerClient providing a sink interface to receive the
    // individual chunks of data to be saved.
    // The parameter links contain original URLs of all saved links.
    // The parameter localPaths contain corresponding local file paths of all
    // saved links, which matched with vector:links one by one.
    // The parameter localDirectoryName is relative path of directory which
    // contain all saved auxiliary files included all sub frames and resources.
    BLINK_EXPORT static bool serialize(
        WebLocalFrame*,
        WebPageSerializerClient*,
        const WebVector<WebURL>& links,
        const WebVector<WebString>& localPaths,
        const WebString& localDirectoryName);

    // FIXME: The following are here for unit testing purposes. Consider
    // changing the unit tests instead.

    // Generate the META for charset declaration.
    BLINK_EXPORT static WebString generateMetaCharsetDeclaration(const WebString& charset);
    // Generate the MOTW declaration.
    BLINK_EXPORT static WebString generateMarkOfTheWebDeclaration(const WebURL&);
    // Generate the default base tag declaration.
    BLINK_EXPORT static WebString generateBaseTagDeclaration(const WebString& baseTarget);
};

} // namespace blink

#endif


text:
<!DOCTYPE html>

  {% include head.html %}

  <link href="/dist/language.css" rel="stylesheet">

{% include simple-nav.html %}

    {% include header.html %}

    {{ content }}

{% include footer.html %}


text:
<!DOCTYPE html>

    <title>Chapter 8 | The Go Ahead Boys and the Racing Motor-Boat | Ross Kay | Lit2Go ETC</title>
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/screenless.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/printless.css" type="text/css" media="print" title="no title" charset="utf-8">

          Lit2Go

<form action="http://etc.usf.edu/lit2go/search/"><input type="text" name="q" placeholder="Search" value=""></form>

Authors

Books

Genres

Collections

Readability

      The Go Ahead Boys and the Racing Motor-Boat

      by Ross Kay

      Chapter 8

        Additional Information

            Year Published:
            1916

            Language:
            English

            Country of Origin:
            United States of America

            Source:
            Kay, Ross. (1916). <The Go Ahead Boys and the Racing Motor-Boat. New York: Goldsmith.

            Readability:

                Flesch–Kincaid Level:
                5.2

            Word Count:
            1,987

            Genre:
            Adventure

            Keywords:
            life experiences

            ✎ Cite This

  Share
  |

Downloads

          Audio

          Passage PDF

Student Activity

            APA

            MLA

            Chicago

            Kay, R. (1916). Chapter 8. The Go Ahead Boys and the Racing Motor-Boat (Lit2Go Edition). Retrieved February 15, 2016, from http://etc.usf.edu/lit2go/138/the-go-ahead-boys-and-the-racing-motor-boat/2526/chapter-8/

            Kay, Ross. "Chapter 8." The Go Ahead Boys and the Racing Motor-Boat. Lit2Go Edition. 1916. Web. <http://etc.usf.edu/lit2go/138/the-go-ahead-boys-and-the-racing-motor-boat/2526/chapter-8/>. February 15, 2016.

            Ross Kay, "Chapter 8," The Go Ahead Boys and the Racing Motor-Boat, Lit2Go Edition, (1916), accessed February 15, 2016, http://etc.usf.edu/lit2go/138/the-go-ahead-boys-and-the-racing-motor-boat/2526/chapter-8/.

Back

Next

                  <audio controls style="width:99%;">
            <source src="http://etc.usf.edu/lit2go/audio/mp3/the-go-ahead-boys-and-the-racing-motor-boat-008-chapter-8.2526.mp3" type="audio/mpeg" />
                          <source src="http://etc.usf.edu/lit2go/audio/ogg/the-go-ahead-boys-and-the-racing-motor-boat-008-chapter-8.2526.ogg" type="audio/ogg" />
                        The embedded audio player requires a modern internet browser. You should visit Browse Happy and update your internet browser today!
          </audio>

	In response to Fred’s action there was a loud shout of protest from the men on board. Every one still was manifesting the effect of the drunken spree through which they had passed the preceding night. As yet, however, they had not offered any violence and although Fred’s heart was beating rapidly he resolutely stuck to his task and in a brief time the Black Growler darted forward like a thing alive.

	For a moment the uninvited passengers apparently were startled by the unexpected action of the young captain. They speedily recovered, however, from their surprise, and one of the men turning to the leader said, “My, ain’t she purty, Jim!”

	“She is that,” replied Jim promptly. “She looks better than she did when I took my last trip to Niag’ra. When I left my house on Fifth Avenoo I didn’t think she’d ever measure up to what she was that time, but she is goin’ one better. Yes, sir, she’s all that you say she is.”

	Still the men did not interfere with Fred in his management of the motor-boat. Apparently too they did not have any objection to the voyage. Indeed the Go Ahead boys already were aware of the fact that every one of their self-invited guests had brought a small bundle with him. They naturally inferred that these bundles contained most of the earthly possessions of their noisy passengers.

	“How is it, Jim!” called another of the men. “Isn’t it about time we had breakfast?”

	“That’s right,” spoke up another. “I’m hungry, too. Seems to me I would like one o’ them grape fruits.”

	“Grape fruits? You don’t know what they be,” retorted Jim.

	“You tell us what they be,” responded the man, unabashed by the rebuke of the leader.

	“Don’t you know?” retorted Jim scornfully. “Why grape fruit’s the stuff that grows on grape vines.”

	“Get out!” said the other one. “I guess I know enough about the country to know that grapes grow on grape vines.”

	“In course they do,” acknowledged Jim, “but this isn’t grapes, this is grape FRUIT. It takes a special vine to grow it.”

	“Does it grow right on the vine?”

	“Of course it does. What do you think, it grows under the ground like tomatoes?”

	“Tomatoes don’t grow under the ground,” spoke up another of the party. “It’s potatoes that grow under the ground.”

	“It’s all one,” retorted Jim glibly. “Potatoes and tomatoes. I knew one grew in the air and the other grew in the ground.”

	“What about the grape fruits, Jim?” demanded the first speaker.

	“Well, they grow on the vines. They are just like big yeller grapes. Many’s a time out on my country estate I have climbed the ladder and picked ‘em from the vines that grow so high they hid the sight of the street from the piazzy of my bungaloo.”

	“I’m wondering where you got this yacht, Jim,” inquired another.

	“Never mind how I got it as long as we have got it. That’s the main thing,” interrupted another one. “What I want to know, is about those grape fruits we’re talking about. How does it taste?”

	“Fine. Fine,” answered Jim promptly. Then turning to the boys he inquired, “Have you got anything on board to eat?”

	“You see that monemint up yonder,” interrupted another pointing to a tall granite shaft that could be seen in the distance. The entire party including the boys at once looked in the direction indicated and saw a beautiful memorial stone, although few of them were aware of what it commemorated.

	“Yes, that’s my granddad’s tombstone,” said one of the tramps.

	“I guess he must have been some man,” exclaimed one of his companions. “It’s a pity the rest of the family didn’t take after him.”

	“We did, but we didn’t want to hog the whole thing. We had to let some one else have a chance too.”

	Meanwhile the Black Growler was speeding swiftly over the waters of the Erie Canal. Fred was driving at high speed and as the boat sped forward he was keenly watching for the coming of a boat that might provide help for the Go Ahead boys in their predicament.

	Several canal-boats had been passed, but there was no one on board who appeared to be able to help.

	The unwelcome guests still talked noisily to one another, but in the main they ignored the boys and as yet had not offered any violence.

	“Who’s running this ‘ere boat, Jim?” suddenly spoke up one of the passengers. “I thought you said this was your yacht.”

	“I did say so,” answered Jim promptly. “I’m just taking out a pleasure party. Didn’t you never go to no picnic afore? I want you to be good, for we have got comp’ny on board. When you have got guests you have to be perlite whether you want to be or not.”

	Still the Black Growler was moving swiftly. The waters over which she was passing seethed and boiled as if they had been heated by unseen fires. Even Fred had lost a part of his alarm as he began to suspect that his uninvited passengers did not know how to manage the boat. If they did, it was difficult to understand why they had not yet driven the boys away and taken charge.

	There was another thought in Fred’s mind that was perplexing. He suspected that the supply of gasoline was running low. He had neglected to have the tank filled the preceding night, believing that he had a supply ample to carry them forward until they could obtain more. Suppose the motor-boat should stop? What would the men do? They might accuse him of deliberately stopping and in that event he was aware that there might be serious trouble. Indeed, he was still puzzled to understand why the men appeared to be so contented. If they had been workers on the canal, or had been employed by any of the boats why was it that they were free this morning? He was aware that the little city of Rome could not be far away.

	If once he should be able to bring the Black Growler safely within the borders of the city he was confident he would be able to rid himself speedily of the men, whose presence with every passing moment was becoming more difficult to bear.

	He looked eagerly ahead for signs of the city. He was unable to discover any, however, but his fears increased as he became more positive that his supply of gasoline was low. If only it would last a half-hour longer!

	On either side of the canal was a level stretch of country and near to the water no houses were to be seen. His friends had taken seats on the deck forward. In low tones they conversed among themselves, but Fred was too busy in his own task either to heed what they were saying or to join in their conversation.

	A few minutes later, after the speed of the boat had materially decreased, Fred said abruptly, “We have got to stop.”

	“What for?” demanded the leader, quickly rising as he spoke and turning toward the young pilot.

	“Our gasoline is gone.”

	“Look here, young fellow,” said the leader of the gang after he had silently glared at Fred a moment, “I don’t want you to try any of your games on us. We’re bad men. Now then, you keep this boat goin’,” he added threateningly.

	“I only wish I could do it,” said Fred.

	“Are you givin’ us straight goods when you say your gasoline is gone?”

	“I am.”

	“What are you goin’ to do?”

	“Nothing. That’s the trouble. You can’t do anything without gasoline. I am thinking of letting some of my passengers go ahead and get enough to carry us into the town. Do you know how far it is to Rome?”

	“Must be about three mile.”

	“That wouldn’t be very much of a walk,” said Fred glibly.

	For some unexplained reason his courage now had returned and he stood in less fear of his rough and noisy guests.

	“What are you goin’ to do?” again demanded the leader.

	“There isn’t anything I can do,” retorted Fred sharply, “unless some of you will go ahead and get some gasoline.”

	“That’s right, Jim,” spoke up one of his companions. “We’ll go and get his gasoline. Tell him to give us four dollars and we’ll get a good supply.”

	“That’s right,” spoke up Jim quickly. “We can’t get gasoline without some money.”

	“Oh, one of us will go along and pay the bills,” spoke up John, who up to this point had taken no part in the conversation.

	“How much money you got?”

	“I guess we have got just enough to buy fifteen gallons of gasoline.”

	“All right, then, give it to us and we’ll get the gasoline for you.”

	“I told you that we shan’t give you the money,” said John. “We’ll go with you. Perhaps we can get a ride on a canal-boat or something.”

	“You won’t save much time that way,” retorted Jim. “The only thing to do is to let us have the money and save yourselves a lot of trouble.”

	“We’re not going to give you any money,” said John quietly. “I told you that before. The thing for you to do is to clear out, every one of you if you don’t want to help.”

	to his companions John had been keeping a careful outlook on the canal behind them. In the distance he had seen a yacht approaching that he was confident was the Caledonia, which they had passed when first they had set forth on their voyage. He was confident also that the coming of the yacht, together with the number of men that comprised her crew, would be sufficient to overawe the half-dozen men that had forced their company upon the Go Ahead boys.

	“Yonder comes the Caledonia!” he exclaimed suddenly. “They will give us a lift as soon as they catch up with us.”

	Instantly the eyes of every one on board the Black Growler were turned toward the approaching yacht.

	Apparently the sight had markedly different effects. The Go Ahead boys were elated, but their passengers after a hasty glance and a few words spoken in low tones to one another, instantly seizing their bundles leaped ashore and ran swiftly toward the road which was not more than fifty yards distant.

Back

Next

            This collection of children's literature is a part of the Educational Technology Clearinghouse and is funded by various grants.

            Copyright © 2006—2016 by the Florida Center for Instructional Technology, College of Education, University of South Florida.

License

Credits

FAQ

Giving

This document was downloaded from Lit2Go, a free online collection of stories and poems in Mp3 (audiobook) format published by the Florida Center for Instructional Technology. For more information, including classroom activities, readability data, and original sources, please visit http://etc.usf.edu/lit2go/138/the-go-ahead-boys-and-the-racing-motor-boat/2526/chapter-8/.

Lit2Go: The Go Ahead Boys and the Racing Motor-Boat

Chapter 8


text:
package com.sksamuel.avro4s.record.encoder

import com.sksamuel.avro4s.{AvroSchema, Encoder, ImmutableRecord}
import org.apache.avro.util.Utf8
import org.scalatest.funsuite.AnyFunSuite
import org.scalatest.matchers.should.Matchers

class EitherEncoderTest extends AnyFunSuite with Matchers {

  test("generate union:T,U for Either[T,U] of primitives") {
    case class Test(either: Either[String, Double])
    val schema = AvroSchema[Test]
    Encoder[Test].encode(schema).apply(Test(Left("foo"))) shouldBe ImmutableRecord(AvroSchema[Test], Vector(new Utf8("foo")))
    Encoder[Test].encode(schema).apply(Test(Right(234.4D))) shouldBe ImmutableRecord(AvroSchema[Test], Vector(java.lang.Double.valueOf(234.4D)))
  }

  test("generate union:T,U for Either[T,U] of case classes") {
    case class Goo(s: String)
    case class Foo(b: Boolean)
    case class Test(either: Either[Goo, Foo])
    val schema = AvroSchema[Test]
    Encoder[Test].encode(schema).apply(Test(Left(Goo("zzz")))) shouldBe ImmutableRecord(AvroSchema[Test], Vector(ImmutableRecord(AvroSchema[Goo], Vector(new Utf8("zzz")))))
    Encoder[Test].encode(schema).apply(Test(Right(Foo(true)))) shouldBe ImmutableRecord(AvroSchema[Test], Vector(ImmutableRecord(AvroSchema[Foo], Vector(java.lang.Boolean.valueOf(true)))))
  }
}


text:
var Block = require('./lib/block/block.js');
var Divider = require('./lib/divider/divider.js');
var Text = require('./lib/text/text.js');
var Highlighter = require('./lib/highlighter/highlighter.js');
var RippleInk = require('./lib/rippleink/rippleink.js');
var Utils = require('./lib/utils/utils.js');
// var Styles = require('./lib/less/styles.js');

exports.Block = Block;
exports.Divider = Divider;
exports.Text = Text;
exports.Highlighter = Highlighter;
exports.RippleInk = RippleInk;
exports.Utils = Utils;
// exports.Styles = Styles;


text:
Ni Framework (NiFrame) - Version 1.0

Overview:

    NiFrame is a web application (or website) starter system.
    Simply install NiFrame to your web server and follow the installation wizard. The system is designed so
    that features can be added with as little as a new "driver" file or as many class, driver, and HTML
    files as needed. HTML is separated from PHP so HTML files can be combined to form new pages or
    "conditioned" to remove or add HTML as needed. Driver files can even be constructed or modified
    to work with FLASH style GUIs or AJAX(JQUERY) style HTML pages with very little effort. After installing
    NiFrame the following system features and functionality are available to you:

Proposed System and Functionality:

System Installer:

System Install Wizard ✓

System Files - Automatically installs required system files on your server. ✓

MySQL Data - Automatically builds system data tables and default values into your MySQL database. ✓

Configuration - Choose how to configure the System for specific needs. ⚠

Mod Selector - Choose which mods to install with the system. ⚠

System Un-Installer - Removes all NiFrame system files and database tables.⚒

Style (Template) System:

HTML File Merging - Combine HTML files to create different pages! ✓

Variable Injection - Change page data based on user and/or situation! ✓

Content Includes - Maintain a single content set or swap content while changing styles! ✓

Dynamic HTML Conditioning - Remove, Repeat and/or Nested Repeat HTML with dynamic values!! ✓

Automatic form detection and Input Validation for HTML5 inspired types on all browsers! ✓

Flash GUI Support - Use Flash as your user interface instead of an HTML template! ⚠

User System:

Session Handling & Data Security ✓

User Types(Groups)✓

User Type Based Permissions✓

User Statuses (Active, Banned, Misc...)✓

Registration System ✓

Basic Profiles ✓

Action Stalking (tracks what users do and when) ⚠

Phone SMS Fishing ⚠

User-Defined Attribute Support:

Custom Labels - Label attributes how you want to! ✓

Attribute Ranks - Adding a rank to an attribute allows you to choose where they show up! ✓

(ex: User Profile, Registration, Both, etc...)

Input Verification - Assign a verification type to your attribute/s for form inputs! ✓

Default Values - Assign default values to your attributes! ✓

Interface Design - Mod Devs, add user-defined attributes to any "thing" classes with ease! ✓

(A "thing" has attributes..items, users, etc...)

Inventory System ⚠:

Product Inventory

Product Display and Search

Service Inventory

Service Display and Search

Event System ⚠:

Event Calendar

Event Creation and Registration

User Availability Schedules

User Event Schedules

Event Support: Users, Items, Locations

Administrative Control Panel (ACP):

System Settings ✓

Default Time Zone ✓

Disable - Enable reCAPTCHA feature ✓

              Select - Deselect - Remove Styles ✓

(change entire website layout, look and content with 1 click!)

User Management: ✓

User Settings (Self-Edit) ✓

Search - Create - Edit - Remove Users ✓

Create - Edit - Remove Types(Groups) ✓

Create - Edit - Remove Type(Group) Permissions ✓

Create - Edit - Remove Statuses ✓

Add - Remove Permission Access by User Type ✓

Inventory Management ⚠

Event Management ⚠

Mod Support: ⚒

Search (local) Mod Packages ✓

Mod Package View ⚒

Mod Package Installer ✓

Mod Package Remover ⚒

Mod Package Updater ⚒

Programming Languages:  PHP v5, SQL, HTML5, CSS3, JavaScript

Server Platform:  Hosted Server Running: Apache, PHP, and MySQL

Tools Used: Notepad++,  FileZilla, phpMyAdmin, Adobe Photoshop, Windows 7

Browser Support: Internet Explorer, Fire Fox, Chrome


text:
class GeometryReducer
{
public:
	GeometryReducer(const double& epsilon) : epsilon(epsilon) {}

	void Reduce(std::vector<Point>& polygon) const;

private:
	static const std::vector<Point>::size_type sizeThreshold;
	const double epsilon;

	struct Vector3D
	{
		double x;
		double y;
		double z;
	};

	void ComputeLine(const Point& startPoint, const Point& endPoint, Vector3D& point, Vector3D& direction) const;
	double GetPerpendicularDistance(const Vector3D& point, const Vector3D& direction, const Point& testPoint) const;
	std::vector<Point> DoReduction(std::vector<Point> polygon) const;

	Vector3D GetWGS84(const double& latitude, const double& longitude) const;
};

#endif// GEOMETRY_REDUCER_H_


text:
var mongoose = require('mongoose');
var fs = require('fs');
// ***********************************************global constants
var db_conn_str = "mongodb://localhost:3456/datasets";

// ************************************************operations
var get_collection = function(name, mongoObj){
	var schema = mongoObj.Schema({
		"word" : String,
		"freq" : Number
	});
	var model = mongoObj.model(name, schema, name);
	// check if the model is not present in the db, if not create a new collection
	if(model == null)
		model = new mongoObj.model(name, schema);
	//console.log(model.collection)
	return model;
}
var update_collection = function(model, sentence){
	// description: parse the sentence word by word, update each word freq in the collection
	sentence = sentence.trim();
	sentence.split(' ').every(function(ele,idx,array){
		// *************************************************************** adding case insensitivity
		ele = ele.toLowerCase();
		// check if element is already present in the collection
		model.findOne({word: ele},function(err, data){
			if(err) console.error("Error while accessing collection");
			if(data == null){
				var lex = new model({
					"word" : ele,
					"freq" : 1
				});
				lex.save();
			}
			else {
				data["freq"] = data["freq"] + 1;
				data.save();
			}
		});
		return true;
	});

}
var readJsonFile = function(name){
	var file = readFileSync(name);
	if(file == null) {
		console.error("Error reading file");
		return;
	}

	var jfile = JSON.parse(file);
	if(jfile["data"]) return jfile["data"];
	else {
		console.error("invalid file format");
		return null;
	}

}
mongoose.connect(db_conn_str);
mongoose.connection.on('open',function(err){
	console.log("connection to mongo successful");
	var trainingdata = readJsonFile("filename");
	var model_pos = get_collection("tm_pos", mongoose);
	var model_neutral = get_collection("tm_neutral", mongoose);
	var model_neg = get_collection("tm_neg", mongoose);

	trainingdata.every(function(ele, idx, array){
		if(ele["value"] == "pos") update_collection(model_pos, ele);
		else if(ele["value"] == "neutral") update_collection(model_neutral, ele);
		else if(ele["value"] == "neg") update_collection(model_neg, ele);
		return true;
	});

	update_collection(model, "you have to get angry HULK");
});
mongoose.connection.on('error',function(err){
	console.error("connection to mongo failed");
});


text:
<?php

require_once('../../../require.php');
require_once('../../../class/fight/Fight.class.php');
require_once('../../../class/fight/Fighter.class.php');

require_once('../../../class/monster.class.php');
require_once('../../../class/skill.class.php');
require_once('../../../class/effect.class.php');

if(isset($_GET['fight_id']) && $_GET['fight_id'] != "undefined")
{
    $fight = new Fight($_GET['fight_id']);
    if($fight->isFightFinished())
    {
        echo $fight->getIsEnd();
        $fight->endTheFight();

    }

}


text:
namespace game {
namespace item {

	ArrowItem::ArrowItem() {
		name        = "Arrow";
		description = "A simple arrow.";
		value       = 1.0;
		symbol      = '/';
	}

	ArrowItem::~ArrowItem() {}

	void ArrowItem::onPickup( engine::actor::ActorBase * actor ) {
		return;
	}

	void ArrowItem::onInspect( engine::actor::ActorBase * actor ) {
		return;
	}

	void ArrowItem::onDrop( engine::actor::ActorBase * actor ) {
		return;
	}

}
}


text:
<?php namespace Lyubaev\XMLUtil\Exception;

/**
 * Domain exception
 */
class DomainException extends \DomainException
{
}


text:
package org.wso2.siddhi.doc.gen.commons.metadata;

import java.util.List;

/**
 * POJO for holding extension meta data
 */
public class ExtensionMetaData {
    private String name;
    private String namespace;
    private String description;
    private List<ParameterMetaData> parameters;
    private List<SystemParameterMetaData> systemParameters;
    private List<ReturnAttributeMetaData> returnAttributes;
    private List<ExampleMetaData> examples;

    public String getName() {
        return name;
    }

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

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<ParameterMetaData> getParameters() {
        return parameters;
    }

    public void setParameters(List<ParameterMetaData> parameters) {
        this.parameters = parameters;
    }

    public List<SystemParameterMetaData> getSystemParameters() {
        return systemParameters;
    }

    public void setSystemParameters(List<SystemParameterMetaData> systemParameters) {
        this.systemParameters = systemParameters;
    }

    public List<ReturnAttributeMetaData> getReturnAttributes() {
        return returnAttributes;
    }

    public void setReturnAttributes(List<ReturnAttributeMetaData> returnAttributes) {
        this.returnAttributes = returnAttributes;
    }

    public List<ExampleMetaData> getExamples() {
        return examples;
    }

    public void setExamples(List<ExampleMetaData> examples) {
        this.examples = examples;
    }
}


text:
import { environment } from '../../environments/environment';
const valuesEndpoint = `${environment.apiHost}/api/values`

export const getValues = async () => {
    var response = await fetch(valuesEndpoint)
    return await response.json()
}


text:
package org.fcrepo.importexport.integration;

import static org.apache.http.HttpStatus.SC_CREATED;
import static org.apache.http.HttpStatus.SC_NO_CONTENT;
import static org.apache.jena.graph.NodeFactory.createLiteral;
import static org.apache.jena.graph.NodeFactory.createURI;
import static org.apache.jena.rdf.model.ModelFactory.createDefaultModel;
import static org.apache.jena.rdf.model.ResourceFactory.createResource;
import static org.fcrepo.importexport.common.Config.DEFAULT_RDF_LANG;
import static org.fcrepo.importexport.common.FcrepoConstants.CONTAINS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.slf4j.LoggerFactory.getLogger;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URI;
import java.nio.charset.Charset;
import java.util.UUID;

import org.apache.jena.graph.Graph;
import org.fcrepo.client.FcrepoClient;
import org.fcrepo.client.FcrepoOperationFailedException;
import org.fcrepo.client.FcrepoResponse;
import org.fcrepo.importexport.common.Config;
import org.fcrepo.importexport.exporter.Exporter;
import org.fcrepo.importexport.importer.Importer;

import org.apache.commons.io.IOUtils;
import org.apache.jena.rdf.model.Model;
import org.junit.Test;
import org.slf4j.Logger;

/**
 * @author awoods
 * @since 2016-09-18
 */
public class ImporterIT extends AbstractResourceIT {

    private FcrepoClient client;
    private String[] predicates = new String[]{ CONTAINS.toString() };

    public ImporterIT() {
        super();
        client = clientBuilder.build();
    }

    @Test
    public void testImport() throws FcrepoOperationFailedException, IOException {
        final String exportPath = TARGET_DIR + "/" + UUID.randomUUID() + "/testPeartreeAmbiguity";
        final String parentTitle = "parent";
        final String childTitle = "child";
        final String binaryText = "binary";

        final URI parent = URI.create(serverAddress + UUID.randomUUID());
        final URI child = URI.create(parent.toString() + "/child");
        final URI binary = URI.create(child + "/binary");
        assertEquals(SC_CREATED, create(parent).getStatusCode());
        assertEquals(SC_CREATED, create(child).getStatusCode());
        assertEquals(SC_NO_CONTENT, client.patch(parent).body(insertTitle(parentTitle)).perform().getStatusCode());
        assertEquals(SC_NO_CONTENT, client.patch(child).body(insertTitle(childTitle)).perform().getStatusCode());
        assertEquals(SC_CREATED, client.put(binary).body(new ByteArrayInputStream(binaryText.getBytes("UTF-8")),
                "text/plain").perform().getStatusCode());

        // Run an export process
        final Config config = new Config();
        config.setMode("export");
        config.setBaseDirectory(exportPath);
        config.setIncludeBinaries(true);
        config.setPredicates(predicates);
        config.setRdfLanguage(DEFAULT_RDF_LANG);
        config.setResource(parent.toString());
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        final Exporter exporter = new Exporter(config, clientBuilder);
        exporter.run();

        // Verify
        resourceExists(parent);

        // Remove the resources
        removeAndReset(parent);

        // Run the import process
        config.setMode("import");

        final Importer importer = new Importer(config, clientBuilder);
        importer.run();

        // Verify
        assertHasTitle(parent, parentTitle);
        assertHasTitle(child, childTitle);
        assertEquals("Binary should have been imported!",
                binaryText, IOUtils.toString(client.get(binary).perform().getBody(), "UTF-8"));
    }

    @Test
    public void testCorruptedBinary() throws Exception {
        final URI sourceURI = URI.create(serverAddress);
        final URI binaryURI = URI.create(serverAddress + "/bin1");
        final String referencePath = TARGET_DIR + "/test-classes/sample/corrupted";
        System.out.println("Importing from " + referencePath);

        final Config config = new Config();
        config.setMode("import");
        config.setIncludeBinaries(true);
        config.setBaseDirectory(referencePath);
        config.setRdfLanguage(DEFAULT_RDF_LANG);
        config.setResource(serverAddress);
        config.setMap(new String[]{sourceURI.toString(), serverAddress});
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        // run import
        final Importer importer = new Importer(config, clientBuilder);
        importer.run();

        // verify that the corrupted binary failed to load
        assertFalse(resourceExists(binaryURI));
    }

    @Test
    public void testImportRelatedResources() throws Exception {
        final String sourceServerAddress = "http://localhost:8080/fcrepo/rest";
        final URI linkFrom = URI.create(serverAddress + "linkFrom");
        final URI linkTo = URI.create(serverAddress + "linkTo");
        final URI linkToFile1 = URI.create(serverAddress + "linkTo/file1");
        final String referencePath = TARGET_DIR + "/test-classes/sample/reference";
        logger().debug("Importing from {}", referencePath);

        final String[] providedPredicates = new String[] { "http://purl.org/dc/terms/relation" };
        final Config config = new Config();
        config.setMode("import");
        config.setIncludeBinaries(true);
        config.setBaseDirectory(referencePath);
        config.setPredicates(providedPredicates);
        config.setRdfLanguage(DEFAULT_RDF_LANG);
        config.setResource(linkFrom.toString());
        config.setMap(new String[]{sourceServerAddress, serverAddress});
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        // run import
        final Importer importer = new Importer(config, clientBuilder);
        importer.run();

        // verify the resources exist and link to each other
        assertTrue(resourceExists(linkFrom));
        assertTrue(resourceExists(linkTo));
        assertTrue(resourceExists(linkToFile1));
        assertTrue(resourceLinksTo(linkTo, linkFrom));
        assertTrue(resourceLinksTo(linkFrom, linkTo));

        // verify member resource content
        final FcrepoResponse response = clientBuilder.build().get(linkTo).accept("text/plain").perform();
        final String triples = IOUtils.toString(response.getBody(), Charset.defaultCharset());
        final String hasfileTriple = "<" + linkTo + "> <http://pcdm.org/models#hasFile> <" + linkToFile1 + "> .";
        assertEquals(1, count(triples, hasfileTriple));
    }

    @Test
    public void testReferences() throws Exception {
        final URI sourceURI = URI.create("http://localhost:8080/fcrepo/rest");
        final URI linkFrom = URI.create(serverAddress + "prod2/linkFrom");
        final URI linkTo = URI.create(serverAddress + "prod2/linkTo");
        final String referencePath = TARGET_DIR + "/test-classes/sample/reference";
        logger().debug("Importing from {}", referencePath);

        final Config config = new Config();
        config.setMode("import");
        config.setIncludeBinaries(true);
        config.setBaseDirectory(referencePath);
        config.setPredicates(predicates);
        config.setRdfLanguage(DEFAULT_RDF_LANG);
        config.setResource(serverAddress);
        config.setMap(new String[]{sourceURI.toString(), serverAddress + "prod2/"});
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        // run import
        final Importer importer = new Importer(config, clientBuilder);
        importer.run();

        // verify the resources exist and link to each other
        assertTrue(resourceExists(linkFrom));
        assertTrue(resourceExists(linkTo));
        assertTrue(resourceLinksTo(linkTo, linkFrom));
        assertTrue(resourceLinksTo(linkFrom, linkTo));
    }

    @Test
    public void testImportContainer() throws Exception {
        // import test-indirect

        final URI sourceURI = URI.create("http://localhost:8080/fcrepo/rest");
        final URI parentURI = URI.create(serverAddress + "indirect/1");
        final URI memberURI = URI.create(serverAddress + "indirect/2");
        final String indirectPath = TARGET_DIR + "/test-classes/sample/indirect";

        final Config config = new Config();
        config.setMode("import");
        config.setBaseDirectory(indirectPath);
        config.setPredicates(predicates);
        config.setRdfLanguage(DEFAULT_RDF_LANG);
        config.setResource(serverAddress);
        config.setMap(new String[]{sourceURI.toString(), serverAddress});
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        // run import
        final Importer importer = new Importer(config, clientBuilder);
        importer.run();

        // verify one title and one hasMember
        final FcrepoResponse response = clientBuilder.build().get(parentURI).accept("application/n-triples").perform();
        final Model model = createDefaultModel();
        model.read(response.getBody(), "", "N3");
        response.close();
        final Graph graph = model.getGraph();
        assertTrue("DC title should exist. \n" + graph.toString(), graph.contains(createURI(String.valueOf(parentURI)),
                createURI("http://purl.org/dc/terms/title"), createLiteral("foo")));
        assertTrue("Membership triple should exist.", graph.contains(createURI(String.valueOf(parentURI)),
                createURI("http://pcdm.org/models#hasMember"), createURI(String.valueOf(memberURI))));
    }

    @Test
    public void testImportMapped() throws Exception {
        final URI sourceURI = URI.create("http://localhost:8080/rest/dev/asdf");
        final URI resourceURI = URI.create(serverAddress + "prod/asdf");

        final Config config = new Config();
        config.setMode("import");
        config.setBaseDirectory(TARGET_DIR + "/test-classes/sample/mapped");
        config.setResource(resourceURI.toString());
        config.setMap(new String[]{sourceURI.toString(), serverAddress + "prod/asdf"});
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        // run import
        final Importer importer = new Importer(config, clientBuilder);
        importer.run();

        // verify one title and one hasMember
        assertTrue(resourceExists(resourceURI));
    }

    @Test
    public void testImportMappedTrailingSlash() throws Exception {
        final URI sourceURI = URI.create("http://localhost:8080/rest/dev/");
        final URI resourceURI = URI.create(serverAddress + "prod2/");
        final URI childURI = URI.create(serverAddress + "prod2/asdf/");

        final Config config = new Config();
        config.setMode("import");
        config.setBaseDirectory(TARGET_DIR + "/test-classes/sample/mapped");
        config.setResource(childURI.toString());
        config.setMap(new String[]{sourceURI.toString(), resourceURI.toString()});
        config.setUsername(USERNAME);
        config.setPassword(PASSWORD);

        // run import
        final Importer importer = new Importer(config, clientBuilder);
        importer.run();

        // verify one title and one hasMember
        assertTrue(resourceExists(childURI));
    }

    @Test
    public void testRepositoryRoot() throws Exception {
        final URI rest = URI.create(serverAddress);
        final URI restFoo = URI.create(serverAddress + "foo");
        final URI restFooBar = URI.create(serverAddress + "foo/bar");
        final URI root = URI.create(serverAddress.substring(0, serverAddress.length() - 1));

        final Config config = new Config();
        config.setMode("import");
        final Importer importer = new Importer(config, clientBuilder);

        assertEquals(root, importer.findRepositoryRoot(rest));
        assertEquals(root, importer.findRepositoryRoot(restFoo));
        assertEquals(root, importer.findRepositoryRoot(restFooBar));
    }

    private int count(final String triples, final String triple) {
        int count = 0;
        final String[] arr = triples.split("\\n");
        for (int i = 0; i < arr.length; i++) {
            if (triple.equals(arr[i])) {
                count++;
            }
        }
        return count;
    }

    private boolean resourceExists(final URI uri) throws FcrepoOperationFailedException {
        final FcrepoResponse response = clientBuilder.build().head(uri).perform();
        return response.getStatusCode() == 200;
    }

    private boolean resourceLinksTo(final URI linkFrom, final URI linkTo) throws FcrepoOperationFailedException {
        final FcrepoResponse response = clientBuilder.build().get(linkFrom).perform();
        final Model model = createDefaultModel().read(response.getBody(), null, "text/turtle");
        return model.contains(createResource(linkFrom.toString()), null, createResource(linkTo.toString()));
    }

    @Override
    protected Logger logger() {
        return getLogger(ImporterIT.class);
    }

}


text:
require 'test_helper'

module Tire

  class ActiveRecordSearchableIntegrationTest < Test::Unit::TestCase
    include Test::Integration

    def setup
      super
      ActiveRecord::Base.establish_connection( :adapter => 'sqlite3', :database => ":memory:" )

      ActiveRecord::Migration.verbose = false
      ActiveRecord::Schema.define(:version => 1) do
        create_table :active_record_articles do |t|
          t.string   :title
          t.datetime :created_at, :default => 'NOW()'
        end
        create_table :active_record_comments do |t|
          t.string     :author
          t.text       :body
          t.references :article
          t.timestamps
        end
        create_table :active_record_stats do |t|
          t.integer    :pageviews
          t.string     :period
          t.references :article
        end
        create_table :active_record_class_with_tire_methods do |t|
          t.string     :title
        end
        create_table :active_record_class_with_dynamic_index_names do |t|
          t.string     :title
        end
      end
    end

    context "ActiveRecord integration" do

      setup do
        ActiveRecordArticle.destroy_all
        Tire.index('active_record_articles').delete

        load File.expand_path('../../models/active_record_models.rb', __FILE__)
      end

      teardown do
        ActiveRecordArticle.destroy_all
        Tire.index('active_record_articles').delete
      end

      should "configure mapping" do
         assert_equal 'snowball', ActiveRecordArticle.mapping[:title][:analyzer]
         assert_equal 10, ActiveRecordArticle.mapping[:title][:boost]

         assert_equal 'snowball', ActiveRecordArticle.index.mapping['active_record_article']['properties']['title']['analyzer']
      end

      should "save document into index on save and find it" do
        a = ActiveRecordArticle.new :title => 'Test'
        a.save!
        id = a.id

        a.index.refresh

        results = ActiveRecordArticle.search 'test'

        assert       results.any?
        assert_equal 1, results.count

        assert_instance_of Results::Item, results.first
        assert_not_nil results.first.id
        assert_equal   id.to_s, results.first.id.to_s
        assert         results.first.persisted?, "Record should be persisted"
        assert_not_nil results.first._score
        assert_equal   'Test', results.first.title
      end

      should "raise exception on invalid query" do
        ActiveRecordArticle.create! :title => 'Test'

        assert_raise Search::SearchRequestFailed do
          ActiveRecordArticle.search '[x'
        end
      end

      context "with eager loading" do
        setup do
          ActiveRecordArticle.destroy_all
          5.times { |n| ActiveRecordArticle.create! :title => "Test #{n+1}" }
          ActiveRecordArticle.index.refresh
        end

        should "load records on query search" do
          results = ActiveRecordArticle.search '"Test 1"', :load => true

          assert       results.any?
          assert_equal ActiveRecordArticle.find(1), results.first
        end

        should "load records on block search" do
          results = ActiveRecordArticle.search :load => true do
            query { string '"Test 1"' }
          end

          assert_equal ActiveRecordArticle.find(1), results.first
        end

        should "load records with options on query search" do
          assert_equal ActiveRecordArticle.find(['1'], :include => 'comments').first,
                       ActiveRecordArticle.search('"Test 1"',
                                                  :load => { :include => 'comments' }).results.first
        end

        should "return empty collection for nonmatching query" do
          assert_nothing_raised do
            results = ActiveRecordArticle.search :load => true do
              query { string '"Hic Sunt Leones"' }
            end
            assert_equal 0, results.size
            assert ! results.any?
          end
        end
      end

      should "remove document from index on destroy" do
        a = ActiveRecordArticle.new :title => 'Test remove...'
        a.save!
        assert_equal 1, ActiveRecordArticle.count

        a.destroy
        assert_equal 0, ActiveRecordArticle.all.size

        a.index.refresh
        results = ActiveRecordArticle.search 'test'
        assert_equal 0, results.count
      end

      should "return documents with scores" do
        ActiveRecordArticle.create! :title => 'foo'
        ActiveRecordArticle.create! :title => 'bar'

        ActiveRecordArticle.index.refresh
        results = ActiveRecordArticle.search 'foo OR bar^100'
        assert_equal 2, results.count

        assert_equal 'bar', results.first.title
      end

      context "with pagination" do
        setup do
          1.upto(9) { |number| ActiveRecordArticle.create :title => "Test#{number}" }
          ActiveRecordArticle.index.refresh
        end

        context "and parameter searches" do

          should "find first page with five results" do
            results = ActiveRecordArticle.search 'test*', :sort => 'title', :per_page => 5, :page => 1
            assert_equal 5, results.size

            # WillPaginate
            #
            assert_equal 2, results.total_pages
            assert_equal 1, results.current_page
            assert_equal nil, results.previous_page
            assert_equal 2, results.next_page

            # Kaminari
            #
            assert_equal 5, results.limit_value
            assert_equal 9, results.total_count
            assert_equal 2, results.num_pages
            assert_equal 0, results.offset_value

            assert_equal 'Test1', results.first.title
          end

          should "find next page with five results" do
            results = ActiveRecordArticle.search 'test*', :sort => 'title', :per_page => 5, :page => 2
            assert_equal 4, results.size

            assert_equal 2, results.total_pages
            assert_equal 2, results.current_page
            assert_equal 1, results.previous_page
            assert_equal nil, results.next_page

            #kaminari
            assert_equal 5, results.limit_value
            assert_equal 9, results.total_count
            assert_equal 2, results.num_pages
            assert_equal 5, results.offset_value

            assert_equal 'Test6', results.first.title
          end

          should "find not find missing page" do
            results = ActiveRecordArticle.search 'test*', :sort => 'title', :per_page => 5, :page => 3
            assert_equal 0, results.size

            assert_equal 2, results.total_pages
            assert_equal 3, results.current_page
            assert_equal 2, results.previous_page
            assert_equal nil, results.next_page

            #kaminari
            assert_equal 5, results.limit_value
            assert_equal 9, results.total_count
            assert_equal 2, results.num_pages
            assert_equal 10, results.offset_value

            assert_nil results.first
          end

        end

        context "and block searches" do
          setup { @q = 'test*' }

          should "find first page with five results" do
            results = ActiveRecordArticle.search do |search|
              search.query { |query| query.string @q }
              search.sort  { by :title }
              search.from 0
              search.size 5
            end
            assert_equal 5, results.size

            assert_equal 2, results.total_pages
            assert_equal 1, results.current_page
            assert_equal nil, results.previous_page
            assert_equal 2, results.next_page

            assert_equal 'Test1', results.first.title
          end

          should "find next page with five results" do
            results = ActiveRecordArticle.search do |search|
              search.query { |query| query.string @q }
              search.sort  { by :title }
              search.from 5
              search.size 5
            end
            assert_equal 4, results.size

            assert_equal 2, results.total_pages
            assert_equal 2, results.current_page
            assert_equal 1, results.previous_page
            assert_equal nil, results.next_page

            assert_equal 'Test6', results.first.title
          end

          should "not find a missing page" do
            results = ActiveRecordArticle.search do |search|
              search.query { |query| query.string @q }
              search.sort  { by :title }
              search.from 10
              search.size 5
            end
            assert_equal 0, results.size

            assert_equal 2, results.total_pages
            assert_equal 3, results.current_page
            assert_equal 2, results.previous_page
            assert_equal nil, results.next_page

            assert_nil results.first
          end

        end

      end

      context "with proxy" do

        should "allow access to Tire instance methods" do
          a = ActiveRecordClassWithTireMethods.create :title => 'One'
          assert_equal "THIS IS MY INDEX!", a.index
          assert_instance_of Tire::Index, a.tire.index
          assert a.tire.index.exists?, "Index should exist"
        end

        should "allow access to Tire class methods" do
          class ::ActiveRecordClassWithTireMethods < ActiveRecord::Base
            def self.search(*)
              "THIS IS MY SEARCH!"
            end
          end

          ActiveRecordClassWithTireMethods.create :title => 'One'
          ActiveRecordClassWithTireMethods.tire.index.refresh

          assert_equal "THIS IS MY SEARCH!", ActiveRecordClassWithTireMethods.search

          results = ActiveRecordClassWithTireMethods.tire.search 'one'

          assert_equal 'One', results.first.title
        end

      end

      context "with dynamic index name" do
        setup do
          @a = ActiveRecordClassWithDynamicIndexName.create! :title => 'Test'
          @a.index.refresh
        end

        should "search in proper index" do
          assert_equal 'dynamic_index', ActiveRecordClassWithDynamicIndexName.index.name
          assert_equal 'dynamic_index', @a.index.name

          results = ActiveRecordClassWithDynamicIndexName.search 'test'
          assert_equal 'dynamic_index', results.first._index
        end
      end

      context "within Rails" do

        setup do
          module ::Rails; end

          a = ActiveRecordArticle.new :title => 'Test'
          a.comments.build :author => 'fool', :body => 'Works!'
          a.stats.build    :pageviews  => 12, :period => '2011-08'
          a.save!
          @id = a.id.to_s

          a.index.refresh
          @item = ActiveRecordArticle.search('test').first
        end

        should "have access to indexed properties" do
          assert_equal 'Test', @item.title
          assert_equal 'fool', @item.comments.first.author
          assert_equal 12,     @item.stats.first.pageviews
        end

        should "load the underlying models" do
          assert_instance_of Results::Item, @item
          assert_instance_of ActiveRecordArticle, @item.load
          assert_equal      'Test', @item.load.title

          assert_instance_of Results::Item, @item.comments.first
          assert_instance_of ActiveRecordComment, @item.comments.first.load
          assert_equal      'fool', @item.comments.first.load.author
        end

        should "load the underlying model with options" do
          ActiveRecordArticle.expects(:find).with(@id, :include => 'comments')
          @item.load(:include => 'comments')
        end

      end

      context "with multiple class instances in one index" do
         setup do
           ActiveRecord::Schema.define do
             create_table(:active_record_assets)    { |t| t.string :title, :timestamp }
             create_table(:active_record_model_one) { |t| t.string :title, :timestamp }
             create_table(:active_record_model_two) { |t| t.string :title, :timestamp }
           end

           ActiveRecordModelOne.create :title => 'Title One', timestamp: Time.now.to_i
           ActiveRecordModelTwo.create :title => 'Title Two', timestamp: Time.now.to_i
           ActiveRecordModelOne.tire.index.refresh
           ActiveRecordModelTwo.tire.index.refresh

           ActiveRecordVideo.create! :title => 'Title One', timestamp: Time.now.to_i
           ActiveRecordPhoto.create! :title => 'Title Two', timestamp: Time.now.to_i
           ActiveRecordAsset.tire.index.refresh
         end

         teardown do
           ActiveRecordModelOne.destroy_all
           ActiveRecordModelTwo.destroy_all
           ActiveRecordModelOne.tire.index.delete
           ActiveRecordModelTwo.tire.index.delete

           ActiveRecordAsset.destroy_all
           ActiveRecordAsset.tire.index.delete
           ActiveRecordModelOne.destroy_all
         end

         should "eagerly load instances of multiple classes, from multiple indices" do
           s = Tire.search ['active_record_model_one', 'active_record_model_two'], :load => true do
             query { string 'title' }
             sort  { by :timestamp }
           end

           # puts s.results[0].inspect

           assert_equal 2, s.results.length
           assert_instance_of ActiveRecordModelOne, s.results[0]
           assert_instance_of ActiveRecordModelTwo, s.results[1]
         end

         should "eagerly load all STI descendant records" do
           s = Tire.search('active_record_assets', :load => true) do
             query { string 'title' }
             sort  { by :timestamp }
           end

           assert_equal 2, s.results.length
           assert_instance_of ActiveRecordVideo,  s.results[0]
           assert_instance_of ActiveRecordPhoto,  s.results[1]
         end
      end

      context "with namespaced models" do
        setup do
           ActiveRecord::Schema.define { create_table(:active_record_namespace_my_models) { |t| t.string :title, :timestamp } }

           ActiveRecordNamespace::MyModel.create :title => 'Test'
           ActiveRecordNamespace::MyModel.tire.index.refresh
        end

        teardown do
           ActiveRecordNamespace::MyModel.destroy_all
           ActiveRecordNamespace::MyModel.tire.index.delete
        end

        should "save document into index on save and find it" do
          results = ActiveRecordNamespace::MyModel.search 'test'

          assert       results.any?, "No results returned: #{results.inspect}"
          assert_equal 1, results.count

          assert_instance_of Results::Item, results.first
        end

        should "eagerly load the records from returned hits" do
          results = ActiveRecordNamespace::MyModel.search 'test', :load => true

          assert             results.any?, "No results returned: #{results.inspect}"
          assert_instance_of ActiveRecordNamespace::MyModel, results.first
          assert_equal       ActiveRecordNamespace::MyModel.find(1), results.first
        end

      end
    end

  end

end


text:
namespace webkit_media {

// Generates WebURLErrors and WebURLResponses suitable for testing purposes.
class TestResponseGenerator {
 public:
  enum Flags {
    kNormal = 0,
    kNoAcceptRanges = 1 << 0,   // Don't include Accept-Ranges in 206 response.
    kNoContentRange = 1 << 1,   // Don't include Content-Range in 206 response.
    kNoContentLength = 1 << 2,  // Don't include Content-Length in 206 response.
    kNoContentRangeInstanceSize = 1 << 3,  // Content-Range: N-M/* in 206.
  };

  // Build an HTTP response generator for the given URL. |content_length| is
  // used to generate Content-Length and Content-Range headers.
  TestResponseGenerator(const GURL& gurl, int64 content_length);

  // Generates a WebURLError object.
  WebKit::WebURLError GenerateError();

  // Generates a regular HTTP 200 response.
  WebKit::WebURLResponse Generate200();

  // Generates a regular HTTP 206 response starting from |first_byte_offset|
  // until the end of the resource.
  WebKit::WebURLResponse Generate206(int64 first_byte_offset);

  // Generates a custom HTTP 206 response starting from |first_byte_offset|
  // until the end of the resource. You can tweak what gets included in the
  // headers via |flags|.
  WebKit::WebURLResponse Generate206(int64 first_byte_offset, Flags flags);

  // Generates a regular HTTP 404 response.
  WebKit::WebURLResponse Generate404();

  // Generates a file:// response starting from |first_byte_offset| until the
  // end of the resource.
  //
  // If |first_byte_offset| is negative a response containing no content length
  // will be returned.
  WebKit::WebURLResponse GenerateFileResponse(int64 first_byte_offset);

  int64 content_length() { return content_length_; }

 private:
  GURL gurl_;
  int64 content_length_;

  DISALLOW_COPY_AND_ASSIGN(TestResponseGenerator);
};

}  // namespace webkit_media

#endif  // WEBKIT_RENDERER_MEDIA_TEST_RESPONSE_GENERATOR_H_


text:
using System;
using System.Windows;
using System.Collections.Generic;

namespace Chapter13
{
    public static class Shapes
    {
        private static readonly List<Circle> circles = new List<Circle> {
            new Circle(new Point(0, 0), 15),
            new Circle(new Point(10, 5), 20),
        };

        private static readonly List<Square> squares = new List<Square> {
            new Square(new Point(5, 10), 5),
            new Square(new Point(-10, 0), 2)
        };

        public static List<Circle> Circles { get { return circles; } }
        public static List<Square> Squares { get { return squares; } }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Tree of Life Massage. About</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Arvo' rel='stylesheet' type='text/css'>

Home

About us

Services

Contact

                        Book Now

About Natalia

425-466-7748

About Evguenia

408-691-7999

About Julia

408-505-3674

Natalia Novoselova

Specializing in Baby Massage. Also proficient in Therapeutic Massage.

Call, text, email, or use online booking to schedule your treatment:

                        425-466-7748

                        natalia@treeoflife-massage.com

                        Book online

About Natalia:

                    Natalia graduated from Bellevue Massage School in Washington, earning massage license shortly after.
                    She started her career as a massage practitioner at chiropractor office in Bellevue, WA.

                    Natalia offers a wide selection of modalities of massage therapy: Swedish, Relaxing, Deep Tissue,
                    Trigger Point release, Myofascial Release, Baby massage.

                    She is continually amazed of the body's response to touch. She uses a multiple massage techniques to
                    facilitate a client's restoration, helping relieve chronic pain and stiffness, relaxing a stressed
                    nervous system.

                    She has an affinity for helping others and living a healthy life. Natalia found that the power of
                    touch from massage is incredible way to aid others towards better health, and decided to follow this
                    path.
                    With focused touch and energy a person's body will begin the process of healing.

                    She believes that patients deserve expert level, as well as a comfortable relationship with their
                    massage therapist mutual trust and respect. Her passion for massage improving patient's lives
                    enables her to approach each day with the enthusiasm and drive to deliver the utmost quality care.
                    She is thrilled to use this knowledge to best serve her patients.

                    Natalia earned a Certified Massage Therapist ("CMT") license from California Massage Therapy Council (CMTC).
                    She is also a member of American Massage Therapy Association(AMTA).

Evguenia Razinkova

Abdominal Massage, Lymphatic Drainage, Thai Massage, Gua Sha, Cupping

                        408-691-7999

                        jenia@treeoflife-massage.com

About Evguenia:

                    Jenia began her practice in 2010.

                    Her education includes Lymphatic Drainage, Visceral Manipulation, Craniosacral Therapy and Thai
                    Massage.

                    She received her body work education and practical knowledge in the US, Thailand and Russia.
                    The Listening Technique she uses teaches the ability to feel what in the body is asking for healing.
                    Different traditional medicines and treatments such as Gua Sha, Cupping, Cupping massage and Honey
                    massage have been in use for many centuries.

                    A combination of diverse techniques Jenia has learned enable her to provide a fuller experience to
                    her clients. It allows her to draw on her knowledge to find the best treatment in each individual
                    case.

                    Jenia believes in the body's innate ability to heal and her role is to support and help facilitate
                    healing.

                    She is currently studying Medical Qi Gong.

                    Besides dedicating time to her practice and family, Jenia enjoys Yoga, Thai Chi, hiking, studying
                    piano, petting her cat and recharging in nature.

Julia Korobkova

CranioSacral Therapy, Deep Tissue, Hot Stone, Prenatal, Swedish Massage, Trigger Point Therapy

                        408-505-3674

                        julia@treeoflife-massage.com

About Julia:

                    Julia received her massage education at De Anza college in Cupertino with 900+ hours of training.
                    She has worked as a massage therapist at Elements Therapeutic Massage and De Anza College Clinic.
                    Julia completed her training programs from Upledger Institute for CranioSacral Therapy and
                    Somato-Emotional Release.

                    Her philosophy on healing is to take her clients to their most relaxed state, to rejuvenate their
                    soul, heart, mind and body.
                    She beliefs in full-fledged healing from head to toe, to allow the life force to flow through the
                    natural meridians of the body.
                    In her spare time, Julia enjoys yoga, traveling, family time, and all things related to the ocean.

Check out Tree of Life Massage on Yelp

        © All rights reserved by Tree of Life Massage


text:
require_relative 'common'

module Saltrb
  module Archive
    BASE="archive"
    funcs = [ :gunzip, :gzip, :rar, :tar, :unrar, :unzip, :zip ]

    funcs.each do |name|
      define_singleton_method "#{name}", ->(target, command, timeout = Saltrb::DEFAULT_TIMEOUT) {
        return Saltrb.runner("#{name}", target, self::BASE, command, timeout)
      }
    end
  end
end


text:
/*
---
name: Fx.ProgressBar

description: Fx.ProgressBar

requires: [Core/Fx.Transitions, Core/Fx, Core/Class]

provides: [Fx.ProgressBar]

version: 1.1

license: MIT License

author: Harald Kirschner <http://digitarald.de>
...
*/

Fx.ProgressBar = new Class({

  Extends: Fx,

  options: {
    text: null,
    url: null,
    transition: Fx.Transitions.Circ.easeOut,
    fit: true,
    link: 'cancel'
  },

  initialize: function(element, options) {
    this.element = document.id(element);
    this.parent(options);

    var url = this.options.url;
    if (url) {
      this.element.setStyles({
        'background-image': 'url(' + url + ')',
        'background-repeat': 'no-repeat'
      });
    }

    if (this.options.fit) {
      url = url || this.element.getStyle('background-image').replace(/^url\(["']?|["']?\)$/g, '');
      if (url) {
        var fill = new Image();
        fill.onload = function() {
          this.fill = fill.width;
          fill = fill.onload = null;
          this.set(this.now || 0);
        }.bind(this);
        fill.src = url;
        if (!this.fill && fill.width) fill.onload();
      }
    } else {
      this.set(0);
    }
  },

  start: function(to, total) {
    return this.parent(this.now, (arguments.length == 1 || !total) ? to.limit(0, 100) : to / total * 100);
  },

  set: function(to) {
    this.now = to;
    var css = (this.fill)
      ? (((this.fill / -2) + (to / 100) * (this.element.width || 1) || 0).round() + 'px')
      : ((100 - to) + '%');

    this.element.setStyle('backgroundPosition', css + ' 0px').title = Math.round(to) + '%';

    var text = document.id(this.options.text);
    if (text) text.set('text', Math.round(to) + '%');

    return this;
  }

});


text:
package models

// Project represents a project and its sub projects
type Project struct {
	HasID
	Name        string
	Description string
	Parent      ID
	Tiers       [][]ID
	Addresses   []string
}


text:
using Dapper;
using GE.WebUI.Models;
using GE.WebUI.ViewModels;
using System.Data.SqlClient;
using System;
using System.Linq;
using SX.WebCore;
using System.Text;
using SX.WebCore.MvcApplication;
using SX.WebCore.SxProviders;
using static SX.WebCore.HtmlHelpers.SxExtantions;
using SX.WebCore.ViewModels;

namespace GE.WebUI.Infrastructure.Repositories
{
    public sealed class RepoHumor : RepoMaterial<Humor, VMHumor>
    {
        public RepoHumor() : base(SxMvcApplication.ModelCoreTypeProvider[nameof(Humor)]) { }

        public override VMHumor[] Read(SxFilter filter)
        {
            var sb = new StringBuilder();
            sb.Append(SxQueryProvider.GetSelectString(new string[] {
                "dm.*",
                filter.WithComments.HasValue && filter.WithComments==true?"(SELECT COUNT(1) FROM D_COMMENT AS dc WHERE dc.MaterialId=dm.Id AND dc.ModelCoreType=dm.ModelCoreType) AS CommentsCount":null,
                "dmc.*",
                "anu.*",
                "dp.Id", "dp.Width", "dp.Height",
                "dst.*"
            }));
            sb.Append(" FROM DV_MATERIAL AS dm ");
            sb.Append(" LEFT JOIN D_MATERIAL_CATEGORY AS dmc ON dmc.Id = dm.CategoryId ");
            sb.Append(" LEFT JOIN D_USER AS anu ON anu.Id = dm.UserId ");
            sb.Append(" LEFT JOIN D_PICTURE AS dp ON dp.Id = dm.FrontPictureId ");
            sb.Append(" LEFT JOIN D_SEO_TAGS AS dst ON (dst.ModelCoreType=dm.ModelCoreType AND dst.MaterialId=dm.Id AND dst.MaterialId IS NOT NULL) ");

            object param = null;
            var gws = GetMaterialsWhereString(filter, out param);
            sb.Append(gws);

            var defaultOrder = new SxOrderItem { FieldName = "DateCreate", Direction = SortDirection.Desc };
            sb.Append(SxQueryProvider.GetOrderString(defaultOrder, filter.Order, new System.Collections.Generic.Dictionary<string, string> {
                { "DateCreate", "dm.[DateCreate]"},
                { "Title","dm.[Title]"}
            }));

            sb.AppendFormat(" OFFSET {0} ROWS FETCH NEXT {1} ROWS ONLY", filter.PagerInfo.SkipCount, filter.PagerInfo.PageSize);

            //count
            var sbCount = new StringBuilder();
            sbCount.Append("SELECT COUNT(1) FROM DV_MATERIAL AS dm ");
            sbCount.Append(gws);

            using (var connection = new SqlConnection(ConnectionString))
            {
                filter.PagerInfo.TotalItems = connection.Query<int>(sbCount.ToString(), param: param).SingleOrDefault();
                var data = connection.Query<VMHumor, SxVMMaterialCategory, SxVMAppUser, SxVMPicture, SxVMSeoTags, VMHumor>(sb.ToString(), (m, c, u, p, st) =>
                {
                    m.Category = c;
                    m.User = u;
                    m.FrontPicture = p;
                    m.SeoTags = st;
                    return m;
                }, param: param, splitOn: "Id").ToArray();

                if (filter.WidthVideos == true && data.Any())
                    FillMaterialsVideo(connection, ref data);

                return data;
            }
        }
        private static string GetMaterialsWhereString(SxFilter filter, out object param)
        {
            param = null;
            var query = new StringBuilder();
            query.Append(" WHERE (dm.Title LIKE '%'+@title+'%' OR @title IS NULL) ");
            query.Append(" AND (dm.Foreword LIKE '%'+@fwd+'%' OR @fwd IS NULL) ");
            query.Append(" AND (dm.CategoryId LIKE '%'+@cat+'%' OR @cat IS NULL) ");
            if (filter.OnlyShow.HasValue && filter.OnlyShow == true)
                query.Append(" AND (dm.Show=@show AND dm.DateOfPublication<=GETDATE()) ");
            query.Append(" AND (dm.ModelCoreType=@mct) ");

            string title = filter.WhereExpressionObject?.Title;
            string fwd = filter.WhereExpressionObject?.Foreword;
            var cat = filter?.CategoryId;

            param = new
            {
                title = title,
                fwd = fwd,
                cat = cat,
                mct = SxMvcApplication.ModelCoreTypeProvider[nameof(Humor)],
                show = filter.OnlyShow == true ? true : (bool?)null
            };

            return query.ToString();
        }

        public override void Delete(Humor model)
        {
            const string query = "DELETE FROM D_HUMOR WHERE Id=@mid AND ModelCoreType=@mct";
            using (var connection = new SqlConnection(ConnectionString))
            {
                connection.Execute(query, new { mid = model.Id, mct = model.ModelCoreType });
            }

            base.Delete(model);
        }

        protected override Action<SqlConnection, Humor> ChangeMaterialBeforeSelect => (connection, model) =>
        {
            const string query = "SELECT TOP(1) dh.UserName FROM D_HUMOR AS dh WHERE dh.Id=@id";
            model.UserName = connection.Query<string>(query, new { id = model.Id }).SingleOrDefault();
        };
    }
}


text:
   -- create account row type for returning
    CREATE TYPE ledg AS (ledger_id int,ledger_name varchar, ledger_number int, ledger_b real, ledger_pb real, ledger_nb real);

    CREATE OR REPLACE FUNCTION report_subsidiary_ledger_balance(  show_only_active_accounts boolean,
                                                car int,
                                                unit int,
                                                project int,
                                                journal_type int,
                                                from_ledger int,
                                                to_ledger int,
                                                ledger_account int,
                                                periods TEXT,
                                                previous_periods TEXT    )
    RETURNS setof ledg AS $$
    DECLARE
            ledgerRecord record;
            temp ledg;
            previous_balance real;
            balance real;
            new_balance real;
            total_previous real;
            total_balance real;
            total_new real;
            active boolean;
    BEGIN

              total_previous := 0;
              total_balance := 0 ;
              total_new := 0;

              FOR ledgerRecord IN
					SELECT * FROM ledgers
                                        WHERE ledgers.account_id = ledger_account
                                        AND (from_ledger IS NULL OR ledgers.number >= from_ledger)
                                        AND (to_ledger IS NULL OR ledgers.number <= to_ledger)
					ORDER BY ledgers.number
              LOOP
                        active := FALSE;
                        previous_balance := NULL;
                        balance := NULL;

                        IF (previous_periods IS NOT NULL AND LENGTH(previous_periods) > 0 ) THEN
                            SELECT SUM(jo.amount)
                            INTO previous_balance
                            FROM  (journal_operations as jo
                            JOIN journals as j (journal_id) USING (journal_id) )
                            WHERE   jo.account_id  = ledger_account
                            AND     jo.ledger_id = ledgerRecord.id
                            AND     jo.amount IS NOT NULL
                            AND     j.period_id = ANY (CAST (string_to_array(previous_periods, ',') AS int[] ))
                            AND     (car IS NULL OR jo.car_id = car)
                            AND     (project IS NULL OR jo.project_id = project)
                            AND     (unit IS NULL OR jo.unit_id = unit)
                            AND     (journal_type IS NULL OR j.journal_type_id = journal_type);
                        END IF;

                        IF previous_balance IS NULL THEN
                            previous_balance := 0;
                        ELSE
                            active := true;
                        END IF;

                        IF (periods IS NOT NULL AND LENGTH(periods) > 0 ) THEN
                            SELECT SUM(jo.amount)
                            INTO balance
                            FROM  (journal_operations as jo
                            JOIN journals as j (journal_id) USING (journal_id) )
                            WHERE   jo.account_id  = ledger_account
                            AND     jo.ledger_id = ledgerRecord.id
                            AND     jo.amount IS NOT NULL
                            AND     j.period_id = ANY (CAST (string_to_array(periods, ',') AS int[] ))
                            AND     (car IS NULL OR jo.car_id = car)
                            AND     (project IS NULL OR jo.project_id = project)
                            AND     (unit IS NULL OR jo.unit_id = unit)
                            AND     (journal_type IS NULL OR j.journal_type_id = journal_type);
                        END IF;

                        IF balance IS NULL THEN
                            balance := 0;
                        ELSE
                            active := true;
                        END IF;

                        new_balance := previous_balance + balance;

                        temp.ledger_id := ledgerRecord.id;
                        temp.ledger_name := ledgerRecord.name;
                        temp.ledger_number := ledgerRecord.number;
                        temp.ledger_b := balance ;
                        temp.ledger_pb := previous_balance ;
                        temp.ledger_nb := new_balance;

                        total_balance := total_balance + balance;
                        total_previous := total_previous + previous_balance;
                        total_new := total_new + new_balance;

                        IF show_only_active_accounts IS FALSE OR active IS TRUE THEN
                            RETURN NEXT temp;
                        END IF;
              END LOOP;

            --total row
            temp.ledger_id := 0;
            temp.ledger_name := 'total';
            temp.ledger_number := 0;
            temp.ledger_b := total_balance;
            temp.ledger_pb := total_previous ;
            temp.ledger_nb := total_new;
            RETURN NEXT temp;

    END;
    $$ LANGUAGE plpgsql;