text:
import pygame
from Gui import Box, Column, Row, BoxStack
import time
import os

class Challenge_Selector:
  def __init__(self, consoles, config):
    self.consoles = consoles
    self.config = config
    self.selectedconsole = 0
    pygame.init()
    for i in self.consoles:
      i.index = 0

  def get_challenge(self):
    self.screen = pygame.display.set_mode((0,0), pygame.RESIZABLE)
    self.width = self.screen.get_width()
    self.height = self.screen.get_height()
    self.draw()
    speak = False
    refresh = True
    while True:
      if refresh:
        self.draw()
        refresh=False
      for event in pygame.event.get():
        if event.type == pygame.VIDEORESIZE:
          refresh=True
          self.width, self.height = event.size
        if event.type == pygame.KEYDOWN:
          refresh = True
          speak = True
          if event.key == pygame.K_UP:
            self.consoles[self.selectedconsole].index -= 1
            if self.consoles[self.selectedconsole].index < 0:
              self.consoles[self.selectedconsole].index = 0
          elif event.key == pygame.K_DOWN:
            self.consoles[self.selectedconsole].index += 1
            if self.consoles[self.selectedconsole].index >= len(self.consoles[self.selectedconsole].challenges):
              self.consoles[self.selectedconsole].index = len(self.consoles[self.selectedconsole].challenges) - 1
          elif event.key == pygame.K_RIGHT:
            self.selectedconsole += 1
            if self.selectedconsole >= len(self.consoles):
              self.selectedconsole = len(self.consoles) - 1
          elif event.key == pygame.K_LEFT:
            self.selectedconsole -= 1
            if self.selectedconsole < 0:
              self.selectedconsole = 0
          elif event.key in [pygame.K_RETURN, pygame.K_a]:
            pygame.display.quit()
            return self.consoles[self.selectedconsole], self.consoles[self.selectedconsole].challenges[self.consoles[self.selectedconsole].index]
      self.screen.fill((0,0,0))

  def draw(self):
    wideBox = Box({'type':'rectangle'}, yposition='center', color=(0,0,255), ypadding=16)
    tallBox = Box({'type':'rectangle'}, xposition='center', color=(0,0,255), xpadding=16)
    c1 = Box({'type':'circle', 'radius':8}, yposition='top', xposition='left', color=(0,0,255))
    c2 = Box({'type':'circle', 'radius':8}, yposition='top', xposition='right', color=(0,0,255))
    c3 = Box({'type':'circle', 'radius':8}, yposition='bottom', xposition='left', color=(0,0,255))
    c4 = Box({'type':'circle', 'radius':8}, yposition='bottom', xposition='right', color=(0,0,255))
    blueBox = BoxStack([c1, c2, c3, c4, tallBox, wideBox])
    for i in self.consoles:
      consoleFont = pygame.font.SysFont("Monospace", 20)
      label = Box({'type':'text', 'text':i.name, 'font':consoleFont}, yposition='center', xposition="center", padding=5)
      if i == self.consoles[self.selectedconsole]:
        consoleFont = pygame.font.SysFont("Monospace", 22)
        label = Box({'type':'text', 'text':i.name, 'font':consoleFont}, yposition='center', xposition="center", padding=5, color=(255,0,0))
      i.tab = BoxStack([blueBox, label])

    listFont = pygame.font.SysFont("Monospace", 16)
    difficultyFont = pygame.font.SysFont("Monospace", 24)
    descriptionFont = pygame.font.SysFont("Monospace", 18)
    for i in self.consoles[self.selectedconsole].challenges:
      if i == self.consoles[self.selectedconsole].challenges[self.consoles[self.selectedconsole].index]:
        i.listItem = Box({'type':'text', 'text':i.readableName, 'font':listFont}, yposition='center', xposition='left', padding=5, color=(255,255,0))
      else:
        i.listItem = Box({'type':'text', 'text':i.readableName, 'font':listFont}, yposition='center', xposition='left', padding=5, color=(255,255,255))
      i.image = Box({'type':'image', 'path':i.image_path}, yposition='center', xposition='center', hard=True, height=360, width=480)
      i.difficultyBox = Box({'type':'text', 'text':i.difficulty, 'font':difficultyFont}, xposition='center')
      descriptionLines = []
      for j in i.description:
        descriptionLines.append(Box({'type':'text', 'text':j, 'font':descriptionFont}, hard=True, height=25))
      i.descriptionBox = Column(descriptionLines)

    banner = Box({'type':'image', 'path':self.config['banner_path']}, xposition='center', height=224, hard=True)
    tabrow = Row([x.tab for x in self.consoles], hard=True, height=50, padding=5)
    challengeList = Column([x.listItem for x in self.consoles[self.selectedconsole].challenges])
    challengeListBox = BoxStack([blueBox, challengeList])
    curr = self.consoles[self.selectedconsole].challenges[self.consoles[self.selectedconsole].index]
    info = Column([curr.image, curr.difficultyBox, curr.descriptionBox])
    infoBox = BoxStack([blueBox, info])
    bottomRow = Row([challengeListBox, infoBox])

    page = Column([banner, tabrow, bottomRow], mode='proportional', padding=0)

    page.draw((0,0), (self.width, self.height), self.screen)
    pygame.display.flip()


text:
require 'activeadmin'

ActiveAdmin::Namespace.class_eval do
  alias_method :old_register, :register

  def register(resource_class, options = {}, &block)
    config = find_or_build_resource(resource_class, options)

    # Register the resource
    register_resource_controller(config)

    if ActiveAdmin::VERSION =~ /^0\.[5-9]/
      ActiveAdmin::ResourceDSL.new(config).prepare_menu5
    else
      resource_dsl.prepare_menu(config)
    end

    config = old_register(resource_class, options, &block)
    config.controller.load_and_authorize_resource :class => resource_class
    config
  end
