text:
<?php

namespace AppBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use AppBundle\Entity\Event;
use AppBundle\Form\EventType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;

/**
 * Event controller.
 *
 * @Route("/event")
 */
class EventController extends Controller
{

    /**
     * Lists all Event entities.
     *
     * @Route("/", name="event_index")
     * @Method("GET")
     * @Template()
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('AppBundle:Event')->findAll();

        return array(
            'entities' => $entities,
        );
    }
    /**
     * Creates a new Event entity.
     *
     * @Route("/", name="event_create")
     * @Method("POST")
     * @Template("AppBundle:Event:new.html.twig")
     */
    public function createAction(Request $request)
    {
        $entity = new Event();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('event_show', array('id' => $entity->getId())));
        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }

    /**
     * Creates a form to create a Event entity.
     *
     * @param Event $entity The entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createCreateForm(Event $entity)
    {
        $form = $this->createForm(EventType::class, $entity, array(
            'action' => $this->generateUrl('event_create'),
            'method' => 'POST',
        ));

        $form->add('submit', SubmitType::class, array('label' => 'Create'));

        return $form;
    }

    /**
     * Displays a form to create a new Event entity.
     *
     * @Route("/new", name="event_new")
     * @Method("GET")
     * @Template()
     */
    public function newAction()
    {
        $entity = new Event();
        $form   = $this->createCreateForm($entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }

    /**
     * Finds and displays a Event entity.
     *
     * @Route("/{id}", name="event_show")
     * @Method("GET")
     * @Template()
     */
    public function showAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:Event')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Event entity.');
        }

        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
     * Displays a form to edit an existing Event entity.
     *
     * @Route("/{id}/edit", name="event_edit")
     * @Method("GET")
     * @Template()
     */
    public function editAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:Event')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Event entity.');
        }

        $editForm = $this->createEditForm($entity);
        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }

    /**
    * Creates a form to edit a Event entity.
    *
    * @param Event $entity The entity
    *
    * @return \Symfony\Component\Form\Form The form
    */
    private function createEditForm(Event $entity)
    {
        $form = $this->createForm(EventType::class, $entity, array(
            'action' => $this->generateUrl('event_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

        $form->add('submit', SubmitType::class, array('label' => 'Update'));

        return $form;
    }
    /**
     * Edits an existing Event entity.
     *
     * @Route("/{id}", name="event_update")
     * @Method("PUT")
     * @Template("AppBundle:Event:edit.html.twig")
     */
    public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $em->getRepository('AppBundle:Event')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Event entity.');
        }

        $deleteForm = $this->createDeleteForm($id);
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);

        if ($editForm->isValid())
        {
            $em->flush();

            return $this->redirect($this->generateUrl('event_edit', array('id' => $id)));
        }

        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
    /**
     * Deletes a Event entity.
     *
     * @Route("/{id}", name="event_delete")
     * @Method("DELETE")
     */
    public function deleteAction(Request $request, $id)
    {
        $form = $this->createDeleteForm($id);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $entity = $em->getRepository('AppBundle:Event')->find($id);

            if (!$entity) {
                throw $this->createNotFoundException('Unable to find Event entity.');
            }

            $em->remove($entity);
            $em->flush();
        }

        return $this->redirect($this->generateUrl('event'));
    }

    /**
     * Creates a form to delete a Event entity by id.
     *
     * @param mixed $id The entity id
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm($id)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('event_delete', array('id' => $id)))
            ->setMethod('DELETE')
            ->add('submit', SubmitType::class, array('label' => 'Delete'))
            ->getForm()
        ;
    }
}


text:
package org.opensingular.requirement.connector.sei30.extensao.ws;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for RetornoConsultarConteudoDocumento complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="RetornoConsultarConteudoDocumento">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <all>
 *         <element name="ProtocoloDocumento" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="Conteudo" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *       </all>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RetornoConsultarConteudoDocumento", propOrder = {

})
public class RetornoConsultarConteudoDocumento {

    @XmlElement(name = "ProtocoloDocumento", required = true)
    protected String protocoloDocumento;
    @XmlElement(name = "Conteudo", required = true)
    protected String conteudo;

    /**
     * Gets the value of the protocoloDocumento property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getProtocoloDocumento() {
        return protocoloDocumento;
    }

    /**
     * Sets the value of the protocoloDocumento property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setProtocoloDocumento(String value) {
        this.protocoloDocumento = value;
    }

    /**
     * Gets the value of the conteudo property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getConteudo() {
        return conteudo;
    }

    /**
     * Sets the value of the conteudo property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setConteudo(String value) {
        this.conteudo = value;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package main

import (
	"fmt"
	"testing"

	"github.com/stretchr/testify/suite"

	"github.com/lxc/lxd/lxd/db"
	deviceConfig "github.com/lxc/lxd/lxd/device/config"
	"github.com/lxc/lxd/lxd/instance"
	instanceDrivers "github.com/lxc/lxd/lxd/instance/drivers"
	"github.com/lxc/lxd/lxd/instance/instancetype"
	driver "github.com/lxc/lxd/lxd/storage"
	"github.com/lxc/lxd/shared"
	"github.com/lxc/lxd/shared/api"
	"github.com/lxc/lxd/shared/idmap"
)

type containerTestSuite struct {
	lxdTestSuite
}

func (suite *containerTestSuite) TestContainer_ProfilesDefault() {
	args := db.InstanceArgs{
		Type:      instancetype.Container,
		Ephemeral: false,
		Name:      "testFoo",
	}

	c, err := instanceCreateInternal(suite.d.State(), args)
	suite.Req.Nil(err)
	defer c.Delete()

	profiles := c.Profiles()
	suite.Len(
		profiles,
		1,
		"No default profile created on instanceCreateInternal.")

	suite.Equal(
		"default",
		profiles[0],
		"First profile should be the default profile.")
}

func (suite *containerTestSuite) TestContainer_ProfilesMulti() {
	// Create an unprivileged profile
	err := suite.d.cluster.Transaction(func(tx *db.ClusterTx) error {
		profile := db.Profile{
			Name:        "unprivileged",
			Description: "unprivileged",
			Config:      map[string]string{"security.privileged": "true"},
			Project:     "default",
		}
		_, err := tx.CreateProfile(profile)
		return err
	})

	suite.Req.Nil(err, "Failed to create the unprivileged profile.")
	defer func() {
		suite.d.cluster.Transaction(func(tx *db.ClusterTx) error {
			return tx.DeleteProfile("default", "unpriviliged")
		})
	}()

	args := db.InstanceArgs{
		Type:      instancetype.Container,
		Ephemeral: false,
		Profiles:  []string{"default", "unprivileged"},
		Name:      "testFoo",
	}

	c, err := instanceCreateInternal(suite.d.State(), args)
	suite.Req.Nil(err)
	defer c.Delete()

	profiles := c.Profiles()
	suite.Len(
		profiles,
		2,
		"Didn't get both profiles in instanceCreateInternal.")

	suite.True(
		c.IsPrivileged(),
		"The container is not privileged (didn't apply the unprivileged profile?).")
}

func (suite *containerTestSuite) TestContainer_ProfilesOverwriteDefaultNic() {
	args := db.InstanceArgs{
		Type:      instancetype.Container,
		Ephemeral: false,
		Config:    map[string]string{"security.privileged": "true"},
		Devices: deviceConfig.Devices{
			"eth0": deviceConfig.Device{
				"type":    "nic",
				"nictype": "bridged",
				"parent":  "unknownbr0"}},
		Name: "testFoo",
	}

	_, err := suite.d.State().Cluster.CreateNetwork("unknownbr0", "", db.NetworkTypeBridge, nil)
	suite.Req.Nil(err)

	c, err := instanceCreateInternal(suite.d.State(), args)
	suite.Req.Nil(err)

	suite.True(c.IsPrivileged(), "This container should be privileged.")

	out, _, err := c.Render()
	suite.Req.Nil(err)

	state := out.(*api.Instance)
	defer c.Delete()

	suite.Equal(
		"unknownbr0",
		state.Devices["eth0"]["parent"],
		"Container config doesn't overwrite profile config.")
}

func (suite *containerTestSuite) TestContainer_LoadFromDB() {
	args := db.InstanceArgs{
		Type:      instancetype.Container,
		Ephemeral: false,
		Config:    map[string]string{"security.privileged": "true"},
		Devices: deviceConfig.Devices{
			"eth0": deviceConfig.Device{
				"type":    "nic",
				"nictype": "bridged",
				"parent":  "unknownbr0"}},
		Name: "testFoo",
	}
	state := suite.d.State()

	_, err := state.Cluster.CreateNetwork("unknownbr0", "", db.NetworkTypeBridge, nil)
	suite.Req.Nil(err)

	// Create the container
	c, err := instanceCreateInternal(state, args)
	suite.Req.Nil(err)
	defer c.Delete()

	// Load the container and trigger initLXC()
	c2, err := instance.LoadByProjectAndName(state, "default", "testFoo")
	c2.IsRunning()
	suite.Req.Nil(err)
	_, err = c2.StorageStart()
	suite.Req.Nil(err)

	instanceDrivers.PrepareEqualTest(c, c2)
	suite.Exactly(
		c,
		c2,
		"The loaded container isn't excactly the same as the created one.")
}

func (suite *containerTestSuite) TestContainer_Path_Regular() {
	// Regular
	args := db.InstanceArgs{
		Type:      instancetype.Container,
		Ephemeral: false,
		Name:      "testFoo",
	}

	c, err := instanceCreateInternal(suite.d.State(), args)
	suite.Req.Nil(err)
	defer c.Delete()

	suite.Req.False(c.IsSnapshot(), "Shouldn't be a snapshot.")
	suite.Req.Equal(shared.VarPath("containers", "testFoo"), c.Path())
	suite.Req.Equal(shared.VarPath("containers", "testFoo2"), driver.InstancePath(instancetype.Container, "default", "testFoo2", false))
}

func (suite *containerTestSuite) TestContainer_LogPath() {
	args := db.InstanceArgs{
		Type:      instancetype.Container,
		Ephemeral: false,
		Name:      "testFoo",
	}

	c, err := instanceCreateInternal(suite.d.State(), args)
	suite.Req.Nil(err)
	defer c.Delete()

	suite.Req.Equal(shared.VarPath("logs", "testFoo"), c.LogPath())
}

func (suite *containerTestSuite) TestContainer_IsPrivileged_Privileged() {
	args := db.InstanceArgs{
		Type:      instancetype.Container,
		Ephemeral: false,
		Config:    map[string]string{"security.privileged": "true"},
		Name:      "testFoo",
	}

	c, err := instanceCreateInternal(suite.d.State(), args)
	suite.Req.Nil(err)

	suite.Req.True(c.IsPrivileged(), "This container should be privileged.")
	suite.Req.Nil(c.Delete(), "Failed to delete the container.")
}

func (suite *containerTestSuite) TestContainer_IsPrivileged_Unprivileged() {
	args := db.InstanceArgs{
		Type:      instancetype.Container,
		Ephemeral: false,
		Config:    map[string]string{"security.privileged": "false"},
		Name:      "testFoo",
	}

	c, err := instanceCreateInternal(suite.d.State(), args)
	suite.Req.Nil(err)

	suite.Req.False(c.IsPrivileged(), "This container should be unprivileged.")
	suite.Req.Nil(c.Delete(), "Failed to delete the container.")
}

func (suite *containerTestSuite) TestContainer_Rename() {
	args := db.InstanceArgs{
		Type:      instancetype.Container,
		Ephemeral: false,
		Name:      "testFoo",
	}

	c, err := instanceCreateInternal(suite.d.State(), args)
	suite.Req.Nil(err)
	defer c.Delete()

	suite.Req.Nil(c.Rename("testFoo2"), "Failed to rename the container.")
	suite.Req.Equal(shared.VarPath("containers", "testFoo2"), c.Path())
}

func (suite *containerTestSuite) TestContainer_findIdmap_isolated() {
	c1, err := instanceCreateInternal(suite.d.State(), db.InstanceArgs{
		Type: instancetype.Container,
		Name: "isol-1",
		Config: map[string]string{
			"security.idmap.isolated": "true",
		},
	})
	suite.Req.Nil(err)
	defer c1.Delete()

	c2, err := instanceCreateInternal(suite.d.State(), db.InstanceArgs{
		Type: instancetype.Container,
		Name: "isol-2",
		Config: map[string]string{
			"security.idmap.isolated": "true",
		},
	})
	suite.Req.Nil(err)
	defer c2.Delete()

	map1, err := c1.(instance.Container).NextIdmap()
	suite.Req.Nil(err)
	map2, err := c2.(instance.Container).NextIdmap()
	suite.Req.Nil(err)

	host := suite.d.os.IdmapSet.Idmap[0]

	for i := 0; i < 2; i++ {
		suite.Req.Equal(host.Hostid+65536, map1.Idmap[i].Hostid, "hostids don't match %d", i)
		suite.Req.Equal(int64(0), map1.Idmap[i].Nsid, "nsid nonzero")
		suite.Req.Equal(int64(65536), map1.Idmap[i].Maprange, "incorrect maprange")
	}

	for i := 0; i < 2; i++ {
		suite.Req.Equal(host.Hostid+65536*2, map2.Idmap[i].Hostid, "hostids don't match")
		suite.Req.Equal(int64(0), map2.Idmap[i].Nsid, "nsid nonzero")
		suite.Req.Equal(int64(65536), map2.Idmap[i].Maprange, "incorrect maprange")
	}
}

func (suite *containerTestSuite) TestContainer_findIdmap_mixed() {
	c1, err := instanceCreateInternal(suite.d.State(), db.InstanceArgs{
		Type: instancetype.Container,
		Name: "isol-1",
		Config: map[string]string{
			"security.idmap.isolated": "false",
		},
	})
	suite.Req.Nil(err)
	defer c1.Delete()

	c2, err := instanceCreateInternal(suite.d.State(), db.InstanceArgs{
		Type: instancetype.Container,
		Name: "isol-2",
		Config: map[string]string{
			"security.idmap.isolated": "true",
		},
	})
	suite.Req.Nil(err)
	defer c2.Delete()

	map1, err := c1.(instance.Container).NextIdmap()
	suite.Req.Nil(err)
	map2, err := c2.(instance.Container).NextIdmap()
	suite.Req.Nil(err)

	host := suite.d.os.IdmapSet.Idmap[0]

	for i := 0; i < 2; i++ {
		suite.Req.Equal(host.Hostid, map1.Idmap[i].Hostid, "hostids don't match %d", i)
		suite.Req.Equal(int64(0), map1.Idmap[i].Nsid, "nsid nonzero")
		suite.Req.Equal(host.Maprange, map1.Idmap[i].Maprange, "incorrect maprange")
	}

	for i := 0; i < 2; i++ {
		suite.Req.Equal(host.Hostid+65536, map2.Idmap[i].Hostid, "hostids don't match")
		suite.Req.Equal(int64(0), map2.Idmap[i].Nsid, "nsid nonzero")
		suite.Req.Equal(int64(65536), map2.Idmap[i].Maprange, "incorrect maprange")
	}
}

func (suite *containerTestSuite) TestContainer_findIdmap_raw() {
	c1, err := instanceCreateInternal(suite.d.State(), db.InstanceArgs{
		Type: instancetype.Container,
		Name: "isol-1",
		Config: map[string]string{
			"security.idmap.isolated": "false",
			"raw.idmap":               "both 1000 1000",
		},
	})
	suite.Req.Nil(err)
	defer c1.Delete()

	map1, err := c1.(instance.Container).NextIdmap()
	suite.Req.Nil(err)

	host := suite.d.os.IdmapSet.Idmap[0]

	for _, i := range []int{0, 3} {
		suite.Req.Equal(host.Hostid, map1.Idmap[i].Hostid, "hostids don't match")
		suite.Req.Equal(int64(0), map1.Idmap[i].Nsid, "nsid nonzero")
		suite.Req.Equal(int64(1000), map1.Idmap[i].Maprange, "incorrect maprange")
	}

	for _, i := range []int{1, 4} {
		suite.Req.Equal(int64(1000), map1.Idmap[i].Hostid, "hostids don't match")
		suite.Req.Equal(int64(1000), map1.Idmap[i].Nsid, "invalid nsid")
		suite.Req.Equal(int64(1), map1.Idmap[i].Maprange, "incorrect maprange")
	}

	for _, i := range []int{2, 5} {
		suite.Req.Equal(host.Hostid+1001, map1.Idmap[i].Hostid, "hostids don't match")
		suite.Req.Equal(int64(1001), map1.Idmap[i].Nsid, "invalid nsid")
		suite.Req.Equal(host.Maprange-1000-1, map1.Idmap[i].Maprange, "incorrect maprange")
	}
}

func (suite *containerTestSuite) TestContainer_findIdmap_maxed() {
	maps := []*idmap.IdmapSet{}

	for i := 0; i < 7; i++ {
		c, err := instanceCreateInternal(suite.d.State(), db.InstanceArgs{
			Type: instancetype.Container,
			Name: fmt.Sprintf("isol-%d", i),
			Config: map[string]string{
				"security.idmap.isolated": "true",
			},
		})

		/* we should fail if there are no ids left */
		if i != 6 {
			suite.Req.Nil(err)
		} else {
			suite.Req.NotNil(err)
			return
		}

		defer c.Delete()

		m, err := c.(instance.Container).NextIdmap()
		suite.Req.Nil(err)

		maps = append(maps, m)
	}

	for i, m1 := range maps {
		for j, m2 := range maps {
			if m1 == m2 {
				continue
			}

			for _, e := range m2.Idmap {
				suite.Req.False(m1.HostidsIntersect(e), "%d and %d's idmaps intersect %v %v", i, j, m1, m2)
			}
		}
	}
}

