text:
.styleSans19.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 19.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans11.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 11.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 10.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans13.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 13.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 9.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans4.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 4.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 12pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 7.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans2.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 2.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 1.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans27.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 27.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans126.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 126.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans12.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 12.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans38.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 38.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 8.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans205.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 205.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans170.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 170.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans139.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 139.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans105.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 105.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans28.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 28.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans763.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 763.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans725.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 725.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans726.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 726.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans34.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 34.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans40.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 40.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans85.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 85.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}

.styleSans14.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle> {
    font-family: Sans;
    font-size: 14.0pt;
    font-weight: normal;
    font-style: normal;
    text-align: 0;
    letter-spacing: 0pt;
    line-height: 0pt;
}


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:wheel="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <!--android:background="@mipmap/flashscreen">-->

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_centerVertical="true" />

    <Button
        android:id="@+id/button3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imageView"
        android:layout_marginTop="66dp"
        android:layout_toEndOf="@+id/imageView"
        android:layout_toRightOf="@+id/imageView"
        android:text="New Button" />

    <Button
        android:id="@+id/button4"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@id/button3"
        android:layout_marginLeft="20dp"

        android:background="@drawable/shape_test"
        android:text="New Button" />

    <com.pnikosis.materialishprogress.ProgressWheel
        android:id="@+id/progress_wheel"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_below="@id/button3"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        wheel:matProg_barColor="#5588FF"
        wheel:matProg_progressIndeterminate="true" />

    <RadioGroup
        android:layout_width="200dp"
        android:layout_height="50dp"
        android:layout_below="@id/button4"
        android:orientation="horizontal"
        android:layout_marginTop="15dp"
        android:background="@drawable/switch_bar"
        >

        <RadioButton
            android:id="@+id/radioButton"
            style="@style/RadioButtonAsSwitchBar"
            android:layout_height="fill_parent"
            android:layout_alignLeft="@+id/progress_wheel"
            android:layout_alignStart="@+id/progress_wheel"
            android:layout_alignTop="@+id/button3"
            android:layout_gravity="center_vertical"
            android:checked="true"
            android:text="小店选货" />

        <RadioButton
            android:id="@+id/radioButton2"
            style="@style/RadioButtonAsSwitchBar"
            android:layout_height="fill_parent"
            android:layout_alignLeft="@+id/progress_wheel"
            android:layout_alignStart="@+id/progress_wheel"
            android:layout_alignTop="@+id/button3"
            android:layout_gravity="center_vertical"
            android:text="有赞分享" />

    </RadioGroup>

</RelativeLayout>

redpajama_set_name: RedPajamaGithub


text:
Rikuesuto, Japanese for "Request" pronounced "re-KUES-to", is a Ruby Gem for defining a standard
Request and Response interchange between processes for general
processors. A request can be forwarded to a web server, message queue,
IPC or RPC (Remote Procedure Call).