end

ActiveAdmin::DSL.class_eval do
  def prepare_menu(config)
    @config = config
    resource = controller.resource_class
    instance_eval do
      menu :if => proc{ can?(:read, resource) }
    end
  end

  def prepare_menu5
    resource = controller.resource_class
    instance_eval do
      menu :if => proc{ can?(:read, resource) }
    end
  end
end

CanCan::ControllerResource.class_eval do
  def collection_instance=(instance)
  end

  def resource_instance=(instance)
  end
end

redpajama_set_name: RedPajamaGithub


text:
<?php
define('ROOT', dirname(dirname(__FILE__)) ); //public/API/
include ROOT . '/config/includes.php'; 		//QJARVIS API
//

//CHAT
require 'qjchat_routes.php';
require 'qjchat.php';

//USES
use Ratchet\Server\IoServer;
use QJChat\Chat;

//ROUTES
Flight::route('/server', function(){
    Flight::setCrossDomainHeaders();

    require ROOT . '/vendor/autoload.php';
    $server = IoServer::factory(
        new Chat(),
        8080
    );
    $server->run();
});

Flight::route('/status', function(){
    Flight::setCrossDomainHeaders();
    $request = Flight::request();
    $res = array(
      "ok"=>true,
      "title"=> "QJarvis API | QJChat Status",
      );
    Flight::jsoncallback($res);
});

//
Flight::start();
?>


text:
package org.innovateuk.ifs.project.financecheck.controller;

import org.innovateuk.ifs.BaseControllerMockMVCTest;
import org.innovateuk.ifs.finance.resource.ProjectFinanceResource;
import org.innovateuk.ifs.finance.transactional.ProjectFinanceService;
import org.innovateuk.ifs.project.financechecks.controller.ProjectFinanceController;
import org.junit.Test;
import org.mockito.Mock;

import static org.innovateuk.ifs.commons.service.ServiceResult.serviceSuccess;
import static org.innovateuk.ifs.finance.builder.ProjectFinanceResourceBuilder.newProjectFinanceResource;
import static org.innovateuk.ifs.util.JsonMappingUtil.toJson;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.springframework.http.MediaType.APPLICATION_JSON;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

public class ProjectFinanceControllerTest extends BaseControllerMockMVCTest<ProjectFinanceController> {

    @Mock
    private ProjectFinanceService projectFinanceService;

    @Test
    public void financeDetails() throws Exception {
        ProjectFinanceResource projectFinanceResource = newProjectFinanceResource().build();

        when(projectFinanceService.financeChecksDetails(123L, 456L)).thenReturn(serviceSuccess(projectFinanceResource));

        mockMvc.perform(get("/project/{projectId}/organisation/{organisationId}/finance-details", "123", "456"))
                .andExpect(status().isOk())
                .andExpect(content().json(toJson(projectFinanceResource)));

        verify(projectFinanceService).financeChecksDetails(123L, 456L);
    }

    @Test
    public void updateFinanceDetails() throws Exception {
        ProjectFinanceResource projectFinance = newProjectFinanceResource().build();

        when(projectFinanceService.updateProjectFinance(argThat(received -> projectFinance.getId().equals(received.getId())))).thenReturn(serviceSuccess(projectFinance));

        mockMvc.perform(put("/project/project-finance")
                .contentType(APPLICATION_JSON)
                .content(toJson(projectFinance )))
                .andExpect(status().isOk())
                .andExpect(content().json(toJson(projectFinance)));
    }

    @Override
    protected ProjectFinanceController supplyControllerUnderTest() {
        return new ProjectFinanceController();
    }

}


text:
package com.rock.teachlibrary.utils;

import android.content.Context;

import java.io.File;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * Created by Rock on 2016/10/31.
 */
public class SDCardUtil {

    private static Context mContext;
    // 初始化工具
    public static void init(Context context){
        mContext = context;
    }
    /**
     * 制作一个 url 和 文件的映射关系
     * @param url
     * @return
     */
    public static File urlToPath(String url){
        String urlToPath = getCacheDir().getAbsolutePath() + File.separator + md5(url);
        return new File(urlToPath);
    }

    /**
     * 获取Apk的的缓存路径
     * @return   data/data/xxx/cache  + / + md5(url)
     */
    public static File getCacheDir(){
        if (mContext == null) {
            throw new NullPointerException("ImageLoader 未初始化");
        }
        return mContext.getCacheDir();
    }

    /**
     * MD5 是一种摘要算法
     * 类似于数字指纹,通常用来验证数据的完整性
     * 只要文件发生丝毫变化,md5值就会发生变化
     * 单向不可逆
     * MD5 会将输入内容转换为 128位的二进制 0,1
     * md.digest 之后 产出32位的16进制
     */
    public static String md5(String url){
        if (url == null) {
            return "";
        }
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            // 将要进行摘要的数据传递进来
            md5.update(url.getBytes());
            // 使用 digest方法,获取输入内容进行转换后的摘要信息
            byte[] digest = md5.digest();
            // 需要修改的字符串我们可以使用StringBuilder,StringBuffer
            // StringBuilder线程不安全,但是性能高
            StringBuilder sb = new StringBuilder();
            for (byte b : digest) {
                sb.append(String.format("%2x",b));
            }
            return sb.toString();
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return url;
    }

}


text:
<?php

namespace app\modules\backoffice\controllers;

use Yii;
use app\models\Page;
use yii\data\ActiveDataProvider;
use yii\filters\AccessControl;
use yii\helpers\FileHelper;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * PageController implements the CRUD actions for Page model.
 */