func TestContainerTestSuite(t *testing.T) {
	suite.Run(t, new(containerTestSuite))
}


text: window.miqChangeGroup = () => {};


text:
struct timespec;
extern void save_time_delta(struct timespec *delta, struct timespec *rtc);
extern void restore_time_delta(struct timespec *delta, struct timespec *rtc);


text:
<TITLE>Anti-Grain Geometry - </TITLE>
<META http-equiv="Content-Type" content="text/html"/>
<LINK rel="stylesheet" type="text/css" href="../../agg.styles.css"/>

//----------------------------------------------------------------------------
// Anti-Grain Geometry (AGG) - Version 2.5
// A high quality rendering engine for C++
// Copyright (C) 2002-2006 Maxim Shemanarev
// Contact: mcseem@antigrain.com
//          mcseemagg@yahoo.com
//          http://antigrain.com
//
// AGG is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// AGG is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with AGG; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301, USA.
//----------------------------------------------------------------------------

#ifndef AGG_BSPLINE_INCLUDED
#define AGG_BSPLINE_INCLUDED

#include "agg_array.h"

namespace agg
{
    //----------------------------------------------------------------bspline
    // A very simple class of Bi-cubic Spline interpolation.
    // First call init(num, x[], y[]) where num - number of source points,
    // x, y - arrays of X and Y values respectively. Here Y must be a function
    // of X. It means that all the X-coordinates must be arranged in the ascending
    // order.
    // Then call get(x) that calculates a value Y for the respective X.
    // The class supports extrapolation, i.e. you can call get(x) where x is
    // outside the given with init() X-range. Extrapolation is a simple linear
    // function.
    //
    //  See Implementation agg_bspline.cpp
    //------------------------------------------------------------------------
    class bspline
    {
    public:
        bspline();
        bspline(int num);
        bspline(int num, const double* x, const double* y);

        void   init(int num);
        void   add_point(double x, double y);
        void   prepare();

        void   init(int num, const double* x, const double* y);

        double get(double x) const;
        double get_stateful(double x) const;

    private:
        bspline(const bspline&);
        const bspline& operator = (const bspline&);

        static void bsearch(int n, const double *x, double x0, int *i);
        double extrapolation_left(double x) const;
        double extrapolation_right(double x) const;
        double interpolation(double x, int i) const;

        int               m_max;
        int               m_num;
        double*           m_x;
        double*           m_y;
        pod_array<double> m_am;
        mutable int       m_last_idx;
    };

}

#endif

Copyright © 2002-2006
Maxim Shemanarev

Web Design and Programming
Maxim Shemanarev


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/app_white_smoke"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.esod.andelaapp.activity.home.HomeActivity"
    tools:showIn="@layout/activity_home">

    <ProgressBar
        android:id="@+id/progressLoader"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"/>

    <LinearLayout
        android:id="@+id/network_layout"
        android:layout_centerInParent="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:visibility="gone"
        android:orientation="vertical">

        <ImageView
            android:contentDescription="@string/app_name"
            android:layout_width="wrap_content"
            android:layout_height="70dp"
            android:tint="@color/colorAccent"
            android:src="@drawable/sadface"/>

        <TextView
            android:id="@+id/errorText"
            android:layout_marginTop="@dimen/hdfivedp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAlignment="center"
            android:gravity="center"
            android:textColor="@color/app_grey"
            android:textSize="@dimen/hdfourteensp"
            android:text="@string/errorText"/>

        <TextView
            android:id="@+id/errorText_ii"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textAlignment="center"
            android:gravity="center"
            android:textColor="@color/app_grey"
            android:textSize="@dimen/hdfourteensp"
            android:text="@string/errorText_ii"/>

        <Button
            android:id="@+id/retryButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/app_green"
            android:textSize="@dimen/hdeighteensp"
            android:text="@string/retry"
            style="@style/Base.Widget.AppCompat.Button.Borderless"/>

    </LinearLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/developersRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone"
        android:scrollbars="vertical"/>
</RelativeLayout>