[![Gem Version](https://badge.fury.io/rb/rikuesuto.svg)](http://badge.fury.io/rb/rikuesuto)

## Installation

Add this line to your application's Gemfile:

    gem 'rikuesuto'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rikuesuto

## Usage

A simple request is a

```ruby
class Charger
  include Rikuesto::Processor

  def new_request(params={}, controls={})
    @response = Rikuesuto.requestor( {
                  class:       Charges,
                  method:      :post, url:"/api/charges",
                  queue_name:  "charges",
                  http_runner: HttpCharger.new,
                  json_runner: MessageQueueCharger.new,
                  params:      params
                }.merge(controls)).run
  end

  def self.process_request(params)
    @request.pagination     #=> {page:1, pagesize:20,...}
    @request.authorization  #=> [[{}]]
    @request.meta           #=> {request_id:"uuid", ...}

    # ... magic happens here ...

    Rikuesuto.respond(:ok, "Charged", payment:self.payment)
  end
end
```

```ruby
class PostResource < Rikeusto::Resource
  def request; end
  def response; end
  def get; end
  def post; end
  def delete; end
  def put; end
  def collection; end
  def resource; end
  def custom_action; end
[[end]]
```

```ruby
```

## Contributing

1. Fork it ( https://github.com/[my-github-username]/rikuesuto/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request,

[![Gem Version](http://img.youtube.com/vi/MppNFgVV25I/0.jpg]( https://www.youtube.com/watch?v=MppNFgVV25I)


text:
require 'spec_helper'

describe "problems/index.atom.builder" do

  it 'display problem message' do
    app = App.new(:new_record => false)
    view.stub(:problems).and_return([Problem.new(
      :message => 'foo',
      :new_record => false, :app => app), Problem.new(:new_record => false, :app => app)])
    render
    expect(rendered).to match('foo')
  end

end


text:
/*	$NetBSD: machdep.c,v 1.18 2003/11/07 17:00:19 augustss Exp $	*/

/*
 * Copyright (c) 2002 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Lennart Augustsson (lennart@augustsson.net) at Sandburst Corp.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Copyright (C) 1995, 1996 Wolfgang Solfrank.
 * Copyright (C) 1995, 1996 TooLs GmbH.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by TooLs GmbH.
 * 4. The name of TooLs GmbH may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2003/11/07 17:00:19 augustss Exp $");

#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
#include "opt_ddbparam.h"
#include "opt_inet.h"
#include "opt_ccitt.h"
#include "opt_iso.h"
#include "opt_ns.h"
#include "opt_ipkdb.h"

#include <sys/param.h>
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/exec.h>
#include <sys/extent.h>
#include <sys/kernel.h>
#include <sys/kgdb.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/mount.h>
#include <sys/msgbuf.h>
#include <sys/proc.h>
#include <sys/reboot.h>
#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <sys/syslog.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/user.h>
#include <sys/ksyms.h>

#include <uvm/uvm.h>
#include <uvm/uvm_extern.h>

#include <net/netisr.h>

#include <machine/bus.h>
#include <machine/db_machdep.h>
#include <machine/intr.h>
#include <machine/pio.h>
#include <machine/pmap.h>
#include <machine/powerpc.h>
#include <machine/trap.h>
#include <machine/pmppc.h>

#include <powerpc/oea/bat.h>

#include <ddb/db_extern.h>

#include <dev/cons.h>

#include <dev/ic/cpc700reg.h>
#include <dev/ic/cpc700uic.h>

#include "com.h"
#if (NCOM > 0)
#include <sys/termios.h>
#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
#endif

#include "ksyms.h"

struct powerpc_bus_space pmppc_mem_tag = {
	_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_MEM_TYPE,
	0, 0, 0xffffffff,
	NULL,
};
struct powerpc_bus_space pmppc_pci_io_tag = {
	_BUS_SPACE_LITTLE_ENDIAN|_BUS_SPACE_MEM_TYPE,
	0, CPC_PCI_IO_BASE, 0xffffffff,
	NULL,
};

static char ex_storage[1][EXTENT_FIXED_STORAGE_SIZE(8)]
    __attribute__((aligned(8)));

#ifdef KGDB
char kgdb_devname[] = KGDB_DEVNAME;
int comkgdbaddr = KGDB_DEVADDR;
int comkgdbrate = KGDB_DEVRATE;

#ifndef KGDB_DEVMODE
#define KGDB_DEVMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */
#endif
int comkgdbmode = KGDB_DEVMODE;

void kgdb_port_init(void);
#endif /* KGDB */

/*
 * Global variables used here and there
 */
struct mem_region physmemr[2], availmemr[2];

struct a_config a_config;

void lcsplx(int);		/* Called from locore */
void initppc(u_int, u_int, u_int, void *); /* Called from locore */

void strayintr(int);

void pmppc_setup(void);

void setleds(int leds);

/*
 * Force cpu_info to be in the data segment to avoid the
 * memset() blowing away the data set up by locore.S.
 */
struct cpu_info cpu_info[1] = {{{{1}}}};

void
initppc(u_int startkernel, u_int endkernel, u_int args, void *btinfo)
{
	extern void consinit(void);
	extern void ext_intr(void);
	extern u_long ticks_per_sec;
	extern unsigned char edata[], end[];

	memset(&edata, 0, end - edata); /* clear BSS */

	pmppc_setup();

	physmemr[0].start = 0;
	physmemr[0].size = a_config.a_mem_size;
	physmemr[1].size = 0;
	availmemr[0].start = (endkernel + PGOFSET) & ~PGOFSET;
	availmemr[0].size = a_config.a_mem_size - availmemr[0].start;
	availmemr[1].size = 0;

#ifdef BOOTHOWTO
	/*
	 * boothowto
	 */
	boothowto = BOOTHOWTO;
#endif

	if (bus_space_init(&pmppc_mem_tag, "iomem",
			   ex_storage[0], sizeof(ex_storage[0])))
		panic("bus_space_init failed");

	/*
	 * Get CPU clock
	 */
	ticks_per_sec = a_config.a_bus_freq;
	ticks_per_sec /= 4;	/* 4 cycles per DEC tick */
	cpu_timebase = ticks_per_sec;
	cpu_initclocks();

	/*
	 * Initialize the BAT registers
	 */
	oea_batinit(
	    PMPPC_FLASH_BASE, BAT_BL_256M, /* flash (etc) memory 256M area */
	    CPC_PCI_MEM_BASE, BAT_BL_256M, /* PCI memory 256M area */
	    CPC_PCI_IO_BASE,  BAT_BL_128M, /* PCI I/O 128M area */
	    0);

	/*
	 * Set up trap vectors
	 */
	oea_init(ext_intr);

	/*
	 * Set up console.
	 */
	consinit();		/* XXX should not be here */

	printf("console set up\n");

        /*
	 * Set the page size.
	 */
	uvm_setpagesize();

	/*
	 * Initialize pmap module.
	 */
	pmap_bootstrap(startkernel, endkernel);

#if NKSYMS || defined(DDB) || defined(LKM)
#ifdef SYMTAB_SPACE
	ksyms_init(0, NULL, NULL);
#else
	#error "No SYMTAB_SPACE"
#endif
#endif
#ifdef IPKDB
	/*
	 * Now trap to IPKDB
	 */
	ipkdb_init();
	if (boothowto & RB_KDB)
		ipkdb_connect(0);
#endif
#ifdef KGDB
	kgdb_port_init();
	if (boothowto & RB_KDB) {
		kgdb_debug_init = 1;
		kgdb_connect(1);
	}
#endif
}

void
mem_regions(struct mem_region **mem, struct mem_region **avail)
{
	*mem = physmemr;
	*avail = availmemr;
}

/*
 * Machine dependent startup code.
 */
void
cpu_startup()
{
/*	int msr;*/

	oea_startup(NULL);

	/*
	 * Now that we have VM, malloc()s are OK in bus_space.
	 */
	bus_space_mallocok();

	/* Set up the PCI bus tag. */
	if (bus_space_init(&pmppc_pci_io_tag, "pcimem", NULL, 0))
		panic("bus_space_init pci failed");

	/* Set up interrupt controller */
	cpc700_init_intr(&pmppc_mem_tag, CPC_UIC_BASE,
	    CPC_INTR_MASK(PMPPC_I_ETH_INT), 0);

#if 0
/* XXX doesn't seem to be needed anymore */
	/*
	 * Now allow hardware interrupts.
	 */
	__asm __volatile ("mfmsr %0; ori %0,%0,%1; mtmsr %0"
	    : "=r"(msr) : "K"(PSL_EE));
#endif
}

/*
 * consinit
 * Initialize system console.
 */
void
consinit(void)
{
	static int initted;
#if (NCOM > 0)
	bus_space_tag_t tag;
#endif

	if (initted)
		return;
	initted = 1;

#if (NCOM > 0)
	tag = &pmppc_mem_tag;

	if(comcnattach(tag, CPC_COM0, 9600, CPC_COM_SPEED(a_config.a_bus_freq),
	    COM_TYPE_NORMAL,
            ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8)))
		panic("can't init serial console");
	else
		return;
#endif

	panic("console device missing -- serial console not in kernel");
	/* Of course, this is moot if there is no console... */
}

#ifdef KGDB
void
kgdb_port_init(void)
{
#if (NCOM > 0)
	if(!strcmp(kgdb_devname, "com")) {
		bus_space_tag_t tag = &pmppc_mem_tag;
		com_kgdb_attach(tag, comkgdbaddr, comkgdbrate,
				CPC_COM_SPEED(a_config.a_bus_freq),
				COM_TYPE_NORMAL, comkgdbmode);
	}
#endif
}
#endif

/*
 * Stray interrupts.
 */
void
strayintr(int irq)
{
	log(LOG_ERR, "stray interrupt %d\n", irq);
}

/*
 * Halt or reboot the machine after syncing/dumping according to howto.
 */
void
cpu_reboot(int howto, char *what)
{
	static int syncing;
	static char str[256];
	char *ap = str, *ap1 = ap;
	extern void disable_intr(void);

	boothowto = howto;
	if (!cold && !(howto & RB_NOSYNC) && !syncing) {
		syncing = 1;
		vfs_shutdown();		/* sync */
		resettodr();		/* set wall clock */
	}
	splhigh();
	if (howto & RB_HALT) {
		doshutdownhooks();
		printf("halted\n\n");
		while(1);
	}
	if (!cold && (howto & RB_DUMP))
		oea_dumpsys();
	doshutdownhooks();
	printf("rebooting\n\n");
	if (what && *what) {
		if (strlen(what) > sizeof str - 5)
			printf("boot string too large, ignored\n");
		else {
			strcpy(str, what);
			ap1 = ap = str + strlen(str);
			*ap++ = ' ';
		}
	}
	*ap++ = '-';
	if (howto & RB_SINGLE)
		*ap++ = 's';
	if (howto & RB_KDB)
		*ap++ = 'd';
	*ap++ = 0;
	if (ap[-2] == '-')
		*ap1 = 0;

	disable_intr();

        /* Write the two byte reset sequence to the reset register. */
	out8(PMPPC_RESET, PMPPC_RESET_SEQ_STEP1);
	out8(PMPPC_RESET, PMPPC_RESET_SEQ_STEP2);

	while (1);
}

void
lcsplx(int ipl)
{
	splx(ipl);
}

void
setleds(int leds)
{
	out8(PMPPC_LEDS, leds);
}

void
pmppc_setup(void)
{
	uint config0, config1;

	config0 = in8(PMPPC_CONFIG0);
	config1 = in8(PMPPC_CONFIG1);

	/* from page 2-8 in the Artesyn User's manual */
	a_config.a_boot_device = config1 & 0x80 ? A_BOOT_FLASH : A_BOOT_ROM;
	a_config.a_has_ecc = (config1 & 0x40) != 0;
	switch (config1 & 0x30) {
	case 0x00: a_config.a_mem_size = 32 * 1024 * 1024; break;
	case 0x10: a_config.a_mem_size = 64 * 1024 * 1024; break;
	case 0x20: a_config.a_mem_size = 128 * 1024 * 1024; break;
	case 0x30: a_config.a_mem_size = 256 * 1024 * 1024; break;
	}
	a_config.a_l2_cache = (config1 >> 2) & 3;
	switch (config1 & 0x03) {
	case 0x00: a_config.a_bus_freq = 66666666; break;
	case 0x01: a_config.a_bus_freq = 83333333; break;
	case 0x02: a_config.a_bus_freq = 100000000; break;
	case 0x03: a_config.a_bus_freq = 0; break; /* XXX */
	}
	a_config.a_is_monarch = (config0 & 0x80) == 0;
	a_config.a_has_eth = (config0 & 0x20) != 0;
	a_config.a_has_rtc = (config0 & 0x10) == 0;
	switch (config0 & 0x0c) {
	case 0x00: a_config.a_flash_size = 256 * 1024 * 1024; break;
	case 0x04: a_config.a_flash_size = 128 * 1024 * 1024; break;
	case 0x08: a_config.a_flash_size = 64 * 1024 * 1024; break;
	case 0x0c: a_config.a_flash_size = 32 * 1024 * 1024; break;
	}
	switch (config0 & 0x03) {
	case 0x00: a_config.a_flash_width = 64; break;
	case 0x01: a_config.a_flash_width = 32; break;
	case 0x02: a_config.a_flash_width = 16; break;
	case 0x03: a_config.a_flash_width = 0; break;
	}
}


text:
use std::collections::HashMap;
use std::collections::hash_map::Entry::{Occupied, Vacant};
use unquote::unquote_plus;

/// An alias type of `Vec<String>`.
///
pub type QueryValue = Vec<String>;

/// An alias type of `HashMap<String, QueryValue>`.
///
pub type Query = HashMap<String, QueryValue>;

pub trait GetQuery {
    /// Gets first value from Vec<String> via HashMap.get().
    ///
    fn get_first(&self, k: &String) -> Option<&String>;

    /// Gets value from `Vec<String>` via `HashMap.get()`.
    /// This requires one &str argument and returns `Option<QueryValue>`
    /// instead of `Option<&QueryValue>`.
    ///
    fn get_from_str(&self, k: &str) -> Option<QueryValue>;

    /// Gets first value from `Vec<String>` via `HashMap.get()`.
    /// This requires one &str argument and returns `Option<String>`
    /// instead of `Option<&String>`.
    ///
    fn get_first_from_str(&self, k: &str) -> Option<String>;
}

impl GetQuery for Query {
    fn get_first(&self, k: &String) -> Option<&String> {
        match self.get(k) {
            Some(value) => value.get(0),
            None        => None,
        }
    }

    fn get_from_str(&self, k: &str) -> Option<QueryValue> {
        match self.get(&k.to_string()) {
            Some(value) => Some(value.iter().map(|e| e.to_string()).collect()),
            None        => None,
        }
    }

    fn get_first_from_str(&self, k: &str) -> Option<String> {
        match self.get(&k.to_string()) {
            Some(value) => match value.get(0) {
                Some(string) => Some(string.to_string()),
                None         => None,
            },
            None        => None,
        }
    }
}

/// Parses a query given as a string argument.
///
/// # Examples
///
/// ```
/// use urlparse::parse_qs;
///
/// let map = parse_qs("a=123&a=90&a=%E4%BA%80%E4%BA%95&b=0;n1;n2");
/// let a = map.get(&"a".to_string()).unwrap();
/// let b = map.get(&"b".to_string()).unwrap();
/// assert_eq!(a.len(), 3);
/// assert_eq!(b.len(), 1);
/// assert_eq!(*a.get(2).unwrap(), "亀井");
/// ```
///
pub fn parse_qs<S: AsRef<str>>(s: S) -> Query {
    let mut map : Query = Query::new();
    for item in s.as_ref().split(|c| c == '&' || c == ';') {
        match item.find('=') {
            Some(index) => {
                let (key, value) = item.split_at(index);
                let _key = match unquote_plus(key) {
                    Ok(k)  => k,
                    Err(_) => continue,  // NOTE: We ignore error when doing unquote_plus()
                };
                let _value = match unquote_plus(value.trim_left_matches('=')) {
                    Ok(v)  => v,
                    Err(_) => continue,  // NOTE: We ignore error when doing unquote_plus()
                };
                if _value.is_empty() {
                    continue;
                }
                let mut result = match map.entry(_key) {
                    Vacant(entry)   => entry.insert(Vec::new()),
                    Occupied(entry) => entry.into_mut(),
                };
                result.push(_value);
            },
            None        => continue,
        }
    }
    return map;
}


text:
<!DOCTYPE html>

<title>Welcome</title>
<link rel="shortcut icon" href="<?=base_url()?>images/logo1.png">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

OfferDekho Admin

<form action="admin/login" method="post">
Email
<input type="text" name="l_email" value="<?=set_value('l_email') ?>" />
Password
<input type="password" name="l_pass"/>
<input type="submit" value="Sign in" name="signin"/>
</form>

Sign Up

<form action="admin/do_register/" method="post">
User Name
<input type="text" name="username" value="<?=set_value('username') ?>"/>
Email
<input type="text" name="email" value="<?=set_value('email') ?>" />
Password
<input type="password" name="password"/>

Gender
<input type="radio" name="gender" value="male" <?php echo set_radio('gender', 'male'); ?>/>Male
<input type="radio" name="gender" value="female" <?php echo set_radio('gender', 'female'); ?>/>Female

<input type="submit" value="Sign up" name="register"/>
</form>

<?php echo validation_errors(); ?>


text:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import pageComponent from 'code-corps-ember/tests/pages/components/submittable-textarea';
import PageObject from 'ember-cli-page-object';

let page = PageObject.create(pageComponent);

function setHandler(context, modifiedSubmitHandler = () => {}) {
  context.set('modifiedSubmitHandler', modifiedSubmitHandler);
}

moduleForComponent('submittable-textarea', 'Integration | Component | submittable textarea', {
  integration: true,
  beforeEach() {
    page.setContext(this);
    setHandler(this);
  },
  afterEach() {
    page.removeContext();
  }
});

// This test is necessary because a new line after yield in the file will
// cause a new line in the textarea itself
test('it has no extra content when created', function(assert) {
  this.render(hbs`{{submittable-textarea modifiedSubmit=modifiedSubmitHandler}}`);
  assert.equal(page.value, '', 'Element is blank.');
});

test('it sends the modifiedSubmit action on command/ctrl + enter', function(assert) {
  assert.expect(1);

  setHandler(this, () => {
    assert.equal(page.value, '', 'Action was called. Input content was unchanged.');
  });

  this.render(hbs`{{submittable-textarea modifiedSubmit=modifiedSubmitHandler}}`);

  page.keySubmit();
});


text:
Simple Image Captcha Server.

### Dependencies
* [vibe.d](https://github.com/rejectedsoftware/vibe.d)
  * [deimos](https://github.com/D-Programming-Deimos)
    * [libevent](https://github.com/D-Programming-Deimos/libevent)
    * [openssl](https://github.com/D-Programming-Deimos/openssl)

### Compiling

Using **[DUB](https://github.com/D-Programming-Language/dub)**:
```
dub build --build=release
```

### Program arguments
Flag          |    | Description                                        | Default value
--------------|----|----------------------------------------------------|--------------
**--height**  | -h | Minimum (default) captcha image height in *pixels* | 32
**--length**  | -l | Minimum (default) captcha string length            | 6
**--port**    | -p | Server port number for listening                   | 20938
**--width**   | -w | Minimum (default) captcha image width in *pixels*  | 64
**--timeout** | -t | Captcha expiration time in *seconds*               | 120
**--cors**    |    | Enable cross-origin resource sharing (CORS)        | false

> Use **--help** for a complete list of options, or **--version** for current version output.

### Usage examples
To run *sicas* with default settings, listening on the default port number (on Linux):
```
./bin/sicas
```


text:
from telepot import Bot
from functools import wraps
from nimmy.utils import Map
from threading import Thread

class Bot(Bot):

    def __init__(self, *args, **kwargs):
        super(Bot, self).__init__(*args, **kwargs)

        # holds script functions
        self.scripts = []
        self.script_lock = None

    def _filter(self, filter_model, message, check):

        # checks for any exceptions with filters, find None, true or false
        try:
            filters = filter_model(message)
            if check(filters.values()):
                filters.update({'filter_name': filter_model.__name__})
                return filters
        except:
            return False

    def filter(self, filter_model, check=all):

        # argumented decoration, returns func with msg
        def decorator(func):

            # prevents cloning
            @wraps(func)
            def wrapper(msg):

                # converts dict to object with utils.Map
                message = Map(**msg)
                filterd = self._filter(filter_model, message, check)

                if filterd:
                    setattr(message, filterd['filter_name'], filterd)
                    return func(message)
            self.scripts.append(wrapper)
            return wrapper
        return decorator

    def filter_lock(self, script):

        for s in self.scripts:

            if s.__name__ is script:
                self.script_lock = s
                return True
        return False

    def filter_release(self):
        self.script_lock = None
        return True

    def run_forever(self, sleep_for=10, **loop):

        # telepot message_loop with dummy_handler
        print('Listening ...')
        self.message_loop(self.dummy_handler, **loop)

        from time import sleep
        # simple loop sleeps: sleep_for
        while 1:
            sleep(sleep_for)

    def dummy_handler(self, msg):

        # acts like a handle returns a list of handles and execute
        scripts = self.scripts if not self.script_lock else [self.script_lock]
        for script in scripts:

            # threading to prevent filter blocks (eg: infinite loops)
            t = Thread(target=script, args=(msg, ))
            t.start()


text:
namespace Envoy {
namespace Extensions {
namespace Filters {
namespace Common {
namespace RBAC {
namespace Matchers {

// RBAC matcher extension for matching upstream's IP address (and port range if configured).
// configuration with the resolved upstream IP (v4 and v6).
class UpstreamIpPortMatcher : public Filters::Common::RBAC::Matcher,
                              public Logger::Loggable<Logger::Id::rbac> {
public:
  UpstreamIpPortMatcher(
      const envoy::extensions::rbac::matchers::upstream_ip_port::v3::UpstreamIpPortMatcher& proto);

  // Matcher interface.
  bool matches(const Network::Connection&, const Envoy::Http::RequestHeaderMap&,
               const StreamInfo::StreamInfo&) const override;

private:
  absl::optional<Envoy::Network::Address::CidrRange> cidr_;
  absl::optional<envoy::type::v3::Int64Range> port_;
};

// Extension factory for UpstreamIpPortMatcher.
class UpstreamIpPortMatcherFactory
    : public Filters::Common::RBAC::BaseMatcherExtensionFactory<
          UpstreamIpPortMatcher,
          envoy::extensions::rbac::matchers::upstream_ip_port::v3::UpstreamIpPortMatcher> {
public:
  std::string name() const override { return "envoy.rbac.matchers.upstream_ip_port"; }
};

} // namespace Matchers
} // namespace RBAC
} // namespace Common
} // namespace Filters
} // namespace Extensions
} // namespace Envoy


text:
status: publish
tags:
- websights
published: true
title: Die PARTEI verkauft Wahlwerbezeit auf Ebay
type: post
meta:
  tags: die+partei ebay wahl2005
layout: post
---
Die PARTEI (schon allein durch ihren Gründer, den Chef der Satirezeitung TITANIC, geradezu als seriöseste aller ernstgemeinten Parteien qualifiziert) verkauft 25 Sekunden Werbezeit in ihrem Wahlwerbespot auf Ebay.

Der Spot läuft am 14.9. um etwa 17:55 Uhr im ZDF, wie man dort lesen kann.

Beim ZDF findet man die ganze Versteigerung zwar ein bisschen skandalös, aber trotzdem ist das Gebot gerade schon bei sauberen 14000 Euro.

Ich persönlich finde es einfach komisch: Besonders, dass man zwischen 25 Sekunden Spot und 90 Sekunden Schleichwerbung wählen darf, ist ein ziemlich deutlicher Seitenhieb auf die ständige Schleichwerbung bei ARD und Co.... :)

Dass die PARTEI nicht gerade ein Kandidat für den Wahlsieg ist, versteht sich von selbst - eine nette Aktion, deshalb. Ich bin gespannt, wer das Rennen macht. Zu den Vorzeigekandidaten für eher verrückte Aktionen zählt zum Beispiel "Red Bull", aber auch der Linkspartei würde ich das zutrauen, einen Haufen Geld darin zu investieren, um sich Sympathien unter "Komikern" zu schaffen.

Sagt mir jemand bescheid, was es war, das gezeigt wurde? Oder, noch besser, nimmt es jemand auf?


text:
title: 2017 WA State Election Candidates
permalink: "/wa/candidates/"
layout: default
dark-theme: true
---

{% include navbar.html %}

      {% include components/main-heading.html
        text="2017 WA State Election Candidates"
        font-size="h0 line-height-2"
        font-weight="bold"
        line="true" %}

Flux Senators serve to protect the integrity of Flux.

Being a Flux Representative is not like being any other elected representative. Flux Representatives respect Flux as a method for decision making more than they respect their own opinions. If elected, this may mean casting a vote in parliament contrary to their personal beliefs.

All our Flux candidates have made a public declaration stating that they will act as a proxy for the Flux system and that they won't use their status for personal gain (including personal policy agenda).

      {% include components/main-heading.html
        text="Lead candidates"
        font-size="h1 line-height-2"
        font-weight="bold" %}
      {% include components/hr-muted.html classes="mb3"%}

        {% assign lead_candidates = site.wa-candidates |  where: "lead", true %}
        {% for candidate in lead_candidates %}
          {% capture snippet %} {{ candidate.bio | first | truncatewords: 50 }} {% endcapture %}
          {% include candidates/candidate-card.html
             region=candidate.region
             house=candidate.house
             url=candidate.url
             title=candidate.title
             bio=snippet   %}
        {% endfor %}

      {% assign candidates = site.wa-candidates | where: "lead", false %}
      {% for candidate in candidates %}
        {% if candidate.hide == nil  %}
          {% capture snippet %} {{ candidate.bio | first | truncatewords: 50 }} {% endcapture %}
          {% include candidates/candidate-card.html
             region=candidate.region
             house=candidate.house
             url=candidate.url
             title=candidate.title
             bio=snippet   %}
        {% endif %}
      {% endfor %}

{% include footer.html %}


text:
package org.apache.hadoop.mapreduce.split;

import java.io.IOException;
import java.util.List;

import javax.annotation.Nullable;

import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import org.apache.tez.mapreduce.grouper.GroupedSplitContainer;
import org.apache.tez.mapreduce.grouper.MapReduceSplitContainer;
import org.apache.tez.mapreduce.grouper.SplitContainer;
import org.apache.tez.mapreduce.grouper.SplitSizeEstimatorWrapperMapReduce;
import org.apache.tez.mapreduce.grouper.TezSplitGrouper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.classification.InterfaceAudience.Public;
import org.apache.hadoop.classification.InterfaceStability.Evolving;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.mapreduce.InputSplit;

/**
 * Helper that provides a grouping of input splits based
 * on multiple parameters. It creates {@link TezGroupedSplit}
 * to wrap the each group of real InputSplits
 */
@Public
@Evolving
public class TezMapReduceSplitsGrouper extends TezSplitGrouper {
  private static final Logger LOG = LoggerFactory.getLogger(TezMapReduceSplitsGrouper.class);

  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final String TEZ_GROUPING_SPLIT_COUNT = TezSplitGrouper.TEZ_GROUPING_SPLIT_COUNT;

  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final String TEZ_GROUPING_SPLIT_BY_LENGTH = TezSplitGrouper.TEZ_GROUPING_SPLIT_BY_LENGTH;
  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final boolean TEZ_GROUPING_SPLIT_BY_LENGTH_DEFAULT = TezSplitGrouper.TEZ_GROUPING_SPLIT_BY_LENGTH_DEFAULT;

  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final String TEZ_GROUPING_SPLIT_BY_COUNT = TezSplitGrouper.TEZ_GROUPING_SPLIT_BY_COUNT;
  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final boolean TEZ_GROUPING_SPLIT_BY_COUNT_DEFAULT = TezSplitGrouper.TEZ_GROUPING_SPLIT_BY_COUNT_DEFAULT;

  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final String TEZ_GROUPING_SPLIT_WAVES = TezSplitGrouper.TEZ_GROUPING_SPLIT_WAVES;
  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final float TEZ_GROUPING_SPLIT_WAVES_DEFAULT = TezSplitGrouper.TEZ_GROUPING_SPLIT_WAVES_DEFAULT;

  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final String TEZ_GROUPING_SPLIT_MAX_SIZE = TezSplitGrouper.TEZ_GROUPING_SPLIT_MAX_SIZE;
  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final long TEZ_GROUPING_SPLIT_MAX_SIZE_DEFAULT = TezSplitGrouper.TEZ_GROUPING_SPLIT_MAX_SIZE_DEFAULT;

  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final String TEZ_GROUPING_SPLIT_MIN_SIZE = TezSplitGrouper.TEZ_GROUPING_SPLIT_MIN_SIZE;
  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final long TEZ_GROUPING_SPLIT_MIN_SIZE_DEFAULT = TezSplitGrouper.TEZ_GROUPING_SPLIT_MIN_SIZE_DEFAULT;

  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final String TEZ_GROUPING_RACK_SPLIT_SIZE_REDUCTION =
                                              TezSplitGrouper.TEZ_GROUPING_RACK_SPLIT_SIZE_REDUCTION;
  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final float TEZ_GROUPING_RACK_SPLIT_SIZE_REDUCTION_DEFAULT = TezSplitGrouper.TEZ_GROUPING_RACK_SPLIT_SIZE_REDUCTION_DEFAULT;

  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final String TEZ_GROUPING_REPEATABLE = TezSplitGrouper.TEZ_GROUPING_REPEATABLE;
  /**
   * @deprecated See equivalent in {@link TezSplitGrouper}
   */
  @Deprecated
  public static final boolean TEZ_GROUPING_REPEATABLE_DEFAULT = TezSplitGrouper.TEZ_GROUPING_REPEATABLE_DEFAULT;

  public List<InputSplit> getGroupedSplits(Configuration conf,
      List<InputSplit> originalSplits, int desiredNumSplits,
      String wrappedInputFormatName) throws IOException, InterruptedException {
    return getGroupedSplits(conf, originalSplits, desiredNumSplits,
        wrappedInputFormatName, null);
  }

  public List<InputSplit> getGroupedSplits(Configuration conf,
                                           List<InputSplit> originalSplits, int desiredNumSplits,
                                           String wrappedInputFormatName,
                                           SplitSizeEstimator estimator) throws IOException,
      InterruptedException {
    Preconditions.checkArgument(originalSplits != null, "Splits must be specified");
    List<SplitContainer> originalSplitContainers = Lists.transform(originalSplits,
        new Function<InputSplit, SplitContainer>() {
          @Override
          public SplitContainer apply(InputSplit input) {
            return new MapReduceSplitContainer(input);
          }
        });

    return Lists.transform(super
            .getGroupedSplits(conf, originalSplitContainers, desiredNumSplits,
                wrappedInputFormatName, estimator == null ? null :
                new SplitSizeEstimatorWrapperMapReduce(estimator)),
        new Function<GroupedSplitContainer, InputSplit>() {
          @Override
          public InputSplit apply(GroupedSplitContainer input) {

            List<InputSplit> underlyingSplits = Lists.transform(input.getWrappedSplitContainers(),
                new Function<SplitContainer, InputSplit>() {
                  @Override
                  public InputSplit apply(SplitContainer input) {
                    return ((MapReduceSplitContainer) input).getRawSplit();
                  }
                });

            return new TezGroupedSplit(underlyingSplits, input.getWrappedInputFormatName(),
                input.getLocations(), input.getRack(), input.getLength());

          }
        });
  }

  /**
   * Builder that can be used to configure grouping in Tez
   *
   * @deprecated See {@link org.apache.tez.mapreduce.grouper.TezSplitGrouper.TezMRSplitsGrouperConfigBuilder#newConfigBuilder(Configuration)}
   *
   * @param conf
   *          {@link Configuration} This will be modified in place. If
   *          configuration values may be changed at runtime via a config file
   *          then pass in a {@link Configuration} that is initialized from a
   *          config file. The parameters that are not overridden in code will
   *          be derived from the Configuration object.
   * @return {@link org.apache.hadoop.mapreduce.split.TezMapReduceSplitsGrouper.TezMRSplitsGrouperConfigBuilder}
   */
  @Deprecated
  public static TezMRSplitsGrouperConfigBuilder createConfigBuilder(Configuration conf) {
    return new TezMRSplitsGrouperConfigBuilder(conf);
  }

  /**
   * @deprecated See {@link org.apache.tez.mapreduce.grouper.TezSplitGrouper.TezMRSplitsGrouperConfigBuilder}
   */
  @Deprecated
  public static final class TezMRSplitsGrouperConfigBuilder {
    private final Configuration conf;

    /**
     * This configuration will be modified in place
     */
    private TezMRSplitsGrouperConfigBuilder(@Nullable Configuration conf) {
      if (conf == null) {
        conf = new Configuration(false);
      }
      this.conf = conf;
    }

    public TezMRSplitsGrouperConfigBuilder setGroupSplitCount(int count) {
      this.conf.setInt(TezSplitGrouper.TEZ_GROUPING_SPLIT_COUNT, count);
      return this;
    }

    public TezMRSplitsGrouperConfigBuilder setGroupSplitByCount(boolean enabled) {
      this.conf.setBoolean(TezSplitGrouper.TEZ_GROUPING_SPLIT_BY_COUNT, enabled);
      return this;
    }

    public TezMRSplitsGrouperConfigBuilder setGroupSplitByLength(boolean enabled) {
      this.conf.setBoolean(TezSplitGrouper.TEZ_GROUPING_SPLIT_BY_LENGTH, enabled);
      return this;
    }

    public TezMRSplitsGrouperConfigBuilder setGroupSplitWaves(float multiplier) {
      this.conf.setFloat(TezSplitGrouper.TEZ_GROUPING_SPLIT_WAVES, multiplier);
      return this;
    }

    public TezMRSplitsGrouperConfigBuilder setGroupingRackSplitSizeReduction(float rackSplitSizeReduction) {
      this.conf.setFloat(TezSplitGrouper.TEZ_GROUPING_RACK_SPLIT_SIZE_REDUCTION, rackSplitSizeReduction);
      return this;
    }

    /**
     * upper and lower bounds for the splits
     */
    public TezMRSplitsGrouperConfigBuilder setGroupingSplitSize(long lowerBound, long upperBound) {
      this.conf.setLong(TezSplitGrouper.TEZ_GROUPING_SPLIT_MIN_SIZE, lowerBound);
      this.conf.setLong(TezSplitGrouper.TEZ_GROUPING_SPLIT_MAX_SIZE, upperBound);
      return this;
    }

    public Configuration build() {
      return this.conf;
    }
  }
}


text:
package com.java110.report.api;

import com.alibaba.fastjson.JSONObject;
import com.java110.dto.reportInfoSetting.ReportInfoSettingDto;
import com.java110.po.reportInfoSetting.ReportInfoSettingPo;
import com.java110.report.bmo.reportInfoSetting.IDeleteReportInfoSettingBMO;
import com.java110.report.bmo.reportInfoSetting.IGetReportInfoSettingBMO;
import com.java110.report.bmo.reportInfoSetting.ISaveReportInfoSettingBMO;
import com.java110.report.bmo.reportInfoSetting.IUpdateReportInfoSettingBMO;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(value = "/reportInfoSetting")
public class ReportInfoSettingApi {

    @Autowired
    private ISaveReportInfoSettingBMO saveReportInfoSettingBMOImpl;
    @Autowired
    private IUpdateReportInfoSettingBMO updateReportInfoSettingBMOImpl;
    @Autowired
    private IDeleteReportInfoSettingBMO deleteReportInfoSettingBMOImpl;

    @Autowired
    private IGetReportInfoSettingBMO getReportInfoSettingBMOImpl;

    /**
     * 微信保存消息模板
     * @serviceCode /reportInfoSetting/saveReportInfoSetting
     * @path /app/reportInfoSetting/saveReportInfoSetting
     * @param reqJson
     * @return
     */
    @RequestMapping(value = "/saveReportInfoSetting", method = RequestMethod.POST)
    public ResponseEntity<String> saveReportInfoSetting(@RequestBody JSONObject reqJson) {

        Assert.hasKeyAndValue(reqJson, "reportType", "请求报文中未包含reportType");
        Assert.hasKeyAndValue(reqJson, "name", "请求报文中未包含name");
        Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
        Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");

        ReportInfoSettingPo reportInfoSettingPo = BeanConvertUtil.covertBean(reqJson, ReportInfoSettingPo.class);
        return saveReportInfoSettingBMOImpl.save(reportInfoSettingPo);
    }

    /**
     * 微信修改消息模板
     * @serviceCode /reportInfoSetting/updateReportInfoSetting
     * @path /app/reportInfoSetting/updateReportInfoSetting
     * @param reqJson
     * @return
     */
    @RequestMapping(value = "/updateReportInfoSetting", method = RequestMethod.POST)
    public ResponseEntity<String> updateReportInfoSetting(@RequestBody JSONObject reqJson) {

        Assert.hasKeyAndValue(reqJson, "settingId", "请求报文中未包含settingId");
        Assert.hasKeyAndValue(reqJson, "reportType", "请求报文中未包含reportType");
        Assert.hasKeyAndValue(reqJson, "name", "请求报文中未包含name");
        Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime");
        Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime");
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
        Assert.hasKeyAndValue(reqJson, "remark", "请求报文中未包含remark");
        Assert.hasKeyAndValue(reqJson, "settingId", "settingId不能为空");

        ReportInfoSettingPo reportInfoSettingPo = BeanConvertUtil.covertBean(reqJson, ReportInfoSettingPo.class);
        return updateReportInfoSettingBMOImpl.update(reportInfoSettingPo);
    }

    /**
     * 微信删除消息模板
     * @serviceCode /reportInfoSetting/deleteReportInfoSetting
     * @path /app/reportInfoSetting/deleteReportInfoSetting
     * @param reqJson
     * @return
     */
    @RequestMapping(value = "/deleteReportInfoSetting", method = RequestMethod.POST)
    public ResponseEntity<String> deleteReportInfoSetting(@RequestBody JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");

        Assert.hasKeyAndValue(reqJson, "settingId", "settingId不能为空");

        ReportInfoSettingPo reportInfoSettingPo = BeanConvertUtil.covertBean(reqJson, ReportInfoSettingPo.class);
        return deleteReportInfoSettingBMOImpl.delete(reportInfoSettingPo);
    }

    /**
     * 微信删除消息模板
     * @serviceCode /reportInfoSetting/queryReportInfoSetting
     * @path /app/reportInfoSetting/queryReportInfoSetting
     * @param communityId 小区ID
     * @return
     */
    @RequestMapping(value = "/queryReportInfoSetting", method = RequestMethod.GET)
    public ResponseEntity<String> queryReportInfoSetting(@RequestParam(value = "communityId") String communityId,
                                                         @RequestParam(value = "name",required = false) String name,
                                                         @RequestParam(value = "settingId",required = false) String settingId,
                                                      @RequestParam(value = "page") int page,
                                                      @RequestParam(value = "row") int row) {
        ReportInfoSettingDto reportInfoSettingDto = new ReportInfoSettingDto();
        reportInfoSettingDto.setPage(page);
        reportInfoSettingDto.setRow(row);
        reportInfoSettingDto.setCommunityId(communityId);
        reportInfoSettingDto.setNameLike(name);
        reportInfoSettingDto.setSettingId(settingId);
        return getReportInfoSettingBMOImpl.get(reportInfoSettingDto);
    }
}


text:
import unittest
from unittest import TestCase

from datatasks import TreeNode, Tree

class TreeTest(TestCase):

    def test_init(self):
        tree = Tree(TreeNode('0'))
        self.assertNotEqual(tree, None)

    def test_basic_func(self):
        tree = Tree(TreeNode('0'))
        tree.push(TreeNode('1'), '0')
        tree.push(TreeNode('2'), '0')
        tree.push(TreeNode('3'), '0')
        tree.push(TreeNode('4'), '1')
        tree.push(TreeNode('5'), '1')
        self.assertEqual(len(tree.to_list()), 6)

if __name__ == '__main__':
    unittest.main()