class PageController extends Controller
{
    /**
     * Returns a list of behaviors that this component should behave as.
     *
     * Child classes may override this method to specify the behaviors they want to behave as.
     *
     * The return value of this method should be an array of behavior objects or configurations
     * indexed by behavior names. A behavior configuration can be either a string specifying
     * the behavior class or an array of the following structure:
     *
     * ~~~
     * 'behaviorName' => [
     *     'class' => 'BehaviorClass',
     *     'property1' => 'value1',
     *     'property2' => 'value2',
     * ]
     * ~~~
     *
     * Note that a behavior class must extend from [[Behavior]]. Behavior names can be strings
     * or integers. If the former, they uniquely identify the behaviors. If the latter, the corresponding
     * behaviors are anonymous and their properties and methods will NOT be made available via the component
     * (however, the behaviors can still respond to the component's events).
     *
     * Behaviors declared in this method will be attached to the component automatically (on demand).
     *
     * @return array the behavior configurations.
     */
    public function behaviors ()
    {
        return array_merge([
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'actions' => [
                            'create',
                            'index',
                            'update',
                            'delete',
                            'view',
                        ],
                        'allow'   => true,
                        'roles'   => ['@'],
                    ],
                ],
            ],
            'verbs'  => [
                'class'   => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ], parent::behaviors());
    }

    /**
     * Lists all Page models.
     * @return mixed
     */
    public function actionIndex ()
    {
        $dataProvider = new ActiveDataProvider([
            'query' => Page::find(),
        ]);

        return $this->render('index', [
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single Page model.
     * @param integer $id
     * @return mixed
     */
    public function actionView ($id)
    {
        return $this->redirect(['/backoffice/page/update', 'id' => $id]);

        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new Page model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate ()
    {
        $model = new Page;

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('app', 'Page created'));
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model'        => $model,
                'templateList' => Page::templateList(),
            ]);
        }
    }

    /**
     * Updates an existing Page model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate ($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('app', 'Page saved'));
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model'        => $model,
                'templateList' => Page::templateList(),
            ]);
        }
    }

    /**
     * Deletes an existing Page model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete ($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the Page model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Page the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel ($id)
    {
        if (($model = Page::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));
        }
    }
}


text:
<?php

class EMS_Pay_Block_Redirect extends Mage_Core_Block_Template
{
    /**
     * @var EMS_Pay_Helper_Data
     */
    protected $_helper;

    /**
     * @inheritdoc
     */
    protected function _construct()
    {
        parent::_construct();
        $this->_helper = Mage::helper('ems_pay');
        $this->setTemplate('ems_pay/redirect.phtml');
    }

    /**
     * Retrieves redirect form action url
     *
     * @return string
     */
    public function getFormAction()
    {
        return $this->_getPaymentMethod()->getGatewayUrl();
    }

    /**
     * @return array
     */
    public function getFormFields()
    {
        return $this->_getPaymentMethod()->getRedirectFormFields();
    }

    /**
     * @return EMS_Pay_Model_Method_Abstract
     * @throws Exception
     */
    protected function _getPaymentMethod()
    {
        $paymentMethod = $this->_getOrder()->getPayment()->getMethodInstance();
        if (!$paymentMethod instanceof EMS_Pay_Model_Method_Abstract) {
            Mage::throwException($this->_helper->__('Payment method %s is not supported', get_class($paymentMethod)));
        }

        return $paymentMethod;
    }

    /**
     * @return Mage_Sales_Model_Order
     */
    protected function _getOrder()
    {
        return Mage::helper('ems_pay/checkout')->getLastRealOrder();
    }
}


text:
/*----------------------------

   Block R validation chaincode

----------------------------*/

package main

import (
	"fmt"
	"strconv"

	"github.com/hyperledger/fabric/core/chaincode/shim"
	pb "github.com/hyperledger/fabric/protos/peer"
)

// SimpleChaincode example simple Chaincode implementation
type SimpleChaincode struct {
}