text:
{-# LANGUAGE OverloadedStrings #-}
module Main where

import Web.Twitter.Conduit hiding (map)
import Common

import Control.Monad.IO.Class
import qualified Data.Conduit as C
import qualified Data.Conduit.List as CL
import qualified Data.Map as M
import Network.HTTP.Conduit
import System.Environment

main :: IO ()
main = do
    [screenName] <- liftIO getArgs
    twInfo <- getTWInfoFromEnv
    let sn = ScreenNameParam screenName

    (folids, friids) <- withManager $ \mgr -> do
        folids <- sourceWithCursor twInfo mgr (followersIds sn) C.$$ CL.consume
        friids <- sourceWithCursor twInfo mgr (friendsIds sn) C.$$ CL.consume
        return (folids, friids)

    let folmap = M.fromList $ map (flip (,) True) folids
        os = filter (\uid -> M.notMember uid folmap) friids
        bo = filter (\usr -> M.member usr folmap) friids

    liftIO $ putStrLn "one sided:"
    liftIO $ print os

    liftIO $ putStrLn "both following:"
    liftIO $ print bo


text:
<?php

namespace Components\Forum\Admin\Controllers;

use Hubzero\Component\AdminController;
use Components\Forum\Models\Manager;
use Components\Forum\Models\Section;
use Components\Forum\Models\Category;
use Request;
use Notify;
use Route;
use Lang;
use User;
use App;

/**
 * Controller class for forum categories
 */
class Categories extends AdminController
{
	/**
	 * Execute a task
	 *
	 * @return  void
	 */
	public function execute()
	{
		$this->registerTask('add', 'edit');
		$this->registerTask('apply', 'save');
		$this->registerTask('publish', 'state');
		$this->registerTask('unpublish', 'state');

		parent::execute();
	}

	/**
	 * Display all categories in a section
	 *
	 * @return  void
	 */
	public function displayTask()
	{
		// Filters
		$filters = array(
			'state' => Request::getState(
				$this->_option . '.' . $this->_controller . '.state',
				'state',
				-1,
				'int'
			),
			'access' => Request::getState(
				$this->_option . '.' . $this->_controller . '.access',
				'access',
				-1,
				'int'
			),
			'section_id' => Request::getState(
				$this->_option . '.' . $this->_controller . '.section_id',
				'section_id',
				-1,
				'int'
			),
			'sort' => Request::getState(
				$this->_option . '.' . $this->_controller . '.sort',
				'filter_order',
				'id'
			),
			'sort_Dir' => Request::getState(
				$this->_option . '.' . $this->_controller . '.sortdir',
				'filter_order_Dir',
				'DESC'
			),
			'search' => Request::getState(
				$this->_option . '.' . $this->_controller . '.search',
				'search',
				''
			),
			'scopeinfo' => Request::getState(
				$this->_option . '.' . $this->_controller . '.scopeinfo',
				'scopeinfo',
				''
			)
		);
		if (strstr($filters['scopeinfo'], ':'))
		{
			$bits = explode(':', $filters['scopeinfo']);
			$filters['scope']    = $bits[0];
			$filters['scope_id'] = intval(end($bits));
		}
		else
		{
			$filters['scope']    = '';
			$filters['scope_id'] = -1;
		}

		$filters['admin'] = true;

		// Load the current section
		if (!$filters['section_id'] || $filters['section_id'] <= 0)
		{
			// No section? Load a default blank section
			$section = Section::blank();
		}
		else
		{
			$section = Section::oneOrFail($filters['section_id']);
			$filters['scope']    = $section->get('scope');
			$filters['scope_id'] = $section->get('scope_id');
			$filters['scopeinfo'] = $filters['scope'] . ':' . $filters['scope_id'];
		}

		$sections = array();

		if ($filters['scope_id'] >= 0)
		{
			$sections = Section::all()
				->whereEquals('scope', $filters['scope'])
				->whereEquals('scope_id', $filters['scope_id'])
				->ordered('title', 'ASC')
				->rows();
		}

		$entries = Category::all()
			->including(['posts', function ($post){
				$post
					->select('id')
					->select('category_id');
			}]);

		if ($filters['search'])
		{
			$entries->whereLike('title', strtolower((string)$filters['search']));
		}

		if ($filters['scope'])
		{
			$entries->whereEquals('scope', $filters['scope']);
		}

		if ($filters['scope_id'] >= 0)
		{
			$entries->whereEquals('scope_id', (int)$filters['scope_id']);
		}

		if ($filters['state'] >= 0)
		{
			$entries->whereEquals('state', (int)$filters['state']);
		}

		if ($filters['access'] >= 0)
		{
			$entries->whereEquals('access', (int)$filters['access']);
		}

		if ($filters['section_id'] > 0)
		{
			$entries->whereEquals('section_id', (int)$filters['section_id']);
		}

		// Get records
		$rows = $entries
			->ordered('filter_order', 'filter_order_Dir')
			->paginated('limitstart', 'limit')
			->rows();

		$forum = new Manager($filters['scope'], $filters['scope_id']);

		// Output the HTML
		$this->view
			->set('rows', $rows)
			->set('filters', $filters)
			->set('section', $section)
			->set('sections', $sections)
			->set('scopes', $forum->scopes())
			->display();
	}

	/**
	 * Displays a question response for editing
	 *
	 * @param   object  $category
	 * @return  void
	 */
	public function editTask($category=null)
	{
		Request::setVar('hidemainmenu', 1);

		if (!User::authorise('core.edit', $this->_option)
		 && !User::authorise('core.create', $this->_option))
		{
			App::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));
		}

		// Incoming
		$section = Section::oneOrNew(Request::getInt('section_id', 0));

		if (!is_object($category))
		{
			$id = Request::getArray('id', array(0));
			if (is_array($id))
			{
				$id = (!empty($id) ? intval($id[0]) : 0);
			}

			$category = Category::oneOrNew($id);
		}

		if ($category->isNew())
		{
			$category->set('created_by', User::get('id'));
			$category->set('section_id', $section->get('id'));
			$category->set('scope', $section->get('scope', 'site'));
			$category->set('scope_id', $section->get('scope_id', 0));
		}

		$data = Section::all()
			->ordered()
			->rows();

		$sections = array();

		foreach ($data as $s)
		{
			$ky = $s->scope . ' (' . $s->scope_id . ')';
			if ($s->scope == 'site')
			{
				$ky = '[ site ]';
			}
			if (!isset($sections[$ky]))
			{
				$sections[$ky] = array();
			}
			$sections[$ky][] = $s;
			asort($sections[$ky]);
		}

		User::setState('com_forum.edit.category.data', array(
			'id'       => $category->get('id'),
			'asset_id' => $category->get('asset_id')
		));

		// Output the HTML
		$this->view
			->set('row', $category)
			->set('section', $section)
			->set('sections', $sections)
			->set('form', $category->getForm())
			->setLayout('edit')
			->display();
	}

	/**
	 * Save a category record and redirects to listing
	 *
	 * @return  void
	 */
	public function saveTask()
	{
		// Check for request forgeries
		Request::checkToken();

		if (!User::authorise('core.edit', $this->_option)
		 && !User::authorise('core.create', $this->_option))
		{
			App::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));
		}

		User::setState('com_forum.edit.category.data', null);

		// Incoming
		$fields = Request::getArray('fields', array(), 'post');
		$fields = array_map('trim', $fields);

		// Initiate extended database class
		$category = Category::oneOrNew($fields['id'])->set($fields);

		// Bind the rules.
		$data = Request::getArray('jform', array(), 'post');
		if (isset($data['rules']) && is_array($data['rules']))
		{
			$form = $category->getForm($data);
			$data = $form->filter($data);
			if (!$form->validate($data))
			{
				Notify::error($form->getError());
			}

			$category->assetRules = new \Hubzero\Access\Rules($data['rules']);
		}

		// Make sure the chosen section is valid
		$section = Section::oneOrFail($category->get('section_id'));

		if (!$section->get('id'))
		{
			Notify::error(Lang::txt('COM_FORUM_FIELD_INVALID_SECTION'));
			return $this->editTask($category);
		}

		// Ensure the category has the same scope as its parent section
		$category->set('scope', $section->get('scope'));
		$category->set('scope_id', $section->get('scope_id'));

		// Store new content
		if (!$category->save())
		{
			Notify::error($category->getError());
			return $this->editTask($category);
		}

		Notify::success(Lang::txt('COM_FORUM_CATEGORY_SAVED'));

		if ($this->getTask() == 'apply')
		{
			return $this->editTask($category);
		}

		// Redirect
		$this->cancelTask();
	}

	/**
	 * Deletes one or more records and redirects to listing
	 *
	 * @return  void
	 */
	public function removeTask()
	{
		// Check for request forgeries
		Request::checkToken();

		if (!User::authorise('core.delete', $this->_option))
		{
			App::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));
		}

		// Incoming
		$section = Request::getInt('section_id', 0);

		$ids = Request::getArray('id', array());
		$ids = (!is_array($ids) ? array($ids) : $ids);

		$i = 0;

		// Loop through each ID
		foreach ($ids as $id)
		{
			// Remove this category
			$category = Category::oneOrFail(intval($id));

			if (!$category->destroy())
			{
				Notify::error($category->getError());
				continue;
			}

			$i++;
		}

		if ($i)
		{
			Notify::success(Lang::txt('COM_FORUM_CATEGORIES_DELETED'));
		}

		// Redirect
		$this->cancelTask();
	}

	/**
	 * Sets the state of one or more entries
	 *
	 * @return  void
	 */
	public function stateTask()
	{
		// Check for request forgeries
		Request::checkToken(['get', 'post']);

		if (!User::authorise('core.edit.state', $this->_option))
		{
			App::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));
		}

		// Incoming
		$section = Request::getInt('section_id', 0);

		$ids = Request::getArray('id', array());
		$ids = (!is_array($ids) ? array($ids) : $ids);

		$state = ($this->getTask() == 'publish' ? Category::STATE_PUBLISHED : Category::STATE_UNPUBLISHED);

		// Check for an ID
		if (count($ids) < 1)
		{
			$action = ($state == Category::STATE_PUBLISHED) ? Lang::txt('COM_FORUM_PUBLISH') : Lang::txt('COM_FORUM_UNPUBLISH');

			Notify::warning(Lang::txt('COM_FORUM_SELECT_ENTRY_TO', $action));
			return $this->cancelTask();
		}

		$i = 0;

		foreach ($ids as $id)
		{
			// Update record(s)
			$row = Category::oneOrFail(intval($id));
			$row->set('state', $state);

			if (!$row->save())
			{
				Notify::error($row->getError());
				continue;
			}

			$i++;
		}

		// set message
		if ($i)
		{
			if ($state == Category::STATE_PUBLISHED)
			{
				$message = Lang::txt('COM_FORUM_ITEMS_PUBLISHED', $i);
			}
			else
			{
				$message = Lang::txt('COM_FORUM_ITEMS_UNPUBLISHED', $i);
			}

			Notify::success($message);
		}

		$this->cancelTask();
	}

	/**
	 * Sets the state of one or more entries
	 *
	 * @return  void
	 */
	public function accessTask()
	{
		// Check for request forgeries
		Request::checkToken(['get', 'post']);

		if (!User::authorise('core.edit.state', $this->_option))
		{
			App::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));
		}

		// Incoming
		$state   = Request::getInt('access', 0);
		$ids = Request::getArray('id', array());
		$ids = (!is_array($ids) ? array($ids) : $ids);

		// Check for an ID
		if (count($ids) < 1)
		{
			Notify::warning(Lang::txt('COM_FORUM_SELECT_ENTRY_TO_CHANGE_ACCESS'));
			return $this->cancelTask();
		}

		$i = 0;

		foreach ($ids as $id)
		{
			// Update record(s)
			$row = Category::oneOrFail(intval($id));
			$row->set('access', $state);

			if (!$row->save())
			{
				Notify::error($row->getError());
				continue;
			}

			$i++;
		}

		// set message
		if ($i)
		{
			Notify::success(Lang::txt('COM_FORUM_ITEMS_ACCESS_CHANGED', $i));
		}

		$this->cancelTask();
	}

	/**
	 * Cancels a task and redirects to listing
	 *
	 * @return  void
	 */
	public function cancelTask()
	{
		$fields = Request::getArray('fields', array('section_id' => 0));
		if (!isset($fields['section_id']) || !$fields['section_id'])
		{
			$fields['section_id'] = Request::getInt('section_id', 0);
		}

		App::redirect(
			Route::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller . '&section_id=' . $fields['section_id'], false)
		);
	}
}


text:
sentryapi is a Go library for Apache Sentry.

The library can be used to interface with non-kerberized Sentry daemon.

## Installation

Standard `go get`:

```
$ go get github.com/akolb1/sentrytool/sentryapi
```

## Usage & Example

For API usage and examples, see
[![GoDoc](https://godoc.org/github.com/akolb1/sentrytool/sentryapi?status.svg)](https://godoc.org/github.com/akolb1/sentrytool/sentryapi)


text:
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;

namespace MHApi.DrewsClasses {
    public class Axes : Panel {
        [Category("Layout")]
        public double XMin {
            get { return (double)GetValue(XMinProperty); }
            set { SetValue(XMinProperty, value); }
        }
        public static readonly DependencyProperty XMinProperty = DependencyProperty.Register("XMin", typeof(double), typeof(Axes), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsArrange));

        [Category("Layout")]
        public double XMax {
            get { return (double)GetValue(XMaxProperty); }
            set { SetValue(XMaxProperty, value); }
        }
        public static readonly DependencyProperty XMaxProperty = DependencyProperty.Register("XMax", typeof(double), typeof(Axes), new FrameworkPropertyMetadata(1.0, FrameworkPropertyMetadataOptions.AffectsArrange));

        [Category("Layout")]
        public double YMin {
            get { return (double)GetValue(YMinProperty); }
            set { SetValue(YMinProperty, value); }
        }
        public static readonly DependencyProperty YMinProperty = DependencyProperty.Register("YMin", typeof(double), typeof(Axes), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsArrange));

        [Category("Layout")]
        public double YMax {
            get { return (double)GetValue(YMaxProperty); }
            set { SetValue(YMaxProperty, value); }
        }
        public static readonly DependencyProperty YMaxProperty = DependencyProperty.Register("YMax", typeof(double), typeof(Axes), new FrameworkPropertyMetadata(1.0, FrameworkPropertyMetadataOptions.AffectsArrange));

        [AttachedPropertyBrowsableForChildrenAttribute]
        [Category("Layout")]
        public static double GetX(DependencyObject obj) { return (double)obj.GetValue(XProperty); }
        public static void SetX(DependencyObject obj, double value) { obj.SetValue(XProperty, value); }
        public static readonly DependencyProperty XProperty = DependencyProperty.RegisterAttached("X", typeof(double), typeof(Axes), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsParentArrange));

        [AttachedPropertyBrowsableForChildrenAttribute]
        [Category("Layout")]
        public static double GetY(DependencyObject obj) { return (double)obj.GetValue(YProperty); }
        public static void SetY(DependencyObject obj, double value) { obj.SetValue(YProperty, value); }
        public static readonly DependencyProperty YProperty = DependencyProperty.RegisterAttached("Y", typeof(double), typeof(Axes), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsParentArrange));

        [AttachedPropertyBrowsableForChildrenAttribute]
        [Category("Layout")]
        public static double GetAxesWidth(DependencyObject obj) { return (double)obj.GetValue(AxesWidthProperty); }
        public static void SetAxesWidth(DependencyObject obj, double value) { obj.SetValue(AxesWidthProperty, value); }
        public static readonly DependencyProperty AxesWidthProperty = DependencyProperty.RegisterAttached("AxesWidth", typeof(double), typeof(Axes), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsParentArrange));

        [AttachedPropertyBrowsableForChildrenAttribute]
        [Category("Layout")]
        public static double GetAxesHeight(DependencyObject obj) { return (double)obj.GetValue(AxesHeightProperty); }
        public static void SetAxesHeight(DependencyObject obj, double value) { obj.SetValue(AxesHeightProperty, value); }
        public static readonly DependencyProperty AxesHeightProperty = DependencyProperty.RegisterAttached("AxesHeight", typeof(double), typeof(Axes), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.AffectsParentArrange));

        public delegate void AxesMouseButtonEventHandler(object sender, AxesMouseButtonEventArgs e);

        public static readonly RoutedEvent AxesMouseLeftButtonDownEvent = EventManager.RegisterRoutedEvent("AxesMouseLeftButtonDown", RoutingStrategy.Bubble, typeof(AxesMouseButtonEventHandler), typeof(Axes));
        public event AxesMouseButtonEventHandler AxesMouseLeftButtonDown {
            add { AddHandler(AxesMouseLeftButtonDownEvent, value); }
            remove { RemoveHandler(AxesMouseLeftButtonDownEvent, value); }
        }

        public static readonly RoutedEvent AxesMouseLeftButtonUpEvent = EventManager.RegisterRoutedEvent("AxesMouseLeftButtonUp", RoutingStrategy.Bubble, typeof(AxesMouseButtonEventHandler), typeof(Axes));
        public event AxesMouseButtonEventHandler AxesMouseLeftButtonUp {
            add { AddHandler(AxesMouseLeftButtonUpEvent, value); }
            remove { RemoveHandler(AxesMouseLeftButtonUpEvent, value); }
        }

        public static readonly RoutedEvent AxesMouseMoveEvent = EventManager.RegisterRoutedEvent("AxesMouseMove", RoutingStrategy.Bubble, typeof(AxesMouseButtonEventHandler), typeof(Axes));
        public event AxesMouseButtonEventHandler AxesMouseMove {
            add { AddHandler(AxesMouseMoveEvent, value); }
            remove { RemoveHandler(AxesMouseMoveEvent, value); }
        }

        public static readonly RoutedEvent AxesMouseLeftButtonDoubleClickEvent = EventManager.RegisterRoutedEvent("AxesMouseLeftButtonDoubleClick", RoutingStrategy.Bubble, typeof(AxesMouseButtonEventHandler), typeof(Axes));
        public event AxesMouseButtonEventHandler AxesMouseLeftButtonDoubleClick {
            add { AddHandler(AxesMouseLeftButtonDoubleClickEvent, value); }
            remove { RemoveHandler(AxesMouseLeftButtonDoubleClickEvent, value); }
        }

        public Axes() {
            Background = new SolidColorBrush(Colors.Transparent);
            MouseLeftButtonDown += OnMouseLeftButtonDown;
            MouseLeftButtonUp += OnMouseLeftButtonUp;
            MouseMove += OnMouseMove;
            ClipToBounds = true;
        }

        private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
            CaptureMouse();
            Point position = e.GetPosition(this);
            double xPositionInSourcePixels = XMin + position.X / ActualWidth * (XMax - XMin);
            double yPositionInSourcePixels = YMin + position.Y / ActualHeight * (YMax - YMin);
            if (e.ClickCount == 1)
                RaiseEvent(new AxesMouseButtonEventArgs(AxesMouseLeftButtonDownEvent, xPositionInSourcePixels, yPositionInSourcePixels));
            if (e.ClickCount == 2)
                RaiseEvent(new AxesMouseButtonEventArgs(AxesMouseLeftButtonDoubleClickEvent, xPositionInSourcePixels, yPositionInSourcePixels));
        }

        private void OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e) {
            if (!IsMouseCaptured) return;
            ReleaseMouseCapture();
            var position = e.GetPosition(this);
            double xPositionInSourcePixels = XMin + position.X / ActualWidth * (XMax - XMin);
            double yPositionInSourcePixels = YMin + position.Y / ActualHeight * (YMax - YMin);
            RaiseEvent(new AxesMouseButtonEventArgs(AxesMouseLeftButtonUpEvent, xPositionInSourcePixels, yPositionInSourcePixels));
        }

        private void OnMouseMove(object sender, MouseEventArgs e) {
            if (!IsMouseCaptured) return;
            var position = e.GetPosition(this);
            double xPositionInSourcePixels = XMin + position.X / ActualWidth * (XMax - XMin);
            double yPositionInSourcePixels = YMin + position.Y / ActualHeight * (YMax - YMin);
            RaiseEvent(new AxesMouseButtonEventArgs(AxesMouseMoveEvent, xPositionInSourcePixels, yPositionInSourcePixels));
        }

        Size resultSize;
        protected override Size MeasureOverride(Size availableSize) {
            resultSize = new Size(0, 0);
            foreach (UIElement child in Children) {
                child.Measure(availableSize);
                resultSize.Width = Math.Max(resultSize.Width, child.DesiredSize.Width);
                resultSize.Height = Math.Max(resultSize.Height, child.DesiredSize.Height);
            }
            resultSize.Width = double.IsPositiveInfinity(availableSize.Width) ?
                resultSize.Width : availableSize.Width;
            resultSize.Height = double.IsPositiveInfinity(availableSize.Height) ?
                resultSize.Height : availableSize.Height;
            return resultSize;
        }

        protected override Size ArrangeOverride(Size finalSize) {
            foreach (UIElement child in InternalChildren) {
                double xDisplay, yDisplay, width, height;
                if (GetAxesWidth(child) == 0) {
                    width = child.DesiredSize.Width;
                    height = child.DesiredSize.Height;
                    xDisplay = (GetX(child) - XMin) / (XMax - XMin) * resultSize.Width - width / 2;
                    yDisplay = (GetY(child) - YMin) / (YMax - YMin) * resultSize.Height - height / 2;
                } else {
                    width = GetAxesWidth(child) / Math.Abs(XMax - XMin) * resultSize.Width;
                    height = GetAxesHeight(child) / Math.Abs(YMax - YMin) * resultSize.Height;
                    xDisplay = (GetX(child) - XMin) / (XMax - XMin) * resultSize.Width - width / 2;
                    yDisplay = (GetY(child) - YMin) / (YMax - YMin) * resultSize.Height - height / 2;
                }
                child.Arrange(new Rect(xDisplay, yDisplay, width, height));
            }
            return finalSize;
        }
    }

    public class AxesMouseButtonEventArgs : RoutedEventArgs {
        public double XPositionInSourcePixels { get; set; }
        public double YPositionInSourcePixels { get; set; }

        public AxesMouseButtonEventArgs(RoutedEvent routedEvent, double xPositionInSourcePixels, double yPositionInSourcePixels) {
            RoutedEvent = routedEvent;
            XPositionInSourcePixels = xPositionInSourcePixels;
            YPositionInSourcePixels = yPositionInSourcePixels;
        }
    }
}


text:
My professional website/blog.

Questions/comments @RallidaeRule and aurielfournier@gmail.com


text:
import axios from 'axios';
import History from '../history.js';
import {
    AUTH_USER,
    UNAUTH_USER,
    AUTH_ERROR,
    FETCH_FEATURE
} from './types';

const ROOT_URL = 'http://localhost:3090';

export const signinUser = ({ email, password }) => {
    return (dispatch) => {
        // submit email/password to the server
        axios.post(`${ROOT_URL}/signin`, { email, password })
            .then(response => {

                // if request is good...
                // - update state to indicate user is authenticated
                dispatch({ type: AUTH_USER });

                // - save the jwt token
                localStorage.setItem('token', response.data.token);

                // - redirect to the route '/feature'
                History.push('/feature');

            }).catch(() => {
                // if request is bad...
                // - show an error to the user
                dispatch(authError('Bad Login Info'));
            });
    };
};

export const signupUser = ({ email, password }) => {
    return (dispatch) => {
        // submit email/password to the server
        axios.post(`${ROOT_URL}/signup`, { email, password })
            .then(response => {
                dispatch({ type: AUTH_USER });
                localStorage.setItem('token', response.data.token);
                History.push('/feature');
            })
            .catch(err => {
                dispatch(authError(err.response.data.error));
            });
    };
};

export const authError = (error) => {
    return {
        type: AUTH_ERROR,
        payload: error
    };
};

export const signoutUser = () => {
    localStorage.removeItem('token')
    return { type: UNAUTH_USER };
};

export const fetchFeature = () => {
    return (dispatch) => {
        axios.get(ROOT_URL, {
            headers: { authorization: localStorage.getItem('token') }
        })
        .then(response =>{
            dispatch({
                type: FETCH_FEATURE,
                payload: response.data
             });
        });
    };
};