func (t *SimpleChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response {
	fmt.Println("ex02 Init")
	_, args := stub.GetFunctionAndParameters()
	var A, B string    // Entities
	var Aval, Bval int // Asset holdings
	var err error

	if len(args) != 4 {
		return shim.Error("Incorrect number of arguments. Expecting 4")
	}

	// Initialize the chaincode
	A = args[0]
	Aval, err = strconv.Atoi(args[1])
	if err != nil {
		return shim.Error("Expecting integer value for asset holding")
	}
	B = args[2]
	Bval, err = strconv.Atoi(args[3])
	if err != nil {
		return shim.Error("Expecting integer value for asset holding")
	}
	fmt.Printf("Aval = %d, Bval = %d\n", Aval, Bval)

	// Write the state to the ledger
	err = stub.PutState(A, []byte(strconv.Itoa(Aval)))
	if err != nil {
		return shim.Error(err.Error())
	}

	err = stub.PutState(B, []byte(strconv.Itoa(Bval)))
	if err != nil {
		return shim.Error(err.Error())
	}

	return shim.Success(nil)
}

func (t *SimpleChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Response {
	fmt.Println("ex02 Invoke")
	function, args := stub.GetFunctionAndParameters()
	if function == "invoke" {
		// Make payment of X units from A to B
		return t.invoke(stub, args)
	} else if function == "delete" {
		// Deletes an entity from its state
		return t.delete(stub, args)
	} else if function == "query" {
		// the old "Query" is now implemtned in invoke
		return t.query(stub, args)
	}

	return shim.Error("Invalid invoke function name. Expecting \"invoke\" \"delete\" \"query\"")
}

// Transaction makes payment of X units from A to B
func (t *SimpleChaincode) invoke(stub shim.ChaincodeStubInterface, args []string) pb.Response {
	var A, B string    // Entities
	var Aval, Bval int // Asset holdings
	var X int          // Transaction value
	var err error

	if len(args) != 3 {
		return shim.Error("Incorrect number of arguments. Expecting 3")
	}

	A = args[0]
	B = args[1]

	// Get the state from the ledger
	// TODO: will be nice to have a GetAllState call to ledger
	Avalbytes, err := stub.GetState(A)
	if err != nil {
		return shim.Error("Failed to get state")
	}
	if Avalbytes == nil {
		return shim.Error("Entity not found")
	}
	Aval, _ = strconv.Atoi(string(Avalbytes))

	Bvalbytes, err := stub.GetState(B)
	if err != nil {
		return shim.Error("Failed to get state")
	}
	if Bvalbytes == nil {
		return shim.Error("Entity not found")
	}
	Bval, _ = strconv.Atoi(string(Bvalbytes))

	// Perform the execution
	X, err = strconv.Atoi(args[2])
	if err != nil {
		return shim.Error("Invalid transaction amount, expecting a integer value")
	}
	Aval = Aval - X
	Bval = Bval + X
	fmt.Printf("Aval = %d, Bval = %d\n", Aval, Bval)

	// Write the state back to the ledger
	err = stub.PutState(A, []byte(strconv.Itoa(Aval)))
	if err != nil {
		return shim.Error(err.Error())
	}

	err = stub.PutState(B, []byte(strconv.Itoa(Bval)))
	if err != nil {
		return shim.Error(err.Error())
	}

	return shim.Success(nil)
}

// Deletes an entity from state
func (t *SimpleChaincode) delete(stub shim.ChaincodeStubInterface, args []string) pb.Response {
	if len(args) != 1 {
		return shim.Error("Incorrect number of arguments. Expecting 1")
	}

	A := args[0]

	// Delete the key from the state in ledger
	err := stub.DelState(A)
	if err != nil {
		return shim.Error("Failed to delete state")
	}

	return shim.Success(nil)
}

// query callback representing the query of a chaincode
func (t *SimpleChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response {
	var A string // Entities
	var err error

	if len(args) != 1 {
		return shim.Error("Incorrect number of arguments. Expecting name of the person to query")
	}

	A = args[0]

	// Get the state from the ledger
	Avalbytes, err := stub.GetState(A)
	if err != nil {
		jsonResp := "{\"Error\":\"Failed to get state for " + A + "\"}"
		return shim.Error(jsonResp)
	}

	if Avalbytes == nil {
		jsonResp := "{\"Error\":\"Nil amount for " + A + "\"}"
		return shim.Error(jsonResp)
	}

//Avalbytes = []byte(strconv.Itoa(6))

	jsonResp := "{\"Name\":\"" + A + "\",\"Amount\":\"" + string(Avalbytes) + "\"}"
	fmt.Printf("Query Response:%s\n", jsonResp)
	return shim.Success(Avalbytes)
}

func main() {
	err := shim.Start(new(SimpleChaincode))
	if err != nil {
		fmt.Printf("Error starting Simple chaincode: %s", err)
	}
}


text:
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';

import { E2EImportsModule } from 'e2e-imports.module';

import { MessageControlsComponent } from './message-controls.component';

describe('MessageControlsComponent', () => {
    let component: MessageControlsComponent;
    let fixture: ComponentFixture<MessageControlsComponent>;

    beforeEach(
        waitForAsync(() => {
            TestBed.configureTestingModule({
                imports: [E2EImportsModule],
                declarations: [MessageControlsComponent]
            }).compileComponents();
        })
    );

    beforeEach(() => {
        fixture = TestBed.createComponent(MessageControlsComponent);
        component = fixture.componentInstance;
        fixture.detectChanges();
    });

    it('should create', () => {
        expect(component).toBeTruthy();
    });
});


text:
"""Collect node information post crash.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging
import os

import click

from treadmill import postmortem

_LOGGER = logging.getLogger(__name__)

def init():
    """Return top level command handler"""

    @click.command()
    @click.option('--treadmill-root', type=click.Path(exists=True),
                  envvar='TREADMILL_APPROOT', required=True,
                  help='Treadmill root path.')
    @click.option('--upload-user',
                  envvar='TREADMILL_ID', required=True,
                  help='Upload postmortem statistics with this user.')
    @click.option('--upload-url',
                  help='Upload postmortem statistics to this file url.')
    def collect(treadmill_root, upload_user, upload_url):
        """Collect Treadmill node data"""
        os.environ['TREADMILL_ID'] = upload_user
        postmortem.run(treadmill_root, upload_url)

    return collect


text:
chan_t* messages;
chan_t* signals;

int main()
{
    // Initialize channels.
    messages = chan_init(0);
    signals = chan_init(0);
    void *msg;

    // This is a non-blocking receive. If a value is available on messages,
    // select will take the messages (0) case with that value. If not, it will
    // immediately take the default case.
    switch(chan_select(&messages, 1, &msg, NULL, 0, NULL))
    {
        case 0:
            printf("received message %s\n", msg);
            break;
        default:
            printf("no message received\n");
    }

    // A non-blocking send works similarly.
    msg = "foo";
    switch(chan_select(NULL, 0, NULL, &messages, 1, &msg))
    {
        case 0:
            printf("sent message %s\n", msg);
            break;
        default:
            printf("no message sent\n");
    }

    // We can use multiple cases above the default clause to implement a
    // multi-way non-blocking select. Here we attempt non-blocking receives on
    // both messages and signals.
    chan_t* chans[2] = {messages, signals};
    switch(chan_select(chans, 2, &msg, NULL, 0, NULL))
    {
        case 0:
            printf("received message %s\n", msg);
            break;
        case 1:
            printf("received signal %s\n", msg);
            break;
        default:
            printf("no activity\n");
    }

    // Clean up channels.
    chan_dispose(messages);
    chan_dispose(signals);
}


text:
module UI{
	/*    --------------------------------------------------- *\
            [class] Checkbox()

            * Créer un checkbox *

    \*    --------------------------------------------------- */
    export class Checkbox extends GUI{

        checked: boolean;
        functionsToCallWhenCheck: any;

        /*    --------------------------------------------------- *\
                [function] constructor(x, y, width, height)

                * Quand on crée un checkbox *

                Return: nil
        \*    --------------------------------------------------- */
        constructor(x : number, y : number, width : number, height : number, ...rest : any[]){
            super();
            this.guiType = "checkbox";

            if (rest[0]) {
                this.setParent(rest[0]);
            }
            this.setPosition(x, y);

            this.setSize(width, height);

            this.checked = false;
            this.functionsToCallWhenCheck = [];

            var position = this.getPosition(false);
            this.renderElements[0] = new Render.Draw.Rectangle(position.x, position.y, width, height, "rgba(0,0,0,0.1)");
            this.renderElements[0].setDepth(10);
            for (var i = 0; i < this.renderElements.length; ++i) {
                UI.getUsedCanvas().set(this.renderElements[i]);
            }

            // Event
            this.click(() => {
                if(this.isChecked()){
                    this.setCheck(false);
                }
                else{
                    this.setCheck(true);

                }

                for (var i = this.functionsToCallWhenCheck.length - 1; i >= 0; i--) {
                    this.functionsToCallWhenCheck[i](this.isChecked());
                }
            });

        }

        /*    --------------------------------------------------- *\
                [function] isChecked()

                * Retourne si le checkbox est checké ou non *

                Return: true, false
        \*    --------------------------------------------------- */
        isChecked():boolean{
            return this.checked;
        }

        /*    --------------------------------------------------- *\
                [function] setCheck(boolean)

                * Set le checkbox a true ou false *

                Return: nil
        \*    --------------------------------------------------- */
        setCheck(bool:boolean){
            this.checked = bool;
        }

        /*    --------------------------------------------------- *\
                [function] check()

                * Quand l'utilisateur check le checkbox *

                Return: nil
        \*    --------------------------------------------------- */
        check(functionToCall:any){
            this.functionsToCallWhenCheck.push(functionToCall);
        }
    }
}


text:
//%2005////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation, The Open Group.
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
// EMC Corporation; VERITAS Software Corporation; The Open Group.
//
// 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.
//
//==============================================================================
//
// Author: Christopher Neufeld <neufeld@linuxcare.com>
//         David Kennedy       <dkennedy@linuxcare.com>
//
// Modified By:
//         David Kennedy       <dkennedy@linuxcare.com>
//         Christopher Neufeld <neufeld@linuxcare.com>
//         Al Stone, Hewlett-Packard Company <ahs3@fc.hp.com>
//         Jim Metcalfe, Hewlett-Packard Company
//         Carlos Bonilla, Hewlett-Packard Company
//         Mike Glantz, Hewlett-Packard Company <michael_glantz@hp.com>
//         Lyle Wilkinson, Hewlett-Packard Company <lyle_wilkinson@hp.com>
//              Carol Ann Krug Graves, Hewlett-Packard Company
//                (carolann_graves@hp.com)
//
//%////////////////////////////////////////////////////////////////////////////

#ifndef PG_BIPTLEP_PROVIDER_H
#define PG_BIPTLEP_PROVIDER_H

/* ==========================================================================
   Includes.
   ========================================================================== */

#include <Pegasus/Provider/CIMInstanceProvider.h>
#include "IPPlatform.h"

PEGASUS_USING_STD;
PEGASUS_USING_PEGASUS;

class BIPTLEpProvider : public CIMInstanceProvider
{

public:

  BIPTLEpProvider();

  ~BIPTLEpProvider();

  void createInstance(const OperationContext       &context,
                    const CIMObjectPath           &instanceName,
                    const CIMInstance            &instanceObject,
                    ObjectPathResponseHandler &handler);

  void deleteInstance(const OperationContext       &context,
                    const CIMObjectPath           &instanceReference,
                    ResponseHandler &handler);

  void enumerateInstances(
	const OperationContext & context,
	const CIMObjectPath & classReference,
        const Boolean includeQualifiers,
        const Boolean includeClassOrigin,
	const CIMPropertyList & propertyList,
	InstanceResponseHandler & handler);

  void enumerateInstanceNames(const OperationContext        &context,
                            const CIMObjectPath            &ref,
                            ObjectPathResponseHandler &handler);

  void getInstance(const OperationContext       &context,
                 const CIMObjectPath           &instanceName,
                 const Boolean includeQualifiers,
                 const Boolean includeClassOrigin,
                 const CIMPropertyList        &propertyList,
                 InstanceResponseHandler &handler);

  void modifyInstance(const OperationContext       &context,
                    const CIMObjectPath           &instanceName,
                    const CIMInstance            &instanceObject,
                    const Boolean includeQualifiers,
		    const CIMPropertyList        &propertyList,
                    ResponseHandler &handler);

  void initialize(CIMOMHandle&);

  void terminate(void);

private:

  // private member to store handle passed by initialize()
  CIMOMHandle _cimomHandle;

  Array<CIMKeyBinding> _constructKeyBindings(const CIMNamespaceName &nameSpace,
					     const IPInterface &ipif);

  Array<CIMKeyBinding> _constructReference(const CIMName& className,
					   const String& sysName,
					   const String& instName);

  // Used to add properties to an instance
  CIMInstance _constructInstance(const CIMName &clnam,
                                 const CIMNamespaceName &nameSpace,
                                 const IPInterface &ipInt);

  // Used to check if a reference path to a Protocol Endpoint is good
  Boolean _goodPERefKeys(const CIMObjectPath &instName,
			 String &rccn,
			 String &rname);

  // checks the class passed by the cimom and throws
  // an exception if it's not supported by this provider
  void _checkClass(CIMName&);

};

#endif  /* #ifndef PG_BIPTLEP_PROVIDER_H */


text:
<?php

namespace Rapid;

use Rapid\Rapid;
use Rapid\Response;
use Unirest\Request;

class Images {

    private static $route = 'images';

    public static function getAll($params = null, $headers = null) {
        $response = Request::get(Rapid::getUrl(self::$route), $headers, $params);
        return Response::make($response);
    }

    public static function get($id, $params = null, $headers = null) {
        $response = Request::get(Rapid::getUrl(self::$route . '/' . $id), $headers, $params);
        return Response::make($response);
    }

    public static function post($body = null, $headers = null) {
        if (!$headers)
            $headers = Rapid::getAuthHeader();

        $response = Request::post(Rapid::getUrl(self::$route), $headers, http_build_query($body));
        return Response::make($response);
    }

    public static function put($id, $body = null, $headers = null) {
        if (!$headers)
            $headers = Rapid::getAuthHeader();

        $response = Request::put(Rapid::getUrl(self::$route . '/' . $id), $headers, http_build_query($body));
        return Response::make($response);
    }

    public static function delete($id, $headers = null) {
        if (!$headers)
            $headers = Rapid::getAuthHeader();

        $response = Request::delete(Rapid::getUrl(self::$route . '/' . $id), $headers);
        return Response::make($response);
    }

    public static function deleteAll($headers = null) {
        if (!$headers)
            $headers = Rapid::getAuthHeader();

        $response = Request::delete(Rapid::getUrl(self::$route), $headers);
        return Response::make($response);
    }

}


text:
package ru.stqa.pft.addressbook.appmanager;

import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import java.util.concurrent.TimeUnit;

/**
 * Created by Alexey on 1/27/2017.
 */
public class ApplicationManager {
    //ChromeDriver wd;
    FirefoxDriver wd;

    private SessionHelper sessionHelper;
    private NavigationHelper navigationHelper;
    private GroupsHelper groupsHelper;

    public void init() {
        //wd = new ChromeDriver();
        wd = new FirefoxDriver();
        wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
        wd.get("http://localhost/addressbook/");
        groupsHelper = new GroupsHelper(wd);
        navigationHelper = new NavigationHelper(wd);
        sessionHelper = new SessionHelper(wd);
        sessionHelper.login("admin", "secret");
    }

    public void stop() {wd.quit();
    }

    public GroupsHelper getGroupsHelper() {
        return groupsHelper;
    }

    public NavigationHelper getNavigationHelper() {
        return navigationHelper;
    }

    public void logOut() {
    }
}


text:
<a id="addCourseBtn" class='profileAjaxLink floatRight ui-state-default ui-corner-all' href="<?php echo url_for("teacher/addCourse");?>">Lägg till kurs

<?php $i=0; foreach( $courseList as $course): $i++;?>
	<li class="<?php if(($i % 2) == 0){echo "even";}else{echo "odd";}?>">
			<a href = "<?php echo url_for($myUserType.'/search?course='.$course->getId()) ;?> ">
				<span class="courseCode" id="<?php echo $course->getId() ?>"><?php echo $course->getId() ?>
				- <?php echo $course->getCourseName()?>

		<?php if($editable): ?>

			<a href="<?php echo url_for('teacher/removeCourse?courseCode='.$course->getId()) ?>" title="Ta bort denna kurs" class="removeableListItem ui-state-default ui-corner-all">

		<?php endif;?>

<?php endforeach;?>


text:
<<<<<<< HEAD
django
======

Projects i built using django
=======
django_projects
===============

Projects built using django
>>>>>>> e5e01d7cd31dc7df33f000e12cc86476bc405e7b


text:
using System;
using System.Collections.Generic;
using Autofac.AttributedComponent.TestTool;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;

namespace Autofac.AttributedComponent.UnitTest
{
    [TestClass]
    public class DependencySortUtilTest
    {
        [TestMethod]
        public void SortByDependencyTest_RootOnly()
        {
            var src = new Tuple<string, string>[]
                {
                    Tuple.Create<string, string>(null, null)
                };

            var result = DependencySortUtil.SortByDependency(src, obj => obj.Item1, obj => obj.Item2).ToList();

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(null, result[0].Item1);
            Assert.AreEqual(null, result[0].Item2);
        }

        [TestMethod]
        public void SortByDependencyTest_RootAndChildNormalOrder()
        {
            var src = new Tuple<string, string>[]
                {
                    Tuple.Create((string) null, (string) null),
                    Tuple.Create((string) null, "session")
                };

            var result = DependencySortUtil.SortByDependency(src, obj => obj.Item1, obj => obj.Item2).ToList();

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual(null, result[0].Item1);
            Assert.AreEqual(null, result[0].Item2);

            Assert.AreEqual(null, result[1].Item1);
            Assert.AreEqual("session", result[1].Item2);
        }

        [TestMethod]
        public void SortByDependencyTest_RootAndChildReverseOrder()
        {
            var src = new Tuple<string, string>[]
                {
                    Tuple.Create((string) null, "session"),
                    Tuple.Create((string) null, (string) null)
                };

            var result = DependencySortUtil.SortByDependency(src, obj => obj.Item1, obj => obj.Item2).ToList();

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual(null, result[0].Item1);
            Assert.AreEqual(null, result[0].Item2);

            Assert.AreEqual(null, result[1].Item1);
            Assert.AreEqual("session", result[1].Item2);
        }

        [TestMethod]
        public void SortByDependencyTest_ABC()
        {
            var src = new Tuple<string, string>[]
                {
                    Tuple.Create((string) null, (string) null),
                    Tuple.Create((string) null, "A"),
                    Tuple.Create("A", "B"),
                    Tuple.Create("B", "C"),
                };

            var result = DependencySortUtil.SortByDependency(src, obj => obj.Item1, obj => obj.Item2).ToList();

            Assert.AreEqual(4, result.Count);

            Assert.AreEqual(null, result[0].Item1);
            Assert.AreEqual(null, result[0].Item2);

            Assert.AreEqual(null, result[1].Item1);
            Assert.AreEqual("A", result[1].Item2);

            Assert.AreEqual("A", result[2].Item1);
            Assert.AreEqual("B", result[2].Item2);

            Assert.AreEqual("B", result[3].Item1);
            Assert.AreEqual("C", result[3].Item2);
        }

        [TestMethod]
        public void SortByDependencyTest_BAC()
        {
            var src = new Tuple<string, string>[]
                {
                    Tuple.Create((string) null, (string) null),
                    Tuple.Create("A", "B"),
                    Tuple.Create((string) null, "A"),
                    Tuple.Create("B", "C"),
                };

            var result = DependencySortUtil.SortByDependency(src, obj => obj.Item1, obj => obj.Item2).ToList();

            Assert.AreEqual(4, result.Count);

            Assert.AreEqual(null, result[0].Item1);
            Assert.AreEqual(null, result[0].Item2);

            Assert.AreEqual(null, result[1].Item1);
            Assert.AreEqual("A", result[1].Item2);

            Assert.AreEqual("A", result[2].Item1);
            Assert.AreEqual("B", result[2].Item2);

            Assert.AreEqual("B", result[3].Item1);
            Assert.AreEqual("C", result[3].Item2);
        }

        [TestMethod]
        public void SortByDependencyTest_ACB()
        {
            var src = new Tuple<string, string>[]
                {
                    Tuple.Create((string) null, (string) null),
                    Tuple.Create((string) null, "A"),
                    Tuple.Create("B", "C"),
                    Tuple.Create("A", "B"),
                };

            var result = DependencySortUtil.SortByDependency(src, obj => obj.Item1, obj => obj.Item2).ToList();

            Assert.AreEqual(4, result.Count);

            Assert.AreEqual(null, result[0].Item1);
            Assert.AreEqual(null, result[0].Item2);

            Assert.AreEqual(null, result[1].Item1);
            Assert.AreEqual("A", result[1].Item2);

            Assert.AreEqual("A", result[2].Item1);
            Assert.AreEqual("B", result[2].Item2);

            Assert.AreEqual("B", result[3].Item1);
            Assert.AreEqual("C", result[3].Item2);
        }

        [TestMethod]
        public void SortByDependencyTest_CBA()
        {
            var src = new Tuple<string, string>[]
                {
                    Tuple.Create((string) null, (string) null),
                    Tuple.Create("B", "C"),
                    Tuple.Create("A", "B"),
                    Tuple.Create((string) null, "A"),
                };

            var result = DependencySortUtil.SortByDependency(src, obj => obj.Item1, obj => obj.Item2).ToList();

            Assert.AreEqual(4, result.Count);

            Assert.AreEqual(null, result[0].Item1);
            Assert.AreEqual(null, result[0].Item2);

            Assert.AreEqual(null, result[1].Item1);
            Assert.AreEqual("A", result[1].Item2);

            Assert.AreEqual("A", result[2].Item1);
            Assert.AreEqual("B", result[2].Item2);

            Assert.AreEqual("B", result[3].Item1);
            Assert.AreEqual("C", result[3].Item2);
        }

        [TestMethod]
        public void SortByDependencyTest_SameParent()
        {
            var src = new Tuple<string, string>[]
                {
                    Tuple.Create((string) null, (string) null),
                    Tuple.Create("A", "B"),
                    Tuple.Create("A", "C"),
                    Tuple.Create((string) null, "A"),
                };

            var result = DependencySortUtil.SortByDependency(src, obj => obj.Item1, obj => obj.Item2).ToList();

            Assert.AreEqual(4, result.Count);

            Assert.AreEqual(null, result[0].Item1);
            Assert.AreEqual(null, result[0].Item2);

            Assert.AreEqual(null, result[1].Item1);
            Assert.AreEqual("A", result[1].Item2);

            Assert.AreEqual("A", result[2].Item1);
            Assert.AreEqual("B", result[2].Item2);

            Assert.AreEqual("A", result[3].Item1);
            Assert.AreEqual("C", result[3].Item2);
        }

        [TestMethod]
        public void SortByDependencyTest_DifferentReference()
        {
            var src = new Tuple<string, string>[]
                {
                    Tuple.Create("A", "B"),
                    Tuple.Create((string) null, new string(new char[] { 'A' } )),
                    Tuple.Create((string) null, (string) null),
                };

            var result = DependencySortUtil.SortByDependency(src, obj => obj.Item1, obj => obj.Item2).ToList();

            Assert.AreEqual(3, result.Count);

            Assert.AreEqual(null, result[0].Item1);
            Assert.AreEqual(null, result[0].Item2);

            Assert.AreEqual(null, result[1].Item1);
            Assert.AreEqual("A", result[1].Item2);

            Assert.AreEqual("A", result[2].Item1);
            Assert.AreEqual("B", result[2].Item2);
        }
    }
}


text:
package org.nypl.drag;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RemoteViews.RemoteView;

/**
 * A layout that lets you specify exact locations (x/y coordinates) of its
 * children. Absolute layouts are less flexible and harder to maintain than
 * other types of layouts without absolute positioning.
 *
 *
XML attributes

 See {@link
 * android.R.styleable#ViewGroup ViewGroup Attributes}, {@link
 * android.R.styleable#View View Attributes}

 *
 *
Note: This class is a clone of AbsoluteLayout, which is now deprecated.
 */

@RemoteView
public class MyAbsoluteLayout extends ViewGroup {
    public MyAbsoluteLayout(Context context) {
        super(context);
    }

    public MyAbsoluteLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyAbsoluteLayout(Context context, AttributeSet attrs,
            int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int count = getChildCount();

        int maxHeight = 0;
        int maxWidth = 0;

        // Find out how big everyone wants to be
        measureChildren(widthMeasureSpec, heightMeasureSpec);

        // Find rightmost and bottom-most child
        for (int i = 0; i < count; i++) {
            View child = getChildAt(i);
            if (child.getVisibility() != GONE) {
                int childRight;
                int childBottom;

                MyAbsoluteLayout.LayoutParams lp
                        = (MyAbsoluteLayout.LayoutParams) child.getLayoutParams();

                childRight = lp.x + child.getMeasuredWidth();
                childBottom = lp.y + child.getMeasuredHeight();

                maxWidth = Math.max(maxWidth, childRight);
                maxHeight = Math.max(maxHeight, childBottom);
            }
        }

        // Account for padding too
        maxWidth += getPaddingLeft () + getPaddingRight ();
        maxHeight += getPaddingTop () + getPaddingBottom ();
        /* original
        maxWidth += mPaddingLeft + mPaddingRight;
        maxHeight += mPaddingTop + mPaddingBottom;
        */

        // Check against minimum height and width
        maxHeight = Math.max(maxHeight, getSuggestedMinimumHeight());
        maxWidth = Math.max(maxWidth, getSuggestedMinimumWidth());

        setMeasuredDimension(resolveSize(maxWidth, widthMeasureSpec),
                resolveSize(maxHeight, heightMeasureSpec));
    }

    /**
     * Returns a set of layout parameters with a width of
     * {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT},
     * a height of {@link android.view.ViewGroup.LayoutParams#WRAP_CONTENT}
     * and with the coordinates (0, 0).
     */
    @Override
    protected ViewGroup.LayoutParams generateDefaultLayoutParams() {
        return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 0, 0);
    }

    @Override
    protected void onLayout(boolean changed, int l, int t,
            int r, int b) {
        int count = getChildCount();

        int paddingL = getPaddingLeft ();
        int paddingT = getPaddingTop ();
        for (int i = 0; i < count; i++) {
            View child = getChildAt(i);
            if (child.getVisibility() != GONE) {

                MyAbsoluteLayout.LayoutParams lp =
                        (MyAbsoluteLayout.LayoutParams) child.getLayoutParams();

                int childLeft = paddingL + lp.x;
                int childTop = paddingT + lp.y;
                /*
                int childLeft = mPaddingLeft + lp.x;
                int childTop = mPaddingTop + lp.y;
                */
                child.layout(childLeft, childTop,
                        childLeft + child.getMeasuredWidth(),
                        childTop + child.getMeasuredHeight());

            }
        }
    }

    @Override
    public ViewGroup.LayoutParams generateLayoutParams(AttributeSet attrs) {
        return new MyAbsoluteLayout.LayoutParams(getContext(), attrs);
    }

    // Override to allow type-checking of LayoutParams.
    @Override
    protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
        return p instanceof MyAbsoluteLayout.LayoutParams;
    }

    @Override
    protected ViewGroup.LayoutParams generateLayoutParams(ViewGroup.LayoutParams p) {
        return new LayoutParams(p);
    }

    /**
     * Per-child layout information associated with MyAbsoluteLayout.
     * See
     * {@link android.R.styleable#MyAbsoluteLayout_Layout Absolute Layout Attributes}
     * for a list of all child view attributes that this class supports.
     */
    public static class LayoutParams extends ViewGroup.LayoutParams {
        /**
         * The horizontal, or X, location of the child within the view group.
         */
        public int x;
        /**
         * The vertical, or Y, location of the child within the view group.
         */
        public int y;

        /**
         * Creates a new set of layout parameters with the specified width,
         * height and location.
         *
         * @param width the width, either {@link #MATCH_PARENT},
                  {@link #WRAP_CONTENT} or a fixed size in pixels
         * @param height the height, either {@link #MATCH_PARENT},
                  {@link #WRAP_CONTENT} or a fixed size in pixels
         * @param x the X location of the child
         * @param y the Y location of the child
         */
        public LayoutParams(int width, int height, int x, int y) {
            super(width, height);
            this.x = x;
            this.y = y;
        }

        /**
         * Creates a new set of layout parameters. The values are extracted from
         * the supplied attributes set and context. The XML attributes mapped
         * to this set of layout parameters are:
         *
         *

         *
layout_x: the X location of the child

         *
layout_y: the Y location of the child

         *
All the XML attributes from
         *   {@link android.view.ViewGroup.LayoutParams}

         *

         *
         * @param c the application environment
         * @param attrs the set of attributes from which to extract the layout
         *              parameters values
         */
        public LayoutParams(Context c, AttributeSet attrs) {
            super(c, attrs);
            /* FIX THIS eventually. Without this, I don't think you can put x and y in layout xml files.
            TypedArray a = c.obtainStyledAttributes(attrs,
                    com.android.internal.R.styleable.AbsoluteLayout_Layout);
            x = a.getDimensionPixelOffset(
                    com.android.internal.R.styleable.AbsoluteLayout_Layout_layout_x, 0);
            y = a.getDimensionPixelOffset(
                    com.android.internal.R.styleable.AbsoluteLayout_Layout_layout_y, 0);
            a.recycle();
            */
        }

        /**
         * {@inheritDoc}
         */
        public LayoutParams(ViewGroup.LayoutParams source) {
            super(source);
        }

        public String debug(String output) {
            return output + "Absolute.LayoutParams={width="
                    + sizeToString(width) + ", height=" + sizeToString(height)
                    + " x=" + x + " y=" + y + "}";
        }

      /**
         * Converts the specified size to a readable String.
         *
         * @param size the size to convert
         * @return a String instance representing the supplied size
         *
         * @hide
         */
        protected static String sizeToString(int size) {
            if (size == WRAP_CONTENT) {
                return "wrap-content";
            }
            if (size == MATCH_PARENT) {
                return "match-parent";
            }
            return String.valueOf(size);
        }
    } // end class

} // end class