text:
(function($) {
  var defaults;
  $.event.fix = (function(originalFix) {
    return function(event) {
      event = originalFix.apply(this, arguments);
      if (event.type.indexOf('copy') === 0 || event.type.indexOf('paste') === 0) {
        event.clipboardData = event.originalEvent.clipboardData;
      }
      return event;
    };
  })($.event.fix);
  defaults = {
    callback: $.noop,
    matchType: /image.*/
  };
  return $.fn.pasteImageReader = function(options) {
    if (typeof options === "function") {
      options = {
        callback: options
      };
    }
    options = $.extend({}, defaults, options);
    return this.each(function() {
      var $this, element;
      element = this;
      $this = $(this);
      return $this.bind('paste', function(event) {
        var clipboardData, found;
        found = false;
        clipboardData = event.clipboardData;
        return Array.prototype.forEach.call(clipboardData.types, function(type, i) {
          var file, reader;
          if (found) {
            return;
          }
          if (type.match(options.matchType) || clipboardData.items[i].type.match(options.matchType)) {
            file = clipboardData.items[i].getAsFile();
            reader = new FileReader();
            reader.onload = function(evt) {
              return options.callback.call(element, {
                dataURL: evt.target.result,
                event: evt,
                file: file,
                name: file.name
              });
            };
            reader.readAsDataURL(file);
            return found = true;
          }
        });
      });
    });
  };
})(jQuery);


text:
/*
 * Hibernate Validator, declare and validate application constraints
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
 */
package org.hibernate.validator.test.internal.engine.methodvalidation.cascadedgroupvalidation;

import jakarta.validation.constraints.NotNull;

/**
 * @author Jan-Willem Willebrands
 */
public class Entity {
	@NotNull(groups = ValidationGroup1.class)
	String value1;

	@NotNull(groups = ValidationGroup2.class)
	String value2;

	public Entity(String value1, String value2) {
		this.value1 = value1;
		this.value2 = value2;
	}
}


text:
using System.Collections.Concurrent;
using System.Linq.Expressions;
using ECQRS.Commons.Events;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using ECQRS.Commons;
using ECQRS.Commons.Commands;

namespace ECQRS.Commons.Domain
{
    public abstract class AggregateRoot
    {
        private readonly List<Event> _changes = new List<Event>();
        private readonly static ConcurrentDictionary<Type, Dictionary<Type, Action<AggregateRoot, Event>>> _eventHandlers =
            new ConcurrentDictionary<Type, Dictionary<Type, Action<AggregateRoot, Event>>>();

        private Guid _lastCorrelationId;

        protected Guid LastCommand
        {
            get
            {
                return _lastCorrelationId;
            }
        }

        public void SetLastCommand(Command lastCommand)
        {
            _lastCorrelationId = lastCommand.CorrelationId;
        }

        protected AggregateRoot()
        {
            if (!_eventHandlers.ContainsKey(GetType()))
            {
                var methods = GetType()
                    .GetMethods(BindingFlags.FlattenHierarchy | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)
                    .Where(m => m.Name == "Apply" && m.GetParameters().Length == 1).ToList();
                var newDictionary = new Dictionary<Type, Action<AggregateRoot, Event>>();
                foreach (var method in methods)
                {
                    var paramType = method.GetParameters()[0].ParameterType;
                    var lambda = this.BuildAction(method);

                    newDictionary.Add(paramType, lambda);
                    _eventHandlers[GetType()] = newDictionary;
                }
            }
        }

        public int Version { get; internal set; }
        public abstract Guid Id { get; }
        public IEnumerable<Event> GetUncommittedChanges()
        {
            return _changes;
        }

        public void MarkChangesAsCommitted()
        {
            _changes.Clear();
        }

        public void LoadsFromHistory(IEnumerable<Event> history)
        {
            Version = 1;
            foreach (var e in history)
            {
                ApplyChange(e, false);
            }
        }

        protected void ApplyChange(Event @event)
        {
            ApplyChange(@event, true);
        }

        // push atomic aggregate changes to local history for further processing (EventStore.SaveEvents)
        private void ApplyChange(Event theEvent, bool isNew)
        {
            if (_eventHandlers[GetType()].ContainsKey(theEvent.GetType()))
            {
                _eventHandlers[GetType()][theEvent.GetType()](this, theEvent);
                Version++;
            }

            if (isNew) _changes.Add(theEvent);
        }

        protected void Check(bool verify, Exception ex =null)
        {
            if (verify)
            {
                if (ex == null)
                {
                    throw new AggregateException();
                }
                throw ex;
            }
        }
    }
}


text:
<!DOCTYPE html>

    <title>Rvr overview interface</title>

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link rel="stylesheet" href="./stylesheets/app.css">

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

                <button class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navcol-1">Toggle navigation</button>

Lopende zaken

Open zaken

Afgeronde zaken

Nieuwe advocaat

Verwijderen van een advocaat

 Verwijderen van een advocaat

 Formulier

            <fieldset>
            <form action ="rvr_active.html">

 BSN van advocaat:

            <input type="text" name="ID" value="ID">

 Wachtwoord van administrator:

            <input type="text" name="wachtwoord" value="Wachtwoord">

 Reden:

            <select name="category">
              <option value="sele">Selecteer reden</option>
              <option value="ambt">Corrupt</option>
              <option value="arbont">Geen kwaliteit</option>
              <option value="best">Klachten</option>
              <option value="erf">Eigen Keuze</option>
            </select>

            <input type="submit" class="btn" value="Versturen">
          </fieldset>
            </form>


text:
package packets

import (
	"bytes"
	"encoding/binary"
	"errors"
	"fmt"
	"io"
)

//ControlPacket defines the interface for structs intended to hold
//decoded MQTT packets, either from being read or before being
//written
type ControlPacket interface {
	Write(io.Writer) error
	Unpack(io.Reader) error
	String() string
	Details() Details
}

//PacketNames maps the constants for each of the MQTT packet types
//to a string representation of their name.
var PacketNames = map[uint8]string{
	1:  "CONNECT",
	2:  "CONNACK",
	3:  "PUBLISH",
	4:  "PUBACK",
	5:  "PUBREC",
	6:  "PUBREL",
	7:  "PUBCOMP",
	8:  "SUBSCRIBE",
	9:  "SUBACK",
	10: "UNSUBSCRIBE",
	11: "UNSUBACK",
	12: "PINGREQ",
	13: "PINGRESP",
	14: "DISCONNECT",
}

//Below are the constants assigned to each of the MQTT packet types
const (
	Connect     = 1
	Connack     = 2
	Publish     = 3
	Puback      = 4
	Pubrec      = 5
	Pubrel      = 6
	Pubcomp     = 7
	Subscribe   = 8
	Suback      = 9
	Unsubscribe = 10
	Unsuback    = 11
	Pingreq     = 12
	Pingresp    = 13
	Disconnect  = 14
)

//Below are the const definitions for error codes returned by
//Connect()
const (
	Accepted                        = 0x00
	ErrRefusedBadProtocolVersion    = 0x01
	ErrRefusedIDRejected            = 0x02
	ErrRefusedServerUnavailable     = 0x03
	ErrRefusedBadUsernameOrPassword = 0x04
	ErrRefusedNotAuthorised         = 0x05
	ErrNetworkError                 = 0xFE
	ErrProtocolViolation            = 0xFF
)

//ConnackReturnCodes is a map of the error codes constants for Connect()
//to a string representation of the error
var ConnackReturnCodes = map[uint8]string{
	0:   "Connection Accepted",
	1:   "Connection Refused: Bad Protocol Version",
	2:   "Connection Refused: Client Identifier Rejected",
	3:   "Connection Refused: Server Unavailable",
	4:   "Connection Refused: Username or Password in unknown format",
	5:   "Connection Refused: Not Authorised",
	254: "Connection Error",
	255: "Connection Refused: Protocol Violation",
}

//ConnErrors is a map of the errors codes constants for Connect()
//to a Go error
var ConnErrors = map[byte]error{
	Accepted:                        nil,
	ErrRefusedBadProtocolVersion:    errors.New("Unnacceptable protocol version"),
	ErrRefusedIDRejected:            errors.New("Identifier rejected"),
	ErrRefusedServerUnavailable:     errors.New("Server Unavailable"),
	ErrRefusedBadUsernameOrPassword: errors.New("Bad user name or password"),
	ErrRefusedNotAuthorised:         errors.New("Not Authorized"),
	ErrNetworkError:                 errors.New("Network Error"),
	ErrProtocolViolation:            errors.New("Protocol Violation"),
}

//ReadPacket takes an instance of an io.Reader (such as net.Conn) and attempts
//to read an MQTT packet from the stream. It returns a ControlPacket
//representing the decoded MQTT packet and an error. One of these returns will
//always be nil, a nil ControlPacket indicating an error occurred.
func ReadPacket(r io.Reader) (cp ControlPacket, err error) {
	var fh FixedHeader
	b := make([]byte, 1)

	_, err = io.ReadFull(r, b)
	if err != nil {
		return nil, err
	}
	fh.unpack(b[0], r)
	cp = NewControlPacketWithHeader(fh)
	if cp == nil {
		return nil, errors.New("Bad data from client")
	}
	packetBytes := make([]byte, fh.RemainingLength)
	_, err = io.ReadFull(r, packetBytes)
	if err != nil {
		return nil, err
	}
	err = cp.Unpack(bytes.NewBuffer(packetBytes))
	return cp, err
}

//NewControlPacket is used to create a new ControlPacket of the type specified
//by packetType, this is usually done by reference to the packet type constants
//defined in packets.go. The newly created ControlPacket is empty and a pointer
//is returned.
func NewControlPacket(packetType byte) (cp ControlPacket) {
	switch packetType {
	case Connect:
		cp = &ConnectPacket{FixedHeader: FixedHeader{MessageType: Connect}}
	case Connack:
		cp = &ConnackPacket{FixedHeader: FixedHeader{MessageType: Connack}}
	case Disconnect:
		cp = &DisconnectPacket{FixedHeader: FixedHeader{MessageType: Disconnect}}
	case Publish:
		cp = &PublishPacket{FixedHeader: FixedHeader{MessageType: Publish}}
	case Puback:
		cp = &PubackPacket{FixedHeader: FixedHeader{MessageType: Puback}}
	case Pubrec:
		cp = &PubrecPacket{FixedHeader: FixedHeader{MessageType: Pubrec}}
	case Pubrel:
		cp = &PubrelPacket{FixedHeader: FixedHeader{MessageType: Pubrel, Qos: 1}}
	case Pubcomp:
		cp = &PubcompPacket{FixedHeader: FixedHeader{MessageType: Pubcomp}}
	case Subscribe:
		cp = &SubscribePacket{FixedHeader: FixedHeader{MessageType: Subscribe, Qos: 1}}
	case Suback:
		cp = &SubackPacket{FixedHeader: FixedHeader{MessageType: Suback}}
	case Unsubscribe:
		cp = &UnsubscribePacket{FixedHeader: FixedHeader{MessageType: Unsubscribe, Qos: 1}}
	case Unsuback:
		cp = &UnsubackPacket{FixedHeader: FixedHeader{MessageType: Unsuback}}
	case Pingreq:
		cp = &PingreqPacket{FixedHeader: FixedHeader{MessageType: Pingreq}}
	case Pingresp:
		cp = &PingrespPacket{FixedHeader: FixedHeader{MessageType: Pingresp}}
	default:
		return nil
	}
	return cp
}

//NewControlPacketWithHeader is used to create a new ControlPacket of the type
//specified within the FixedHeader that is passed to the function.
//The newly created ControlPacket is empty and a pointer is returned.
func NewControlPacketWithHeader(fh FixedHeader) (cp ControlPacket) {
	switch fh.MessageType {
	case Connect:
		cp = &ConnectPacket{FixedHeader: fh}
	case Connack:
		cp = &ConnackPacket{FixedHeader: fh}
	case Disconnect:
		cp = &DisconnectPacket{FixedHeader: fh}
	case Publish:
		cp = &PublishPacket{FixedHeader: fh}
	case Puback:
		cp = &PubackPacket{FixedHeader: fh}
	case Pubrec:
		cp = &PubrecPacket{FixedHeader: fh}
	case Pubrel:
		cp = &PubrelPacket{FixedHeader: fh}
	case Pubcomp:
		cp = &PubcompPacket{FixedHeader: fh}
	case Subscribe:
		cp = &SubscribePacket{FixedHeader: fh}
	case Suback:
		cp = &SubackPacket{FixedHeader: fh}
	case Unsubscribe:
		cp = &UnsubscribePacket{FixedHeader: fh}
	case Unsuback:
		cp = &UnsubackPacket{FixedHeader: fh}
	case Pingreq:
		cp = &PingreqPacket{FixedHeader: fh}
	case Pingresp:
		cp = &PingrespPacket{FixedHeader: fh}
	default:
		return nil
	}
	return cp
}

//Details struct returned by the Details() function called on
//ControlPackets to present details of the Qos and MessageID
//of the ControlPacket
type Details struct {
	Qos       byte
	MessageID uint16
}

//FixedHeader is a struct to hold the decoded information from
//the fixed header of an MQTT ControlPacket
type FixedHeader struct {
	MessageType     byte
	Dup             bool
	Qos             byte
	Retain          bool
	RemainingLength int
}

func (fh FixedHeader) String() string {
	return fmt.Sprintf("%s: dup: %t qos: %d retain: %t rLength: %d", PacketNames[fh.MessageType], fh.Dup, fh.Qos, fh.Retain, fh.RemainingLength)
}

func boolToByte(b bool) byte {
	switch b {
	case true:
		return 1
	default:
		return 0
	}
}

func (fh *FixedHeader) pack() bytes.Buffer {
	var header bytes.Buffer
	header.WriteByte(fh.MessageType<<4 | boolToByte(fh.Dup)<<3 | fh.Qos<<1 | boolToByte(fh.Retain))
	header.Write(encodeLength(fh.RemainingLength))
	return header
}

func (fh *FixedHeader) unpack(typeAndFlags byte, r io.Reader) {
	fh.MessageType = typeAndFlags >> 4
	fh.Dup = (typeAndFlags>>3)&0x01 > 0
	fh.Qos = (typeAndFlags >> 1) & 0x03
	fh.Retain = typeAndFlags&0x01 > 0
	fh.RemainingLength = decodeLength(r)
}

func decodeByte(b io.Reader) byte {
	num := make([]byte, 1)
	b.Read(num)
	return num[0]
}

func decodeUint16(b io.Reader) uint16 {
	num := make([]byte, 2)
	b.Read(num)
	return binary.BigEndian.Uint16(num)
}

func encodeUint16(num uint16) []byte {
	bytes := make([]byte, 2)
	binary.BigEndian.PutUint16(bytes, num)
	return bytes
}

func encodeString(field string) []byte {
	fieldLength := make([]byte, 2)
	binary.BigEndian.PutUint16(fieldLength, uint16(len(field)))
	return append(fieldLength, []byte(field)...)
}

func decodeString(b io.Reader) string {
	fieldLength := decodeUint16(b)
	field := make([]byte, fieldLength)
	b.Read(field)
	return string(field)
}

func decodeBytes(b io.Reader) []byte {
	fieldLength := decodeUint16(b)
	field := make([]byte, fieldLength)
	b.Read(field)
	return field
}

func encodeBytes(field []byte) []byte {
	fieldLength := make([]byte, 2)
	binary.BigEndian.PutUint16(fieldLength, uint16(len(field)))
	return append(fieldLength, field...)
}

func encodeLength(length int) []byte {
	var encLength []byte
	for {
		digit := byte(length % 128)
		length /= 128
		if length > 0 {
			digit |= 0x80
		}
		encLength = append(encLength, digit)
		if length == 0 {
			break
		}
	}
	return encLength
}

func decodeLength(r io.Reader) int {
	var rLength uint32
	var multiplier uint32
	b := make([]byte, 1)
	for multiplier < 27 { //fix: Infinite '(digit & 128) == 1' will cause the dead loop
		io.ReadFull(r, b)
		digit := b[0]
		rLength |= uint32(digit&127) << multiplier
		if (digit & 128) == 0 {
			break
		}
		multiplier += 7
	}
	return int(rLength)
}


text:
Lab 3 Part1:

https://github.com/axptwig/lab3part1

Lab3 Part2:

https://github.com/axptwig/Spoon-Knife
https://github.com/axptwig/courseproject
http://imgur.com/rYgMQgj

Lab3 Part3:

https://github.com/mskmoorthy/spring2016pullreq

https://github.com/mskmoorthy/NewStory ( NEED PULL REQUEST )

http://imgur.com/2MHWwo0     gitk output


text:
#ifndef CHESSEVENT_H
#define CHESSEVENT_H

#include <QDataStream>

//  =============
//      Enums
//  =============

enum eEventType {
    // Special event types
    INITALIZE, // Event is used to send GameConfig data at connection
    // Solid event types
    MOVE,
    GAMEOVER,
    // Proposing event types
    OFFER,
    RESPOND
};

// whenever event hasn't any connections with the type, EMPTY is set

enum eGameoverType {
    EMPTY_GAMEOVER,
    RESIGN,
    CHECKMATE,
    STALEMATE
};

enum eOfferType {
    EMPTY_OFFER,
    TAKEBACK,
    DRAW
};

enum eRespondType {
    EMPTY_RESPOND,
    ACCEPT,
    DECLINE
};

//  ==================
//      ClassEvent
//  ==================

class ChessEvent {
public:
    ChessEvent(eEventType = MOVE, eGameoverType = EMPTY_GAMEOVER, eOfferType = EMPTY_OFFER, eRespondType = EMPTY_RESPOND);

    eEventType      getEventType()    const;
    eGameoverType   getGameoverType() const;
    eOfferType      getOfferType()    const;
    eRespondType    getRespondType()  const;

    friend QDataStream & operator << (QDataStream &arch, const ChessEvent & object)
    {
        arch << static_cast<quint32>(object.m_eventType);
        arch << static_cast<quint32>(object.m_gameoverType);
        arch << static_cast<quint32>(object.m_offerType);
        arch << static_cast<quint32>(object.m_respondType);
        return arch;
    }

    friend QDataStream & operator >> (QDataStream &arch, ChessEvent & object)
    {
        arch >> reinterpret_cast<quint32&>(object.m_eventType);
        arch >> reinterpret_cast<quint32&>(object.m_gameoverType);
        arch >> reinterpret_cast<quint32&>(object.m_offerType);
        arch >> reinterpret_cast<quint32&>(object.m_respondType);

        return arch;
    }

private:
    eEventType      m_eventType;
    eGameoverType   m_gameoverType;
    eOfferType      m_offerType;
    eRespondType    m_respondType;
};
Q_DECLARE_METATYPE(ChessEvent)

#endif//CHESSEVENT_H


text:
(function ($, window, undefined) {
  $.extend(true, window, {
    "iui": {
      "sheet": {
        "renderer": {}
      }
    }
  });

  var Renderer = iui.sheet.renderer.Date = function (cell) {
    cell = cell || {};
    var dateRenderer = "";
    var format = "yyyy-MM-dd";
    var dateTemp = "";

    if (!(this instanceof Renderer)) {
      return new Renderer(cell);
    }

    if (options.regional === "en") {
      format = "dd/MM/yyyy";
    }

    var currentDate = new Date(parseFloat(cell.value));

    dateTemp = format.replace(/(yyyy|yy|MM|dd|E|hh|mm|ss|a\/p)/gi, function (rFormat) {
      switch (rFormat) {
      case "yyyy":
        return currentDate.getFullYear();
      case "MM":
        return (currentDate.getMonth() + 1) < 10 ? "0" + (currentDate.getMonth() + 1) : (currentDate.getMonth() + 1);
      case "yy":
        return (currentDate.getFullYear() % 1000);
      case "dd":
        return currentDate.getDate() < 10 ? "0" + (currentDate.getDate()) : (currentDate.getDate());
      case "HH":
        return currentDate.getHours() < 10 ? "0" + (currentDate.getHours()) : (currentDate.getHours());
      case "hh":
        return ((h = currentDate.getHours() % 12) ? h : 12) < 10 ? "0" + h : h;
      case "mm":
        return currentDate.getMinutes() < 10 ? "0" + (currentDate.getMinutes()) : (currentDate.getMinutes());
      case "ss":
        return currentDate.getSeconds() < 10 ? "0" + (currentDate.getSeconds()) : (currentDate.getSeconds());
        /*
	   case "a/p": return cell.value.getHours() < 12 ? "오전" : "오후";
	   case "E": return weekName[cell.value.getDay()];
	   */
      default:
        return rFormat;
      }
    });

    return $('<span>').text(dateTemp)
      .wrap('<div>').parent()
      .attr('title', dateTemp);
  };

  $.extend(Renderer.prototype, {

  });

}(jQuery, window));


text:
using System;
using System.Collections.Generic;
using System.Linq;
using Highway.Data.EventManagement;
using Highway.Data.Interceptors.Events;

namespace Highway.Data.Repositories
{
    public class DomainRepository<T> : Repository, IDomainRepository<T> where T : class, IDomain
    {
        private EventManager<T> _eventManager;

        public IDomainContext<T> DomainContext
        {
            get { return (IDomainContext<T>) base.Context;}
        }

        public DomainRepository(IDomainContext<T> context, IDomain domain) : base(context)
        {
            _eventManager = new EventManager<T>(this);

            if (domain.Events == null)
            {
                return;
            }

            foreach (var @event in domain.Events)
            {
                _eventManager.Register(@event);
            }
        }

        public override IEnumerable<T1> Find<T1>(IQuery<T1> query)
        {
            OnBeforeQuery(new BeforeQuery(query));
            var result =  base.Find(query);
            OnAfterQuery(new AfterQuery(result));
            return result;
        }

        public override IEnumerable<TProjection> Find<TSelection, TProjection>(IQuery<TSelection, TProjection> query)
        {
            OnBeforeQuery(new BeforeQuery(query));
            var results = base.Find(query);
            OnAfterQuery(new AfterQuery(results));
            return results;
        }

        public override T1 Find<T1>(IScalar<T1> query)
        {
            OnBeforeScalar(new BeforeScalar());
            var result = base.Find(query);
            OnAfterScalar(new AfterScalar());
            return result;
        }

        public override void Execute(ICommand command)
        {
            OnBeforeCommand(new BeforeCommand());
            base.Execute(command);
            OnAfterCommand(new AfterCommand());
        }

        public event EventHandler<BeforeQuery> BeforeQuery;

        protected virtual void OnBeforeQuery(BeforeQuery e)
        {
            EventHandler<BeforeQuery> handler = BeforeQuery;
            if (handler != null) handler(this, e);
        }

        public event EventHandler<BeforeScalar> BeforeScalar;

        protected virtual void OnBeforeScalar(BeforeScalar e)
        {
            EventHandler<BeforeScalar> handler = BeforeScalar;
            if (handler != null) handler(this, e);
        }

        public event EventHandler<BeforeCommand> BeforeCommand;

        protected virtual void OnBeforeCommand(BeforeCommand e)
        {
            EventHandler<BeforeCommand> handler = BeforeCommand;
            if (handler != null) handler(this, e);
        }

        public event EventHandler<AfterQuery> AfterQuery;

        protected virtual void OnAfterQuery(AfterQuery e)
        {
            EventHandler<AfterQuery> handler = AfterQuery;
            if (handler != null) handler(this, e);
        }

        public event EventHandler<AfterScalar> AfterScalar;

        protected virtual void OnAfterScalar(AfterScalar e)
        {
            EventHandler<AfterScalar> handler = AfterScalar;
            if (handler != null) handler(this, e);
        }

        public event EventHandler<AfterCommand> AfterCommand;

        protected virtual void OnAfterCommand(AfterCommand e)
        {
            EventHandler<AfterCommand> handler = AfterCommand;
            if (handler != null) handler(this, e);
        }
    }
}


text:
[![Build Status][travis-img]][travis] [![Coverage Status][coverage-img]][coverage] [![Hex Version][hex-img]][hex] [![License][license-img]][license]

[coverage-img]: https://coveralls.io/repos/he9qi/ueberauth_weibo/badge.svg?branch=master&service=github
[coverage]: https://coveralls.io/github/he9qi/ueberauth_weibo?branch=master
[travis-img]: https://travis-ci.org/he9qi/ueberauth_weibo.svg?branch=master
[travis]: https://travis-ci.org/he9qi/ueberauth_weibo
[hex-img]: https://img.shields.io/hexpm/v/ueberauth_weibo.svg
[hex]: https://hex.pm/packages/ueberauth_weibo
[license-img]: http://img.shields.io/badge/license-MIT-brightgreen.svg
[license]: http://opensource.org/licenses/MIT

> Weibo OAuth2 strategy for Überauth.

## Installation

  1. Setup your application at [Weibo Open Platform](http://open.weibo.com).

  2. Add `:ueberauth_weibo` to your list of dependencies in `mix.exs`:

        def deps do
          [{:ueberauth_weibo, "~> 0.0.3"}]
        end

  3. Add the strategy to your application:

        def application do
          [applications: [:ueberauth_weibo]]
        end

  4. Add Weibo to your Überauth configuration:

      ```elixir
      config :ueberauth, Ueberauth,
        providers: [
          weibo: {Ueberauth.Strategy.Weibo, []}
        ]
      ```

  5.  Update your provider configuration:

      ```elixir
      config :ueberauth, Ueberauth.Strategy.Weibo.OAuth,
        client_id: System.get_env("WEIBO_CLIENT_ID"),
        client_secret: System.get_env("WEIBO_CLIENT_SECRET")
      ```

  6.  Include the Überauth plug in your controller:

      ```elixir
      defmodule MyApp.AuthController do
        use MyApp.Web, :controller
        plug Ueberauth
        ...
      end
      ```

  7.  Create the request and callback routes if you haven't already:

      ```elixir
      scope "/auth", MyApp do
        pipe_through :browser

        get "/:provider", AuthController, :request
        get "/:provider/callback", AuthController, :callback
      end
      ```

  8. You controller needs to implement callbacks to deal with `Ueberauth.Auth` and `Ueberauth.Failure` responses.

  For an example implementation see the [Überauth Example](https://github.com/ueberauth/ueberauth_example) application.

## Calling

    Depending on the configured url you can initial the request through:

        /auth/weibo

## License

  Please see [LICENSE](https://github.com/he9qi/ueberauth_weibo/blob/master/LICENSE) for licensing details.


text:
CCControlExtension
=================
CCControlExtension is an open-source library which provides a lot of convenient control objects for __Cocos2D v2.x__ for iPhone and Mac such as buttons, sliders or many more... ([see the exhaustive list](#available-control-list))

All these controls are subclasses of CCControl, which is inspired by the UIControl API from the UIKit of CocoaTouch. The main goal of CCControl is to simplify the creation of control objects in Cocos2D by providing an interface and a base implementation ala UIKit. I.e that this class manages the target-action pair registration and dispatches them to their targets when events occur.
The CCControl extensions also uses the power of blocks to dispatch the events in addition to the target/action pair.

*Note: The CCControlExtension's classes are ARC compatibles (e.g for use with Kobold2D)*

*Note2: the version for __Cocos2D v1.1__ is available in the [master branch](https://github.com/YannickL/CCControlExtension/tree/master)*

![](http://github.com/YannickL/CCControlExtension/raw/master/screenshots/cccontrolextension.png)

Available Control List
====================

  * [Button](http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCControlButton.html):
Intercepts touch events and sends an action message to a target object when tapped.
  * [Colour Picker](http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCControlColourPicker.html):
It's a very useful control tool to preview and test color values.
  * [Picker](http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCControlPicker.html):
Use a spinning-wheel or slot-machine metaphor to show one set of values.
  * [Potentiometer](http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCControlPotentiometer.html):
Use a circular representation to show and select a single value from a continuous range of value.
  * [Slider](http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCControlSlider.html):
Use a linear representation to show and select a single value from a continuous range of values.
  * [Stepper](http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCControlStepper.html):
User interface for incrementing or decrementing a value.
  * [Switch](http://yannickloriot.com/library/ios/cccontrolextension/Classes/CCControlSwitch.html):
Useful to create and manage On/Off buttons, like for example, in the option menus for volume as example.

How to use it
====================
- Include the CCControlExtension folder into your project
- In the needed files include this header:

        #import "CCControlExtension.h"

The `CCControlExtension.h` includes all the already controls.
There are various [examples][] to understand how the controls works and to use pre-made visual for each of them.

For more informations you can check [my blog][] and the [api documentation][].

Getting started with the source
=====================
The project already include a version of Cocos2D for its examples, so you just need to download the source like the following instructions:

```
    git clone git@github.com:YannickL/CCControlExtension.git

    # to get latest stable source from master branch, use this command:
    cd CCControlExtension
    git checkout master-v2

    # to update the sources
    git pull
```

Build & Runtime Requirements
====================

  * Xcode 4.2 or newer (LLVM 3.0 or newer)
  * iOS 4.0 or newer for iOS games
  * Mac OS X 10.6 or newer for Mac games

License (MIT)
====================
As well as Cocos2D for iPhone, CCControlExtension is licensed under the MIT License:

Copyright (c) 2013 - Yannick Loriot and contributors
(see each file to see the different copyright owners)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

You can download *cocos2d-for-iphone* here: https://github.com/cocos2d/cocos2d-iphone

[my blog]: http://yannickloriot.com/2013/02/the-control-extension-for-cocos2d/
[examples]: https://github.com/YannickL/CCControlExtension/tree/master-v2/CCControlExtensionExamples
[api documentation]: http://yannickloriot.com/library/ios/cccontrolextension/


text:
require 'pathname'
require 'uri'

require 'middleman-core/contracts'

# rubocop:disable ModuleLength
module Middleman
  module Util
    include Contracts

    module_function

    # Normalize a path to not include a leading slash
    # @param [String] path
    # @return [String]
    Contract String => String
    def normalize_path(path)
      # The tr call works around a bug in Ruby's Unicode handling
      ::URI.decode(path).sub(%r{^/}, '').tr('', '')
    end

    # This is a separate method from normalize_path in case we
    # change how we normalize paths
    Contract String => String
    def strip_leading_slash(path)
      path.sub(%r{^/}, '')
    end

    # Get the path of a file of a given type
    #
    # @param [Middleman::Application] app The app.
    # @param [Symbol] kind The type of file
    # @param [String, Symbol] source The path to the file
    # @param [Hash] options Data to pass through.
    # @return [String]
    Contract ::Middleman::Application, Symbol, Or[String, Symbol], Hash => String
    def asset_path(app, kind, source, options={})
      return source if source.to_s.include?('//') || source.to_s.start_with?('data:')

      asset_folder = case kind
      when :css
        app.config[:css_dir]
      when :js
        app.config[:js_dir]
      when :images
        app.config[:images_dir]
      when :fonts
        app.config[:fonts_dir]
      else
        kind.to_s
      end

      source = source.to_s.tr(' ', '')
      ignore_extension = (kind == :images || kind == :fonts) # don't append extension
      source << ".#{kind}" unless ignore_extension || source.end_with?(".#{kind}")
      asset_folder = '' if source.start_with?('/') # absolute path

      asset_url(app, source, asset_folder, options)
    end

    # Get the URL of an asset given a type/prefix
    #
    # @param [String] path The path (such as "photo.jpg")
    # @param [String] prefix The type prefix (such as "images")
    # @param [Hash] options Data to pass through.
    # @return [String] The fully qualified asset url
    Contract ::Middleman::Application, String, String, Hash => String
    def asset_url(app, path, prefix='', options={})
      # Don't touch assets which already have a full path
      return path if path.include?('//') || path.start_with?('data:')

      if options[:relative] && !options[:current_resource]
        raise ArgumentError, '#asset_url must be run in a context with current_resource if relative: true'
      end

      uri = URI(path)
      path = uri.path

      # Ensure the url we pass into find_resource_by_destination_path is not a
      # relative path, since it only takes absolute url paths.
      dest_path = url_for(app, path, options.merge(relative: false))

      result = if resource = app.sitemap.find_resource_by_destination_path(dest_path)
        resource.url
      else
        path = ::File.join(prefix, path)
        if resource = app.sitemap.find_resource_by_path(path)
          resource.url
        else
          ::File.join(app.config[:http_prefix], path)
        end
      end

      final_result = ::URI.encode(relative_path_from_resource(options[:current_resource], result, options[:relative]))

      result_uri = URI(final_result)
      result_uri.query = uri.query
      result_uri.fragment = uri.fragment
      result_uri.to_s
    end

    # Given a source path (referenced either absolutely or relatively)
    # or a Resource, this will produce the nice URL configured for that
    # path, respecting :relative_links, directory indexes, etc.
    Contract ::Middleman::Application, Or[String, Symbol, ::Middleman::Sitemap::Resource], Hash => String
    def url_for(app, path_or_resource, options={})
      if path_or_resource.is_a?(String) || path_or_resource.is_a?(Symbol)
        r = app.sitemap.find_resource_by_page_id(path_or_resource)
        path_or_resource = r if r
      end

      # Handle Resources and other things which define their own url method
      url = if path_or_resource.respond_to?(:url)
        path_or_resource.url
      else
        path_or_resource.dup
      end

      # Try to parse URL
      begin
        uri = URI(url)
      rescue ::URI::InvalidURIError
        # Nothing we can do with it, it's not really a URI
        return url
      end

      relative = options[:relative]
      raise "Can't use the relative option with an external URL" if relative && uri.host

      # Allow people to turn on relative paths for all links with
      # set :relative_links, true
      # but still override on a case by case basis with the :relative parameter.
      effective_relative = relative || false
      effective_relative = true if relative.nil? && app.config[:relative_links]

      # Try to find a sitemap resource corresponding to the desired path
      this_resource = options[:current_resource]

      if path_or_resource.is_a?(::Middleman::Sitemap::Resource)
        resource = path_or_resource
        resource_url = url
      elsif this_resource && uri.path && !uri.host
        # Handle relative urls
        url_path = Pathname(uri.path)
        current_source_dir = Pathname('/' + this_resource.path).dirname
        url_path = current_source_dir.join(url_path) if url_path.relative?
        resource = app.sitemap.find_resource_by_path(url_path.to_s)
        if resource
          resource_url = resource.url
        else
          # Try to find a resource relative to destination paths
          url_path = Pathname(uri.path)
          current_source_dir = Pathname('/' + this_resource.destination_path).dirname
          url_path = current_source_dir.join(url_path) if url_path.relative?
          resource = app.sitemap.find_resource_by_destination_path(url_path.to_s)
          resource_url = resource.url if resource
        end
      elsif options[:find_resource] && uri.path && !uri.host
        resource = app.sitemap.find_resource_by_path(uri.path)
        resource_url = resource.url if resource
      end

      if resource
        uri.path = if this_resource
          ::URI.encode(relative_path_from_resource(this_resource, resource_url, effective_relative))
        else
          resource_url
        end
      end

      # Support a :query option that can be a string or hash
      if query = options[:query]
        uri.query = query.respond_to?(:to_param) ? query.to_param : query.to_s
      end

      # Support a :fragment or :anchor option just like Padrino
      fragment = options[:anchor] || options[:fragment]
      uri.fragment = fragment.to_s if fragment

      # Finally make the URL back into a string
      uri.to_s
    end

    # Expand a path to include the index file if it's a directory
    #
    # @param [String] path Request path/
    # @param [Middleman::Application] app The requesting app.
    # @return [String] Path with index file if necessary.
    Contract String, ::Middleman::Application => String
    def full_path(path, app)
      resource = app.sitemap.find_resource_by_destination_path(path)

      unless resource
        # Try it with /index.html at the end
        indexed_path = ::File.join(path.sub(%r{/$}, ''), app.config[:index_file])
        resource = app.sitemap.find_resource_by_destination_path(indexed_path)
      end

      if resource
        '/' + resource.destination_path
      else
        '/' + normalize_path(path)
      end
    end

    # Get a relative path to a resource.
    #
    # @param [Middleman::Sitemap::Resource] curr_resource The resource.
    # @param [String] resource_url The target url.
    # @param [Boolean] relative If the path should be relative.
    # @return [String]
    Contract ::Middleman::Sitemap::Resource, String, Bool => String
    def relative_path_from_resource(curr_resource, resource_url, relative)
      # Switch to the relative path between resource and the given resource
      # if we've been asked to.
      if relative
        # Output urls relative to the destination path, not the source path
        current_dir = Pathname('/' + curr_resource.destination_path).dirname
        relative_path = Pathname(resource_url).relative_path_from(current_dir).to_s

        # Put back the trailing slash to avoid unnecessary Apache redirects
        if resource_url.end_with?('/') && !relative_path.end_with?('/')
          relative_path << '/'
        end

        relative_path
      else
        resource_url
      end
    end

    # Takes a matcher, which can be a literal string
    # or a string containing glob expressions, or a
    # regexp, or a proc, or anything else that responds
    # to #match or #call, and returns whether or not the
    # given path matches that matcher.
    #
    # @param [String, #match, #call] matcher A matcher String, RegExp, Proc, etc.
    # @param [String] path A path as a string
    # @return [Boolean] Whether the path matches the matcher
    Contract PATH_MATCHER, String => Bool
    def path_match(matcher, path)
      case
      when matcher.is_a?(String)
        if matcher.include? '*'
          ::File.fnmatch(matcher, path)
        else
          path == matcher
        end
      when matcher.respond_to?(:match)
        !!(path =~ matcher)
      when matcher.respond_to?(:call)
        matcher.call(path)
      else
        ::File.fnmatch(matcher.to_s, path)
      end
    end
  end
end


text:
<?php

/**
 * MINI - an extremely simple naked PHP application
 *
 * @package mini
 * @author Panique
 * @link http://www.php-mini.com
 * @link https://github.com/panique/mini/
 * @license http://opensource.org/licenses/MIT MIT License
 */

// TODO get rid of this and work with namespaces + composer's autoloader

// set a constant that holds the project's folder path, like "/var/www/".
// DIRECTORY_SEPARATOR adds a slash to the end of the path
define('ROOT', dirname(__DIR__) . DIRECTORY_SEPARATOR);
// set a constant that holds the project's "application" folder, like "/var/www/application".
define('APP', ROOT . 'application' . DIRECTORY_SEPARATOR);

// This is the (totally optional) auto-loader for Composer-dependencies (to load tools into your project).
// If you have no idea what this means: Don't worry, you don't need it, simply leave it like it is.
if (file_exists(ROOT . 'vendor/autoload.php')) {
    require ROOT . 'vendor/autoload.php';
}

session_start();

// load application config (error reporting etc.)
require APP . '/config/config.php';

// FOR DEVELOPMENT: this loads PDO-debug, a simple function that shows the SQL query (when using PDO).
// If you want to load pdoDebug via Composer, then have a look here: https://github.com/panique/pdo-debug
require APP . '/libs/helper.php';

// load application class
require APP . '/core/application.php';
require APP . '/core/controller.php';

// start the application
$app = new Application();


text:
<?php
/**
 * Scripts and stylesheets
 *
 * Enqueue stylesheets in the following order:
 * 1. /theme/assets/css/main.css
 *
 * Enqueue scripts in the following order:
 * 1. jquery-1.11.1.min.js via Google CDN
 * 2. /theme/assets/js/vendor/modernizr.min.js
 * 3. /theme/assets/js/scripts.js
 *
 * Google Analytics is loaded after enqueued scripts if:
 * - An ID has been defined in config.php
 * - You're not logged in as an administrator
 */
function roots_scripts() {
  /**
   * The build task in Grunt renames production assets with a hash
   * Read the asset names from assets-manifest.json
   */
  if (WP_ENV === 'development') {
    $assets = array(
      'css'       => '/assets/css/main.css',
      'js'        => '/assets/js/scripts.js',
      'modernizr' => '/assets/vendor/modernizr/modernizr.js',
      'jquery'    => '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.js',
      'jquerymigrate' => '//code.jquery.com/jquery-migrate-1.2.1.min.js',
      'fotoramacss'  => '//cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.css',
      'fotoramajs'  => '//cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.js',
      'bs5col' => '/assets/vendor/bootstrap-5-columns/dist/bootstrap-5-columns.css',
      'scrolltofixed' => '/assets/js/plugins/jquery-scrolltofixed-min.js'
    );
  } else {
    $get_assets = file_get_contents(get_template_directory() . '/assets/manifest.json');
    $assets     = json_decode($get_assets, true);
    $assets     = array(
      'css'       => '/assets/css/main.min.css?' . $assets['assets/css/main.min.css']['hash'],
      'js'        => '/assets/js/scripts.min.js?' . $assets['assets/js/scripts.min.js']['hash'],
      'modernizr' => '/assets/js/vendor/modernizr.min.js',
      'jquery'    => '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js',
      'jquerymigrate' => '//code.jquery.com/jquery-migrate-1.2.1.min.js',
      'fotoramacss'  => '//cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.css',
      'fotoramajs'  => '//cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.3/fotorama.js',
      'bs5col' => '/assets/vendor/bootstrap-5-columns/dist/bootstrap-5-columns.min.css',
      'scrolltofixed' => '/assets/js/plugins/jquery-scrolltofixed-min.js'
    );
  }

  wp_enqueue_style('roots_css', get_template_directory_uri() . $assets['css'], false, null);
  wp_enqueue_style('fotoramacss', $assets['fotoramacss'], false, null);
  wp_enqueue_style('bs5col', get_template_directory_uri() . $assets['bs5col'], false, null);

  /**
   * jQuery is loaded using the same method from HTML5 Boilerplate:
   * Grab Google CDN's latest jQuery with a protocol relative URL; fallback to local if offline
   * It's kept in the header instead of footer to avoid conflicts with plugins.
   */
  if (!is_admin() && current_theme_supports('jquery-cdn')) {
    wp_deregister_script('jquery');
    wp_register_script('jquery', $assets['jquery'], array(), null, true);
    add_filter('script_loader_src', 'roots_jquery_local_fallback', 10, 2);
  }

  if (is_single() && comments_open() && get_option('thread_comments')) {
    wp_enqueue_script('comment-reply');
  }

  wp_register_script('fotorama', $assets['fotoramajs'], array(), null, true);
  wp_register_script('jquery-migrate', $assets['jquerymigrate'], array(), null, true);

  wp_enqueue_script('modernizr', get_template_directory_uri() . $assets['modernizr'], array(), null, true);
  wp_enqueue_script('jquery');
  wp_enqueue_script('jquery-migrate');
  wp_enqueue_script('fotorama');
  wp_enqueue_script('scrolltofixed', get_template_directory_uri() . $assets['scrolltofixed'], array(), null, true);
  wp_enqueue_script('roots_js', get_template_directory_uri() . $assets['js'], array(), null, true);
}
add_action('wp_enqueue_scripts', 'roots_scripts', 100);

// http://wordpress.stackexchange.com/a/12450
function roots_jquery_local_fallback($src, $handle = null) {
  static $add_jquery_fallback = false;

  if ($add_jquery_fallback) {
    echo '<script>window.jQuery || document.write(\'<script src="' . get_template_directory_uri() . '/assets/vendor/jquery/dist/jquery.min.js?1.11.1"><\/script>\')</script>' . "\n";
    $add_jquery_fallback = false;
  }

  if ($handle === 'jquery') {
    $add_jquery_fallback = true;
  }

  return $src;
}
add_action('wp_head', 'roots_jquery_local_fallback');

/**
 * Google Analytics snippet from HTML5 Boilerplate
 *
 * Cookie domain is 'auto' configured. See: http://goo.gl/VUCHKM
 */
function roots_google_analytics() { ?>
<script>
  <?php if (WP_ENV === 'production') : ?>
    (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
    function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
    e=o.createElement(i);r=o.getElementsByTagName(i)[0];
    e.src='//www.google-analytics.com/analytics.js';
    r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
  <?php else : ?>
    function ga() {
      console.log('GoogleAnalytics: ' + [].slice.call(arguments));
    }
  <?php endif; ?>
  ga('create','<?php echo GOOGLE_ANALYTICS_ID; ?>','auto');ga('send','pageview');
</script>

<?php }
if (GOOGLE_ANALYTICS_ID && (WP_ENV !== 'production' || !current_user_can('manage_options'))) {
  add_action('wp_footer', 'roots_google_analytics', 20);
}


text:
package org.kie.eclipse.navigator.view.content;

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

import org.kie.eclipse.server.IKieSpaceHandler;
import org.kie.eclipse.server.IKieRepositoryHandler;
import org.kie.eclipse.server.IKieResourceHandler;

/**
 *
 */
public class SpaceNode extends ContainerNode<ServerNode> {

	/**
	 * @param parent
	 * @param name
	 */
	protected SpaceNode(ServerNode parent, IKieSpaceHandler space) {
		super(parent, space);
	}

	@Override
	protected List<? extends IContentNode<?>> createChildren() {
		clearHandlerChildren();
		load();
		List<RepositoryNode> children = new ArrayList<RepositoryNode>();
		if (handlerChildren!=null) {
			Iterator<? extends IKieResourceHandler> iter = handlerChildren.iterator();
			while (iter.hasNext()) {
				IKieResourceHandler h = iter.next();
				if (h instanceof IKieRepositoryHandler)
					children.add(new RepositoryNode(this,(IKieRepositoryHandler)h));
			}
		}
		return children;
	}

	@Override
	public boolean isResolved() {
		return true;
	}
}


text:
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
    xmlns:g='urn:import:com.google.gwt.user.client.ui'>

  <g:HTMLPanel ui:field="root">

GWT Hello World

    <form name="theForm" onsubmit="sayHelloButton.click(); return false;">
      <fieldset>
        Name
        <input name="name" ui:field="name" type="text" required="required" placeholder="Your Name"/>
        <g:Button ui:field="sayHelloButton" text="Say Hello"/><g:Label ui:field="result"/>
      </fieldset>
    </form>
  </g:HTMLPanel>

</ui:UiBinder>