text:
function showBulkAnalisysDialog (tabPanel) {

  //Show Bulk Analisys dialog
  var $bulkDialog = $('
' +
                          '
' +
                            '
Please select and upload a Bulk File.
Bulk files are text files with the absolute paths of each file to work with per line.
' +
                          '
' +
                      '
');

  //Function called when bulk file is selected
  var onBulkFileLoadedFn = function(e, file) {
    try {
      if (file.type == "text/plain") {
        var contents = e.target.result;
        if (contents.length > 0) {

          var lines = contents.split("\n");
          log("Bulk start load, N lines: " + lines.length);

          var filesToRead = [];
          for (i in lines){
            var path = lines[i];
            if ((path.length > 0) && !path.startsWith("#")){
              filesToRead.push(path);
            }
          }

          if (filesToRead.length > 0) {
            log("Bulk files to copy: " + filesToRead.length);
            tabPanel.service.request_intermediate_files(filesToRead, function(res) {

              if (!isNull(res)){
                var intermediateFiles = JSON.parse(res);
                log("Bulk intermediate files: " + intermediateFiles.length);

                if (intermediateFiles.length > 0) {
                  tabPanel.projectConfig.setFiles("BULK", intermediateFiles, file.name);

                  $bulkDialog.remove();
                  showBulkAnalisysStep2Dialog(tabPanel);
                } else {

                  $bulkDialog.remove();
                  showError("Can't create any intermediate file");
                }

              } else {

                $bulkDialog.remove();
                showError("Error uploading bulk file contents");
              }

            });
          }

        } else {
          $bulkDialog.remove();
          showError("Empty Bulk File");
        }
      } else {
        $bulkDialog.remove();
        showError("Wrong Bulk File format, requiered text/plain");
      }
   } catch (e) {
     $bulkDialog.remove();
     showError("Error loading Bulk File", e);
   }
  };

  tabPanel.$html.append($bulkDialog);
  $bulkDialog.dialog({
     width: 450,
     modal: true,
     buttons: [
         {
          id: "uploadBulk",
          text: "Upload Bulk File",
          click:function() {
            showLoadFile(onBulkFileLoadedFn);
            $("#uploadBulk").text('Uploading...').prop("disabled",true);
            $("#cancelBulk").prop("disabled",true);
          }
        },
        {
         id: "cancelBulk",
         text: "Cancel",
         click:function() {
           $bulkDialog.remove();
         }
       }
     ]
   });
   $bulkDialog.parent().find(".ui-dialog-titlebar-close").html('');
}

// Shows second step of bulk analisys dialog: Plot selections
function showBulkAnalisysStep2Dialog (tabPanel) {

 //Show Bulk Analisys Step 2 dialog
 var visiblePlots = tabPanel.outputPanel.plots.filter(function(plot) { return plot.isVisible && !plot.isBulkPlot(); });
 if (visiblePlots.length > 0) {

   var visiblePlotButtons = "";
   for (i in visiblePlots) {
      var plot = visiblePlots[i];
      visiblePlotButtons += '<button class="btn btn-default btnSelect ' + plot.id + '" plotId="' + plot.id + '">' +
                            ' ' + plot.plotConfig.styles.title +
                          '</button>';
    };

  } else {
    showError("At least one plot must be visible");
    return;
  }

  var $bulkDialog = $('
' +
                         '
' +
                           '
Uploaded files: ' + tabPanel.projectConfig.bulkFilenames.length + '
' +
                           '
Select at least one plot to proceed with bulk analisys:
' +
                           visiblePlotButtons +
                         '
' +
                     '
');

 $bulkDialog.find(".btnSelect").click(function(event){
    $(this).toggleClass("plotSelected");
    $("#proceedBulk").prop("disabled", $bulkDialog.find(".plotSelected").length == 0);
 });

 //Function called when plots are selected and proceed clicked
 var onBulkPlotSelectedFn = function(e, file) {
   try {

     var plotConfigs = [];
     $bulkDialog.find(".plotSelected").each(function( index ) {
        var plotId = $( this ).attr("plotId");
        var plot = tabPanel.outputPanel.getPlotById(plotId);
        plotConfigs.push(plot.getConfig());
      });

      var outdir = "BULK_" + new Date().toLocaleString().replace(/\ /g, "_").replace(/\:/g, "-").replace(/\//g, "-");
      var bulkAnalisysData = { filenames: tabPanel.projectConfig.bulkFilenames,
                               plotConfigs: plotConfigs,
                               outdir: outdir
                             };

      tabPanel.service.request_bulk_analisys(bulkAnalisysData, function(res) {
        try {

          result = JSON.parse(res);
          if (!isNull(result)){

            log("Bulk analisys success!!");

            //Cleans previous plots and analysis tab
            tabPanel.outputPanel.removePlotsById(tabPanel.projectConfig.getPlotsIdsByKey("BULK"));
            tabPanel.projectConfig.cleanPlotsIdsKey("BULK");
            tabPanel.toolPanel.clearBulkAnalisysPlotResults();

            for (i in result.plot_configs) {
              var plotConfigResults = result.plot_configs[i];
              var dirpath = outdir + "/" + plotConfigResults.plotId;

              var plotConfigsFlt = plotConfigs.filter(function(plotConfigs) { return plotConfigs.id == plotConfigResults.plotId; });
              var plotConfig = (plotConfigsFlt.length == 1) ? plotConfigsFlt[0] : null;
              if (!isNull(plotConfig)) {

                var plotBtnsContainer = tabPanel.toolPanel.addBulkAnalisysPlotResults(plotConfigResults.plotId,
                                                                                plotConfig.styles.title);

                if (plotConfig.class == "LcPlot") {

                  //Changes axis from source plot, beacause the plot will work with lcs
                  var plotAxis = $.extend(true, [], plotConfig.axis);
                  plotAxis[0].table = "RATE";
                  plotAxis[1].table = "RATE";

                  for (i in plotConfigResults.filenames) {

                    var filename = plotConfigResults.filenames[i];

                    newPlotConfig = cleanPlotConfig($.extend(true, {}, plotConfig));// Creates copy for avoid change source plotConfig
                    newPlotConfig.filters = [];
                    newPlotConfig = $.extend(true, newPlotConfig, {
                                            filename: dirpath + "/" + filename,
                                            bck_filename: "",
                                            gti_filename: "",
                                            styles: { title: filename + " " + newPlotConfig.styles.title,
                                                      bulkPlot: true },
                                            axis: plotAxis
                                          });

                    var lcPlot = new LcPlot(
                                      tabPanel.outputPanel.generatePlotId("ligthcurve_" + filename),
                                      newPlotConfig,
                                      tabPanel.outputPanel.service.request_lightcurve,
                                      null,
                                      tabPanel.outputPanel.onPlotReady,
                                      plotBtnsContainer,
                                      "LcPlot " + (plotConfig.fullWidth) ? "fullWidth" : "",
                                      false
                                    );

                    lcPlot.applyValidFilters = function (filters) {
                      //Avoid filters to be updated from dataset values changed
                      this.plotConfig.filters = [];
                    }
                    lcPlot.updatePlotConfig = function () {
                      //Avoid plot config changes on refreshData
                    };

                    tabPanel.outputPanel.appendPlot(lcPlot, false);
                    tabPanel.projectConfig.addPlotId(lcPlot.id, "BULK");

                    lcPlot.hide();
                  }
                }

              } else {
                log("Bulk analisys error: Unknown plot: " + plotConfigResults.plotId);
              }

            };

            $bulkDialog.remove();
            return;

          }

        } catch (e) {
          log ("request_bulk_analisys results error: " + e);
        }

        $bulkDialog.remove();
        showError("Error on bulk analisys process");

      });

  } catch (e) {
    $bulkDialog.remove();
    showError("Error doing Bulk File", e);
  }
 };

 tabPanel.$html.append($bulkDialog);
 $bulkDialog.dialog({
    width: 450,
    modal: true,
    buttons: [
        {
         id: "proceedBulk",
         text: "Proceed with analisys",
         click:function() {
           onBulkPlotSelectedFn();
           $("#proceedBulk").text('Work in progress...').prop("disabled",true);
           $("#cancelBulk").prop("disabled",true);
         }
       },
       {
        id: "cancelBulk",
        text: "Cancel",
        click:function() {
          $bulkDialog.remove();
        }
      }
    ]
  });
  $("#proceedBulk").prop("disabled",true);
  $bulkDialog.parent().find(".ui-dialog-titlebar-close").html('');
}


text:
package net.ros.common.tile.machine;

import lombok.Getter;
import lombok.Setter;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.ros.common.ROSConstants;
import net.ros.common.block.BlockVeinOre;
import net.ros.common.init.ROSBlocks;
import net.ros.common.init.ROSItems;
import net.ros.common.inventory.InventoryHandler;
import net.ros.common.machine.Machines;
import net.ros.common.machine.module.InventoryModule;
import net.ros.common.ore.CoreSample;
import net.ros.common.ore.Mineral;
import net.ros.common.ore.Ores;
import net.ros.common.steam.SteamCapabilities;
import net.ros.common.container.BuiltContainer;
import net.ros.common.container.ContainerBuilder;
import net.ros.common.container.IContainerProvider;
import net.ros.common.gui.MachineGui;
import net.ros.common.item.ItemDrillCoreSample;
import net.ros.common.network.action.ActionSender;
import net.ros.common.network.action.IActionReceiver;

import java.util.Map;

public class TileTinyMiningDrill extends TileTickingModularMachine implements IContainerProvider, IActionReceiver
{
    private final int consumption = 20;
    private final int radius      = 7;
    private final int diameter    = radius * 2 + 1;

    @Getter
    @Setter
    private float progress;

    private BlockPos   lastPos;
    private CoreSample result = new CoreSample();

    @Getter
    @Setter
    private boolean doStart = false;

    public TileTinyMiningDrill()
    {
        super(Machines.TINY_MINING_DRILL);

        this.lastPos = this.getPos();
    }

    @Override
    protected void reloadModules()
    {
        super.reloadModules();

        this.addModule(new InventoryModule(this, 2));
    }

    @Override
    public void update()
    {
        if (this.isClient())
        {
            if (this.getProgress() < 1 && this.getSteam() >= this.consumption && this.doStart)
                this.world.spawnParticle(EnumParticleTypes.BLOCK_DUST,
                        this.getPos().getX() + 0.5 + (this.world.rand.nextFloat() / 4.0F) - 0.125F,
                        this.getPos().getY(),
                        this.getPos().getZ() + 0.5 + (this.world.rand.nextFloat() / 4.0F) - 0.125F,
                        (this.world.rand.nextFloat() / 4.0F) - 0.125F, 0.25D,
                        (this.world.rand.nextFloat() / 4.0F) - 0.125F,
                        Block.getStateId(this.world.getBlockState(pos.down())));
            return;
        }

        if (this.doStart && this.getProgress() < 1 && this.getSteam() >= this.consumption)
        {
            InventoryHandler inventory = this.getModule(InventoryModule.class).getInventory("basic");
            BlockPos toCheck = this.lastPos;

            for (int i = 0; i < 25; i++)
            {
                if (lastPos.equals(BlockPos.ORIGIN))
                    toCheck = new BlockPos(this.getPos().getX() - radius, 0, this.getPos().getZ() - radius);
                else
                {
                    if (toCheck.getY() == this.getPos().getY() - 1)
                    {
                        if (toCheck.getX() == this.getPos().getX() + radius)
                        {
                            if (toCheck.getZ() == this.getPos().getZ() + radius)
                            {
                                this.progress = 1;
                                inventory.setStackInSlot(0, ItemDrillCoreSample.getSample(this.getPos(), result));
                            }
                            toCheck = new BlockPos(this.getPos().getX() - radius, 0, toCheck.getZ() + 1);
                        }
                        else
                            toCheck = new BlockPos(toCheck.getX() + 1, 0, toCheck.getZ());
                    }
                    else
                        toCheck = toCheck.up();
                }
                this.progress =
                        (((toCheck.getZ() - this.getPos().getZ() + radius) * diameter * (this.getPos().getY() - 1))
                                + ((toCheck.getX() - this.getPos().getX() + radius) * (this.getPos().getY() - 1)) + toCheck.getY())
                                / (float) (diameter * diameter * (this.getPos().getY() - 1));

                IBlockState state = this.world.getBlockState(toCheck);

                if (state.getBlock() instanceof BlockVeinOre)
                {
                    BlockPos finalToCheck = toCheck;
                    Ores.getOreFromState(state).ifPresent(ore ->
                    {
                        this.result.getOreCount().compute(ore, (currentOre, currentCount) ->
                        {
                            int count = ((BlockVeinOre) state.getBlock()).getRichnessFromState(state).ordinal() + 1;
                            if (currentCount == null)
                                return count;
                            else
                                return Integer.sum(count, currentCount);
                        });
                        this.result.getOreHeightMap().put(finalToCheck, ore);
                    });
                }
                lastPos = toCheck;

                if (this.progress == 1)
                {
                    inventory.setStackInSlot(0, ItemDrillCoreSample.getSample(this.getPos(), result));
                    this.progress = 0;
                    this.lastPos = BlockPos.ORIGIN;
                    this.result = new CoreSample();
                    this.doStart = false;
                }
            }
            this.drainSteam(this.consumption, true);

            this.sync();
        }
    }

    @Override
    public NBTTagCompound writeToNBT(NBTTagCompound tag)
    {
        tag.setFloat("progress", this.progress);
        tag.setLong("lastPos", this.lastPos.toLong());
        tag.setTag("coreSample", this.result.toNBT(tag));
        tag.setBoolean("doStart", this.doStart);

        return super.writeToNBT(tag);
    }

    @Override
    public void readFromNBT(NBTTagCompound tag)
    {
        this.progress = tag.getFloat("progress");
        this.lastPos = BlockPos.fromLong(tag.getLong("lastPos"));
        this.result = CoreSample.fromNBT(tag.getCompoundTag("coreSample"));
        this.doStart = tag.getBoolean("doStart");

        super.readFromNBT(tag);
    }

    @Override
    public void onLoad()
    {
        if (this.isClient())
            this.askServerSync();
    }

    private int getSteam()
    {
        ItemStack steam = this.getModule(InventoryModule.class).getInventory("basic").getStackInSlot(1);

        if (steam.hasCapability(SteamCapabilities.ITEM_STEAM_HANDLER, EnumFacing.NORTH))
            return steam.getCapability(SteamCapabilities.ITEM_STEAM_HANDLER, EnumFacing.NORTH).getSteam();
        return 0;
    }

    private int drainSteam(int quantity, boolean doDrain)
    {
        ItemStack steam = this.getModule(InventoryModule.class).getInventory("basic").getStackInSlot(1);

        if (steam.hasCapability(SteamCapabilities.ITEM_STEAM_HANDLER, EnumFacing.NORTH))
            return steam.getCapability(SteamCapabilities.ITEM_STEAM_HANDLER, EnumFacing.NORTH)
                    .drainSteam(quantity, doDrain);
        return 0;
    }

    @Override
    public BuiltContainer createContainer(EntityPlayer player)
    {
        return new ContainerBuilder("tinyminingdrill", player)
                .player(player).inventory(8, 84).hotbar(8, 142).addInventory()
                .tile(this.getModule(InventoryModule.class).getInventory("basic"))
                .outputSlot(0, 134, 35).steamSlot(1, 80, 58)
                .syncFloatValue(this::getProgress, this::setProgress)
                .addInventory().create();
    }

    public boolean onRightClick(final EntityPlayer player, final EnumFacing side, final float hitX, final float hitY,
                                final float hitZ, BlockPos from)
    {
        if (player.isSneaking())
            return false;
        if (player.getHeldItemMainhand().getItem() == ROSItems.WRENCH)
            return false;

        player.openGui(ROSConstants.MODINSTANCE, MachineGui.TINY_MINING_DRILL.getUniqueID(), this.world,
                this.pos.getX(), this.pos.getY(), this.pos.getZ());
        return true;
    }

    @Override
    public void handle(ActionSender sender, String actionID, NBTTagCompound payload)
    {
        if ("START".equals(actionID))
        {
            if (this.getProgress() == 0)
                this.doStart = true;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Takes a Tournament_ID
 *
 * Returns the information of the tournament
 */
require_once __DIR__ . '/../../bootstrap.php';
$input = new Entity();
$input->fromJSON();
$input->checkKeys(['Tournament_ID']);
echo Tournament::getTournament($input->Tournament_ID)->toJSON();


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2014 Hippo B.V. (http://www.onehippo.com)

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<sv:node sv:name="blogpagedetail" xmlns:sv="http://www.jcp.org/jcr/sv/1.0">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>hst:containercomponentfolder</sv:value>
  </sv:property>
  <sv:node sv:name="main">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hst:containercomponent</sv:value>
    </sv:property>
    <sv:property sv:name="hst:lastmodified" sv:type="Date">
      <sv:value>2014-04-15T15:02:10.775+02:00</sv:value>
    </sv:property>
    <sv:property sv:name="hst:xtype" sv:type="String">
      <sv:value>HST.vBox</sv:value>
    </sv:property>
    <sv:node sv:name="content">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>hst:containeritemcomponent</sv:value>
      </sv:property>
      <sv:property sv:name="hst:componentclassname" sv:type="String">
        <sv:value>org.onehippo.cms7.essentials.components.EssentialsContentComponent</sv:value>
      </sv:property>
      <sv:property sv:name="hst:label" sv:type="String">
        <sv:value>Blog Detail</sv:value>
      </sv:property>
      <sv:property sv:name="hst:template" sv:type="String">
        <sv:value>blog-detail{{templateExtension}}</sv:value>
      </sv:property>
      <sv:property sv:name="hst:xtype" sv:type="String">
        <sv:value>HST.Item</sv:value>
      </sv:property>
    </sv:node>
  </sv:node>
</sv:node>


text:
using ArduinoTest.Components.ColorManagment.Mapper.Abstract;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArduinoTest.Components.ColorManagment.Mapper
{
    public class ColorMapper : IColorMapper
    {
        public byte[] Map(System.Drawing.Color color)
        {
            return new Byte[]
            {
                color.R,
                color.G,
                color.B
            };
        }
    }
}


text:
from django.views.generic import TemplateView
from photo.models import Photos

class HomeView(TemplateView):
    template_name = 'home.html'

    def get_context_data(self, **kwargs):
        context = super(HomeView, self).get_context_data(**kwargs)
        try:
            context["photo"] = Photos.objects.filter(published='public')\
                .order_by('?').first()
            # returns pic of dog if above is context is false/att error
        except AttributeError:
            context["photo"] = 'imagersite/media/photo_files/15-07-28/dog.jpg'
        return context


text:
using System;
using System.Windows.Forms;

namespace CP.Windows.Forms
{
	/// <summary>
	/// Utility class used to display a wait cursor
	/// while a long operation takes place and
	/// guarantee that it will be removed on exit.
	///
	/// Use as follows:
	///
	///		using ( new WaitCursor() )
	///		{
	///			// Long running operation goes here
	///		}
	///
	/// </summary>
	public class WaitCursor : IDisposable
	{
		private Cursor cursor;
		private Control control;

		public WaitCursor()
		{
			this.control = null;
			this.cursor = Cursor.Current;
			Cursor.Current = Cursors.WaitCursor;
		}

		public WaitCursor( Control control )
		{
			this.control = control;
			this.cursor = control.Cursor;
			control.Cursor = Cursors.WaitCursor;
		}

		public void Dispose()
		{
			if ( control != null )
				control.Cursor = this.cursor;
			else
				Cursor.Current = this.cursor;
		}
	}
}


text:
import jsdom from 'jsdom'
import tap from 'tap'
import domList from '../src/lib/dom-list'

const { test } = tap

// Prepare environment for DOM testing
const dom = new jsdom.JSDOM()

global.window = dom.window
global.document = dom.window.document

function createFragment(html) {
  return jsdom.JSDOM.fragment(html).firstChild
}

test('domList should convert a tree of DOM elements into an HTML ordered list', (t) => {
  const tree = [
    [
      createFragment('
First
'),
      [[createFragment('
Second
')]],
    ],
    [createFragment('
Third
')],
  ]

  const expected =
    '

First

Second

Third

'

  const result = domList(tree).outerHTML

  t.equal(result, expected)
  t.end()
})

test('domList should generate ids for elements that does not have it already', (t) => {
  const tree = [
    [createFragment('
First
')],
    [createFragment('
Second
')],
    [createFragment('
Third
')],
  ]

  const expected =
    '

First

Second

Third

'

  const result = domList(tree).outerHTML

  t.equal(result, expected)
  t.end()
})


text:
package yuval.com;

// All software protected under the Apache License version 2.0
public class Debugger {
    public static boolean isEnabled(){
        return true;
    }

	public  void log(Object o){
	    if(Debugger.isEnabled()) {
	        System.out.println(o.toString());
	    }
	}
}


text:
var assert = require('assert');

var endsWith = function(string, suffix) {
  if (typeof string === 'string' || string instanceof String) {
    return string.indexOf(suffix, string.length - suffix.length) !== -1;
  }

  return false;
};

module.exports = function() {};

module.exports.prototype.getOptionName = function() {
  return 'disallowAtEachLeafNode';
};

module.exports.prototype.configure = function(options) {
  assert(
    options === true || options === false,
    this.getOptionName() + ' option requires a boolean value or should be removed'
  );

  this._callers = [
    'property',
    'observes',
    'observesBefore',
    'computed',
    'observer',
    'addObserver'
  ];
};

module.exports.prototype.check = function(file, errors) {
  var _this = this;

  file.iterateNodesByType(['CallExpression'], function(node) {
    if (node.callee.property && _this._callers.indexOf(node.callee.property.name) < 0) {
      if (node.callee && _this._callers.indexOf(node.callee.name) < 0) {
        return;
      }
    }

    node.arguments.forEach(function(value) {
      if (value.type === 'StringLiteral' && endsWith(value.value, '@each')) {
        errors.add(
          '@each as a leaf node in a dependent key is deprecated in Ember 1.13',
          value
        );
      }
    });
  });
};


text:
<?php

namespace Applester\QueueBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Business
 */
class Business extends Lookup
{

}


text:
from django.contrib.auth.models import AbstractUser, Group
from django.contrib import messages

# Import the basic Django ORM models library
from django.db import models
from django.db.models import signals
from django.dispatch import receiver

from allauth.socialaccount.models import SocialAccount
import hashlib

from django.utils.translation import ugettext_lazy as _
from model_utils import Choices, FieldTracker
from model_utils.models import StatusModel

from phonenumber_field.modelfields import PhoneNumberField

def color_key(status, component=None):
    if status == "active":
        _class = "error"
        if component == "btn":
            _class = "danger"
    elif status == "pledge":
        _class = "success"
    elif status == "rush":
        _class = "info"
    elif status == "active":
        _class = "warning"
    elif status == "active_pending":
        _class = "muted"
    else:
        _class = ""
    if component == "table":
        return _class
    else:
        return "%s-%s" % (component, _class)

def get_status_text_class(self):
    return color_key(self.status, "text")

class User(AbstractUser, StatusModel):
    STATUS = Choices(
        ('Rushing', [
            ('rush', _('Rushee')),
        ]),
        ('Pledge', [
            ('pledge', _('Pledge')),
            ('pledge_dropped', _('Dropped from Pledge'))
        ]),
        ('Active', [
            ('active', _('Active')),
            ('alumni', _('Alumni')),
            ('active_pending', _('Active Pending')),
            ('active_dropped', _('Withdrew from Chapter')),
        ]),
        ('guest', _('Guest')),
    )
    COLLEGE_YEARS = (
        (0, 'Freshman'),
        (1, 'Sophomore'),
        (2, 'Junior'),
        (3, 'Senior'),
    )
    PROFILE_IMG_OPTIONS = (
        (0, 'Facebook Default'),
        (1, 'Facebook Album'),
        (2, 'Upload New'),
    )

    university_email = models.EmailField(max_length=255, blank=True)
    phone = models.CharField(max_length=10, blank=True)
    highschool_gpa = models.DecimalField(null=True, blank=True, max_digits=3, decimal_places=2)
    gpa = models.DecimalField(null=True, blank=True, max_digits=3, decimal_places=2)
    year = models.IntegerField(choices=COLLEGE_YEARS, default=0)
    major = models.CharField(max_length=255, blank=True)
    hometown = models.CharField(max_length=255, blank=True)
    chapter = models.ForeignKey('chapters.Chapter', blank=True, null=True,
                                help_text="Select your chapter " \
                                          "*note: your membership will be pending until it is approved by " \
                                          "your chapter's administrator")
    university = models.ForeignKey('universities.University', blank=True, null=True)
    fraternity = models.ForeignKey('fraternities.Fraternity', blank=True, null=True)
    position = models.ForeignKey('chapters.Position', blank=True, null=True)
    profile_img_id = models.CharField(max_length=500, blank=True)
    profile_img_src = models.URLField(max_length=500, blank=True)
    profile_img_pic = models.URLField(max_length=500, blank=True)
    profile_img_select = models.IntegerField(choices=PROFILE_IMG_OPTIONS, default=0)

    _tracker = FieldTracker()

    def __unicode__(self):
        return self.username

    def save(self, *args, **kwargs):
        if self.chapter_id:
            self.university = self.chapter.university
            self.fraternity = self.chapter.fraternity

        return super(User, self).save(*args, **kwargs)

    def profile_image_url(self):

        if self.profile_img_select == 0:
            fb_uid = SocialAccount.objects.filter(user_id=self.id, provider='facebook')
            if len(fb_uid):
                return "http://graph.facebook.com/{}/picture?width=40&height=40".format(fb_uid[0].uid)
            else:
                if self.avatar_set.all():
                    avatar = self.avatar_set.filter(primary=True)[0]
                    return avatar.avatar_url(80)
                else:
                    return "http://www.gravatar.com/avatar/{}?s=40".format(hashlib.md5(self.email).hexdigest())

        elif self.profile_img_select == 1:
            if self.profile_img_pic:
                return self.profile_img_pic
            else:
                fb_uid = SocialAccount.objects.filter(user_id=self.id, provider='facebook')
                if len(fb_uid):
                    return "http://graph.facebook.com/{}/picture?width=40&height=40".format(fb_uid[0].uid)
        else:
            if self.avatar_set.all():
                avatar = self.avatar_set.filter(primary=True)[0]
                return avatar.avatar_url(80)
            else:
                return "http://www.gravatar.com/avatar/{}?s=40".format(hashlib.md5(self.email).hexdigest())

    def profile_image_lg_url(self):
        if self.profile_img_select == 0:
            fb_uid = SocialAccount.objects.filter(user_id=self.id, provider='facebook')
            if len(fb_uid):
                return "http://graph.facebook.com/{}/picture?width=300&height=300".format(fb_uid[0].uid)
            if self.avatar_set.all():
                avatar = self.avatar_set.filter(primary=True)
                if avatar:
                    return avatar[0].avatar_url(300)
            else:
                return "http://www.gravatar.com/avatar/{}?s=300".format(hashlib.md5(self.email).hexdigest())

        elif self.profile_img_select == 1:
            if self.profile_img_src:
                return self.profile_img_src
            else:
                fb_uid = SocialAccount.objects.filter(user_id=self.id, provider='facebook')
                if len(fb_uid):
                    return "http://graph.facebook.com/{}/picture?width=300&height=300".format(fb_uid[0].uid)
        else:
            if self.avatar_set.all():
                avatar = self.avatar_set.filter(primary=True)
                if avatar:
                    return avatar[0].avatar_url(300)
            else:
                return "http://www.gravatar.com/avatar/{}?s=300".format(hashlib.md5(self.email).hexdigest())

    def fb_photos(self):
        fb_uid = SocialAccount.objects.filter(user_id=self.id, provider='facebook')

        if len(fb_uid):
            return "https://graph.facebook.com/{}/?fields=albums".format(fb_uid[0].uid)

    def get_fb_access_token(self):
        fb_uid = SocialAccount.objects.filter(user_id=self.id, provider='facebook')
        if fb_uid:
            return fb_uid[0].socialtoken_set.all()[0]

    def get_fb_extra_data(self):
        u_social = self.socialaccount_set.all()
        if u_social:
            return u_social[0].extra_data

    @property
    def fb_uid(self):
        fb_uid = SocialAccount.objects.filter(user_id=self.id, provider='facebook')

        if len(fb_uid):
            return fb_uid[0].uid
        else:
            return None

    def is_chapter_admin(self):
        if self.chapter:
            return self in self.chapter.linked_admin_group.user_set.all()
        else:
            return False

    def get_attending(self):
        return self.attending.filter(active=True)

    def get_rsvps(self):
        return self.rsvps.filter(active=True)

    @property
    def name(self):
        return self.get_full_name()

    def get_api_url(self):
        return "/users/~#/users/%d" % self.id

    @property
    def profile_complete(self):
        if self.status == 'rush':
            if self.first_name and self.last_name and self.phone and self.hometown:
                if self.gpa or self.highschool_gpa:
                    return True
            return False
        else:
            return True

@receiver(signals.post_save, sender=User)
def set_new_user_config(sender, **kwargs):
    user = kwargs.get('instance')
    if kwargs.get('created'):
        # Is he a pending active?
        if user.chapter_id:
            group_id = user.chapter.linked_pending_group_id
            user.groups.add(group_id)
            user.status = "active_pending"
        else:
            user.status = "rush"
        user.save()
    else:
        # Was a pending active but changed to rushee
        if user.status == "active_pending" and not user.chapter_id:
            user.status = "rush"
            user.groups.clear()
            user.fraternity = None
            user.save()
        # Was a rushee but changed to pending active
        elif user.status == "rush" and user.chapter_id:
            user.groups.clear()
            pending_group_id = user.chapter.linked_pending_group_id
            user.groups.add(pending_group_id)
            user.status = "active_pending"
            user.save()

import re

@receiver(signals.post_save, sender=Group)
def set_group_and_status(sender, **kwargs):
    if not kwargs['created']:
        group = kwargs.get('instance')
        if re.match("chapter_.+? Active", str(group.name)):
            chapter = group.linked_chapter_active
            for user in group.user_set.all():
                if not user.status == "active":
                    user.status = "active"
                    if not user.chapter == chapter:
                        user.chapter = chapter
                    user.groups.clear()
                    user.groups.add(group, chapter.linked_group)
                    user.save()
        elif re.match("chapter_.+? Pledge", str(group.name)):
            chapter = group.linked_chapter_pledge
            for user in group.user_set.all():
                if not user.status == "pledge":
                    user.status = "pledge"
                    if not user.chapter == chapter:
                        user.chapter = chapter
                    user.groups.clear()
                    user.groups.add(group, chapter.linked_group)
                    user.save()
        if re.match("chapter_.+? Pending", str(group.name)):
            chapter = group.linked_chapter_pending
            for user in group.user_set.all():
                if not user.status == "active_pending":
                    user.status = "active_pending"
                    if not user.chapter == chapter:
                        user.chapter = chapter
                    user.groups.clear()
                    user.groups.add(group)
                    user.save()
        elif re.match("chapter_.+? Rush", str(group.name)):
            for user in group.user_set.all():
                if not user.status == "rush":
                    user.status = "rush"
                    if user.chapter:
                        user.chapter = None
                    user.groups.clear()
                    user.groups.add(group)
                    user.save()

from allauth.account.signals import user_signed_up
from allauth.socialaccount.signals import social_account_added
from allauth.socialaccount.models import SocialAccount
import urllib2, urllib
from django.contrib.sites.models import Site

CAPTION = str('OneGreek is redefining Greek recruitment. Review fraternity profiles, register for rush, and manage upcoming events.  All for free, entirely through Facebook.')
#CAPTION = str('OneGreek is redefining Greek recruitment. Explore chapters, register for rush, and manage events.')

@receiver(user_signed_up, dispatch_uid="some.unique.string.id.for.allauth.user_signed_up")
def post_to_facebook(request, user, **kwargs):
    post_url = "https://graph.facebook.com/{}/feed".format(user.fb_uid)
    site = Site.objects.get(id=1)
    post_data = [
        ("message", "{} {}".format(user.get_full_name(), 'has registered for spring 2014 fraternity recruitment on Onegreek.org')),
        #("link", site.domain),
        #("name", site.name),
        ("link", "http://arizona.onegreek.org"),
        ("name", "Onegreek.org"),
        ("picture", "https://djangonu-onegreek.s3.amazonaws.com/img/logos/800x600logo.jpg"),
        ("caption", CAPTION),
        ('access_token', user.get_fb_access_token().token)
        ]
    print post_data
    result = urllib2.urlopen(post_url, urllib.urlencode(post_data))


text:
.class public Landroid/content/pm/ResolveInfo;
.super Ljava/lang/Object;
.source "ResolveInfo.java"

# interfaces
.implements Landroid/os/Parcelable;

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/content/pm/ResolveInfo$DisplayNameComparator;
    }
.end annotation

# static fields
.field public static final CREATOR:Landroid/os/Parcelable$Creator;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/os/Parcelable$Creator",
            "<",
            "Landroid/content/pm/ResolveInfo;",
            ">;"
        }
    .end annotation
.end field

# instance fields
.field public activityInfo:Landroid/content/pm/ActivityInfo;

.field public filter:Landroid/content/IntentFilter;

.field public icon:I

.field public isDefault:Z

.field public labelRes:I

.field public match:I

.field public nonLocalizedLabel:Ljava/lang/CharSequence;

.field public preferredOrder:I

.field public priority:I

.field public resolvePackageName:Ljava/lang/String;

.field public serviceInfo:Landroid/content/pm/ServiceInfo;

.field public specificIndex:I

.field public system:Z

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 272
    new-instance v0, Landroid/content/pm/ResolveInfo$1;

    invoke-direct {v0}, Landroid/content/pm/ResolveInfo$1;-><init>()V

    sput-object v0, Landroid/content/pm/ResolveInfo;->CREATOR:Landroid/os/Parcelable$Creator;

    return-void
.end method

.method public constructor <init>()V
    .locals 1

    .prologue
    .line 230
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 83
    const/4 v0, -0x1

    iput v0, p0, Landroid/content/pm/ResolveInfo;->specificIndex:I

    .line 231
    return-void
.end method

.method private constructor <init>(Landroid/os/Parcel;)V
    .locals 2
    .parameter "source"

    .prologue
    const/4 v1, 0x0

    .line 282
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 83
    const/4 v0, -0x1

    iput v0, p0, Landroid/content/pm/ResolveInfo;->specificIndex:I

    .line 283
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    .line 293
    iput-object v1, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    .line 294
    iput-object v1, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    .line 297
    :goto_0
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    if-eqz v0, :cond_0

    .line 298
    sget-object v0, Landroid/content/IntentFilter;->CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v0, p1}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/IntentFilter;

    iput-object v0, p0, Landroid/content/pm/ResolveInfo;->filter:Landroid/content/IntentFilter;

    .line 300
    :cond_0
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Landroid/content/pm/ResolveInfo;->priority:I

    .line 301
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Landroid/content/pm/ResolveInfo;->preferredOrder:I

    .line 302
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Landroid/content/pm/ResolveInfo;->match:I

    .line 303
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Landroid/content/pm/ResolveInfo;->specificIndex:I

    .line 304
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Landroid/content/pm/ResolveInfo;->labelRes:I

    .line 305
    sget-object v0, Landroid/text/TextUtils;->CHAR_SEQUENCE_CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v0, p1}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/CharSequence;

    iput-object v0, p0, Landroid/content/pm/ResolveInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    .line 307
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    iput v0, p0, Landroid/content/pm/ResolveInfo;->icon:I

    .line 308
    invoke-virtual {p1}, Landroid/os/Parcel;->readString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Landroid/content/pm/ResolveInfo;->resolvePackageName:Ljava/lang/String;

    .line 309
    invoke-virtual {p1}, Landroid/os/Parcel;->readInt()I

    move-result v0

    if-eqz v0, :cond_1

    const/4 v0, 0x1

    :goto_1
    iput-boolean v0, p0, Landroid/content/pm/ResolveInfo;->system:Z

    .line 310
    return-void

    .line 285
    :pswitch_0
    sget-object v0, Landroid/content/pm/ActivityInfo;->CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v0, p1}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/pm/ActivityInfo;

    iput-object v0, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    .line 286
    iput-object v1, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    goto :goto_0

    .line 289
    :pswitch_1
    sget-object v0, Landroid/content/pm/ServiceInfo;->CREATOR:Landroid/os/Parcelable$Creator;

    invoke-interface {v0, p1}, Landroid/os/Parcelable$Creator;->createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/content/pm/ServiceInfo;

    iput-object v0, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    .line 290
    iput-object v1, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    goto :goto_0

    .line 309
    :cond_1
    const/4 v0, 0x0

    goto :goto_1

    .line 283
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method synthetic constructor <init>(Landroid/os/Parcel;Landroid/content/pm/ResolveInfo$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 35
    invoke-direct {p0, p1}, Landroid/content/pm/ResolveInfo;-><init>(Landroid/os/Parcel;)V

    return-void
.end method

# virtual methods
.method public describeContents()I
    .locals 1

    .prologue
    .line 242
    const/4 v0, 0x0

    return v0
.end method

.method public dump(Landroid/util/Printer;Ljava/lang/String;)V
    .locals 3
    .parameter "pw"
    .parameter "prefix"

    .prologue
    .line 204
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->filter:Landroid/content/IntentFilter;

    if-eqz v0, :cond_0

    .line 205
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "Filter:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 206
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->filter:Landroid/content/IntentFilter;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "  "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, p1, v1}, Landroid/content/IntentFilter;->dump(Landroid/util/Printer;Ljava/lang/String;)V

    .line 208
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "priority="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Landroid/content/pm/ResolveInfo;->priority:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " preferredOrder="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Landroid/content/pm/ResolveInfo;->preferredOrder:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " match=0x"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Landroid/content/pm/ResolveInfo;->match:I

    invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " specificIndex="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Landroid/content/pm/ResolveInfo;->specificIndex:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " isDefault="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-boolean v1, p0, Landroid/content/pm/ResolveInfo;->isDefault:Z

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 213
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->resolvePackageName:Ljava/lang/String;

    if-eqz v0, :cond_1

    .line 214
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "resolvePackageName="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Landroid/content/pm/ResolveInfo;->resolvePackageName:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 216
    :cond_1
    iget v0, p0, Landroid/content/pm/ResolveInfo;->labelRes:I

    if-nez v0, :cond_2

    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    if-nez v0, :cond_2

    iget v0, p0, Landroid/content/pm/ResolveInfo;->icon:I

    if-eqz v0, :cond_3

    .line 217
    :cond_2
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, "labelRes=0x"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Landroid/content/pm/ResolveInfo;->labelRes:I

    invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " nonLocalizedLabel="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Landroid/content/pm/ResolveInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " icon=0x"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Landroid/content/pm/ResolveInfo;->icon:I

    invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 221
    :cond_3
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    if-eqz v0, :cond_5

    .line 222
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "ActivityInfo:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 223
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "  "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, p1, v1}, Landroid/content/pm/ActivityInfo;->dump(Landroid/util/Printer;Ljava/lang/String;)V

    .line 228
    :cond_4
    :goto_0
    return-void

    .line 224
    :cond_5
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    if-eqz v0, :cond_4

    .line 225
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "ServiceInfo:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-interface {p1, v0}, Landroid/util/Printer;->println(Ljava/lang/String;)V

    .line 226
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "  "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, p1, v1}, Landroid/content/pm/ServiceInfo;->dump(Landroid/util/Printer;Ljava/lang/String;)V

    goto :goto_0
.end method

.method public final getIconResource()I
    .locals 1

    .prologue
    .line 197
    iget v0, p0, Landroid/content/pm/ResolveInfo;->icon:I

    if-eqz v0, :cond_0

    iget v0, p0, Landroid/content/pm/ResolveInfo;->icon:I

    .line 200
    :goto_0
    return v0

    .line 198
    :cond_0
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    if-eqz v0, :cond_1

    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    invoke-virtual {v0}, Landroid/content/pm/ComponentInfo;->getIconResource()I

    move-result v0

    goto :goto_0

    .line 199
    :cond_1
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    if-eqz v0, :cond_2

    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    invoke-virtual {v0}, Landroid/content/pm/ComponentInfo;->getIconResource()I

    move-result v0

    goto :goto_0

    .line 200
    :cond_2
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;
    .locals 6
    .parameter "pm"

    .prologue
    .line 172
    iget-object v3, p0, Landroid/content/pm/ResolveInfo;->resolvePackageName:Ljava/lang/String;

    if-eqz v3, :cond_1

    iget v3, p0, Landroid/content/pm/ResolveInfo;->icon:I

    if-eqz v3, :cond_1

    .line 173
    iget-object v3, p0, Landroid/content/pm/ResolveInfo;->resolvePackageName:Ljava/lang/String;

    iget v4, p0, Landroid/content/pm/ResolveInfo;->icon:I

    const/4 v5, 0x0

    invoke-virtual {p1, v3, v4, v5}, Landroid/content/pm/PackageManager;->getDrawable(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;

    move-result-object v2

    .line 174
    .local v2, dr:Landroid/graphics/drawable/Drawable;
    if-eqz v2, :cond_1

    .line 186
    .end local v2           #dr:Landroid/graphics/drawable/Drawable;
    :cond_0
    :goto_0
    return-object v2

    .line 178
    :cond_1
    iget-object v3, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    if-eqz v3, :cond_3

    iget-object v1, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    .line 179
    .local v1, ci:Landroid/content/pm/ComponentInfo;
    :goto_1
    iget-object v0, v1, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    .line 180
    .local v0, ai:Landroid/content/pm/ApplicationInfo;
    iget v3, p0, Landroid/content/pm/ResolveInfo;->icon:I

    if-eqz v3, :cond_2

    .line 181
    iget-object v3, v1, Landroid/content/pm/PackageItemInfo;->packageName:Ljava/lang/String;

    iget v4, p0, Landroid/content/pm/ResolveInfo;->icon:I

    invoke-virtual {p1, v3, v4, v0}, Landroid/content/pm/PackageManager;->getDrawable(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;

    move-result-object v2

    .line 182
    .restart local v2       #dr:Landroid/graphics/drawable/Drawable;
    if-nez v2, :cond_0

    .line 186
    .end local v2           #dr:Landroid/graphics/drawable/Drawable;
    :cond_2
    invoke-virtual {v1, p1}, Landroid/content/pm/PackageItemInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v2

    goto :goto_0

    .line 178
    .end local v0           #ai:Landroid/content/pm/ApplicationInfo;
    .end local v1           #ci:Landroid/content/pm/ComponentInfo;
    :cond_3
    iget-object v1, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    goto :goto_1
.end method

.method public loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;
    .locals 7
    .parameter "pm"

    .prologue
    .line 134
    iget-object v4, p0, Landroid/content/pm/ResolveInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    if-eqz v4, :cond_1

    .line 135
    iget-object v2, p0, Landroid/content/pm/ResolveInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    .line 156
    :cond_0
    :goto_0
    return-object v2

    .line 138
    :cond_1
    iget-object v4, p0, Landroid/content/pm/ResolveInfo;->resolvePackageName:Ljava/lang/String;

    if-eqz v4, :cond_2

    iget v4, p0, Landroid/content/pm/ResolveInfo;->labelRes:I

    if-eqz v4, :cond_2

    .line 139
    iget-object v4, p0, Landroid/content/pm/ResolveInfo;->resolvePackageName:Ljava/lang/String;

    iget v5, p0, Landroid/content/pm/ResolveInfo;->labelRes:I

    const/4 v6, 0x0

    invoke-virtual {p1, v4, v5, v6}, Landroid/content/pm/PackageManager;->getText(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;

    move-result-object v3

    .line 140
    .local v3, label:Ljava/lang/CharSequence;
    if-eqz v3, :cond_2

    .line 141
    invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    goto :goto_0

    .line 144
    .end local v3           #label:Ljava/lang/CharSequence;
    :cond_2
    iget-object v4, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    if-eqz v4, :cond_3

    iget-object v1, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    .line 145
    .local v1, ci:Landroid/content/pm/ComponentInfo;
    :goto_1
    iget-object v0, v1, Landroid/content/pm/ComponentInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    .line 146
    .local v0, ai:Landroid/content/pm/ApplicationInfo;
    iget v4, p0, Landroid/content/pm/ResolveInfo;->labelRes:I

    if-eqz v4, :cond_4

    .line 147
    iget-object v4, v1, Landroid/content/pm/PackageItemInfo;->packageName:Ljava/lang/String;

    iget v5, p0, Landroid/content/pm/ResolveInfo;->labelRes:I

    invoke-virtual {p1, v4, v5, v0}, Landroid/content/pm/PackageManager;->getText(Ljava/lang/String;ILandroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;

    move-result-object v3

    .line 148
    .restart local v3       #label:Ljava/lang/CharSequence;
    if-eqz v3, :cond_4

    .line 149
    invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    goto :goto_0

    .line 144
    .end local v0           #ai:Landroid/content/pm/ApplicationInfo;
    .end local v1           #ci:Landroid/content/pm/ComponentInfo;
    .end local v3           #label:Ljava/lang/CharSequence;
    :cond_3
    iget-object v1, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    goto :goto_1

    .line 153
    .restart local v0       #ai:Landroid/content/pm/ApplicationInfo;
    .restart local v1       #ci:Landroid/content/pm/ComponentInfo;
    :cond_4
    invoke-virtual {v1, p1}, Landroid/content/pm/ComponentInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v2

    .line 155
    .local v2, data:Ljava/lang/CharSequence;
    if-eqz v2, :cond_0

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    goto :goto_0
.end method

.method public toString()Ljava/lang/String;
    .locals 3

    .prologue
    .line 234
    iget-object v1, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    if-eqz v1, :cond_0

    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    .line 235
    .local v0, ci:Landroid/content/pm/ComponentInfo;
    :goto_0
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "ResolveInfo{"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-static {p0}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I

    move-result v2

    invoke-static {v2}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, v0, Landroid/content/pm/PackageItemInfo;->name:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " p="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Landroid/content/pm/ResolveInfo;->priority:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " o="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Landroid/content/pm/ResolveInfo;->preferredOrder:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " m=0x"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Landroid/content/pm/ResolveInfo;->match:I

    invoke-static {v2}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v2, "}"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    return-object v1

    .line 234
    .end local v0           #ci:Landroid/content/pm/ComponentInfo;
    :cond_0
    iget-object v0, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    goto :goto_0
.end method

.method public writeToParcel(Landroid/os/Parcel;I)V
    .locals 3
    .parameter "dest"
    .parameter "parcelableFlags"

    .prologue
    const/4 v0, 0x1

    const/4 v1, 0x0

    .line 246
    iget-object v2, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    if-eqz v2, :cond_0

    .line 247
    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 248
    iget-object v2, p0, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;

    invoke-virtual {v2, p1, p2}, Landroid/content/pm/ActivityInfo;->writeToParcel(Landroid/os/Parcel;I)V

    .line 255
    :goto_0
    iget-object v2, p0, Landroid/content/pm/ResolveInfo;->filter:Landroid/content/IntentFilter;

    if-eqz v2, :cond_2

    .line 256
    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 257
    iget-object v2, p0, Landroid/content/pm/ResolveInfo;->filter:Landroid/content/IntentFilter;

    invoke-virtual {v2, p1, p2}, Landroid/content/IntentFilter;->writeToParcel(Landroid/os/Parcel;I)V

    .line 261
    :goto_1
    iget v2, p0, Landroid/content/pm/ResolveInfo;->priority:I

    invoke-virtual {p1, v2}, Landroid/os/Parcel;->writeInt(I)V

    .line 262
    iget v2, p0, Landroid/content/pm/ResolveInfo;->preferredOrder:I

    invoke-virtual {p1, v2}, Landroid/os/Parcel;->writeInt(I)V

    .line 263
    iget v2, p0, Landroid/content/pm/ResolveInfo;->match:I

    invoke-virtual {p1, v2}, Landroid/os/Parcel;->writeInt(I)V

    .line 264
    iget v2, p0, Landroid/content/pm/ResolveInfo;->specificIndex:I

    invoke-virtual {p1, v2}, Landroid/os/Parcel;->writeInt(I)V

    .line 265
    iget v2, p0, Landroid/content/pm/ResolveInfo;->labelRes:I

    invoke-virtual {p1, v2}, Landroid/os/Parcel;->writeInt(I)V

    .line 266
    iget-object v2, p0, Landroid/content/pm/ResolveInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;

    invoke-static {v2, p1, p2}, Landroid/text/TextUtils;->writeToParcel(Ljava/lang/CharSequence;Landroid/os/Parcel;I)V

    .line 267
    iget v2, p0, Landroid/content/pm/ResolveInfo;->icon:I

    invoke-virtual {p1, v2}, Landroid/os/Parcel;->writeInt(I)V

    .line 268
    iget-object v2, p0, Landroid/content/pm/ResolveInfo;->resolvePackageName:Ljava/lang/String;

    invoke-virtual {p1, v2}, Landroid/os/Parcel;->writeString(Ljava/lang/String;)V

    .line 269
    iget-boolean v2, p0, Landroid/content/pm/ResolveInfo;->system:Z

    if-eqz v2, :cond_3

    :goto_2
    invoke-virtual {p1, v0}, Landroid/os/Parcel;->writeInt(I)V

    .line 270
    return-void

    .line 249
    :cond_0
    iget-object v2, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    if-eqz v2, :cond_1

    .line 250
    const/4 v2, 0x2

    invoke-virtual {p1, v2}, Landroid/os/Parcel;->writeInt(I)V

    .line 251
    iget-object v2, p0, Landroid/content/pm/ResolveInfo;->serviceInfo:Landroid/content/pm/ServiceInfo;

    invoke-virtual {v2, p1, p2}, Landroid/content/pm/ServiceInfo;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    .line 253
    :cond_1
    invoke-virtual {p1, v1}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_0

    .line 259
    :cond_2
    invoke-virtual {p1, v1}, Landroid/os/Parcel;->writeInt(I)V

    goto :goto_1

    :cond_3
    move v0, v1

    .line 269
    goto :goto_2
.end method


text:
We follow the client prod environment here :

- Php 5.4
- Ubuntu
- Mysql (no MariaDB)
- https only

**Or** you can use our [vagrant](http://vagrantup.com) box available through this repository. You'll need :

- [VirtualBox](http://www.virtualbox.org)
- [Vagrant](http://vagrantup.com)

## Start

### Using Vagrant

1. `vagrant up` (at this point, go grabbing a cofee. It can take a while.)
2. `vagrant ssh`
3. Navigate to the root of this project `cd /var/www/ucb/` and run `composer install`
4. We'd already populate the db with fixture for you. To make sure that your BD structure is synched with the Model structure run `php app/console doctrine:schema:update --force`
5. Clear the Symphony cache `app/console cache:clear`
6. [Access the project](https://ucb.dev) . You may have a security alert. That's because we use our own autosigned certificate for testing the app in https mode.

### Without Vagrant

1. [Get composer](https://getcomposer.org/)
2. If you are using linux or OS X  make sure that your www-data group or user have right permission to write in cache and log directory `app/cache` and `app/logs`
3. Configure your host as you want, vHost or just a symlink to `var/www`  or `htdoc`
4. You can use the `/server.key` and `server.crt` for configuring your vhost
4. Import the fixtures from `/dandelion.sql` into your Database
5. Run `composer install` to get dependencies
6. To make sure that your BD structure is synched with the Model structure run `php app/console doctrine:schema:update --force`
7. Clear the Symphony cache `php app/console cache:clear`
8. Access the project following the url you define. Pay attention that it's **must** be https

### Development

The root directory is `web/` if you want to use a dev environnement the index is `app_dev.php`, and `app.php` for production.

**NB:** if you are in production env you must run at each update of source code this command line :

```bash
php app/console cache:clear --env=prod
```


text:
{% if paginator.total_pages > 1 %}

  {% if paginator.previous_page %}

Previous page

  {% endif %}

  {% for page in (1..paginator.total_pages) %}
    {% if page == paginator.page %}

You're on page {{ page }}

    {% elsif page == 1 %}

{{ page }}

    {% else %}

{{ page }}

    {% endif %}
  {% endfor %}

  {% if paginator.next_page %}

Next page

  {% endif %}

{% endif %}


text:
{% extends "admin/base.html" %}
{% load i18n %}

{% block title %}{{ title }} | {% trans 'Libreta escolar' %}{% endblock %}

{% block branding %}

{% trans 'Libreta escolar' %}

{% endblock %}

{% block nav-global %}{% endblock %}


text:
namespace Pitstop64.Modules.Textures
{
    partial class NewMK64ImageForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.gbFormat = new System.Windows.Forms.GroupBox();
            this.gbByte = new System.Windows.Forms.GroupBox();
            this.radFourByte = new System.Windows.Forms.RadioButton();
            this.radTwoByte = new System.Windows.Forms.RadioButton();
            this.radOneByte = new System.Windows.Forms.RadioButton();
            this.radHalfByte = new System.Windows.Forms.RadioButton();
            this.gbPalette = new System.Windows.Forms.GroupBox();
            this.cbMioPalette = new System.Windows.Forms.CheckBox();
            this.radI = new System.Windows.Forms.RadioButton();
            this.radIA = new System.Windows.Forms.RadioButton();
            this.radCI = new System.Windows.Forms.RadioButton();
            this.radRGBA = new System.Windows.Forms.RadioButton();
            this.btnOK = new System.Windows.Forms.Button();
            this.btnCancel = new System.Windows.Forms.Button();
            this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
            this.cbEncodeMIO0 = new System.Windows.Forms.CheckBox();
            this.toolTip = new System.Windows.Forms.ToolTip(this.components);
            this.gbFormat.SuspendLayout();
            this.gbByte.SuspendLayout();
            this.gbPalette.SuspendLayout();
            this.SuspendLayout();
            //
            // gbFormat
            //
            this.gbFormat.Controls.Add(this.gbByte);
            this.gbFormat.Controls.Add(this.gbPalette);
            this.gbFormat.Controls.Add(this.radI);
            this.gbFormat.Controls.Add(this.radIA);
            this.gbFormat.Controls.Add(this.radCI);
            this.gbFormat.Controls.Add(this.radRGBA);
            this.gbFormat.Location = new System.Drawing.Point(13, 13);
            this.gbFormat.Margin = new System.Windows.Forms.Padding(4);
            this.gbFormat.Name = "gbFormat";
            this.gbFormat.Padding = new System.Windows.Forms.Padding(4);
            this.gbFormat.Size = new System.Drawing.Size(227, 219);
            this.gbFormat.TabIndex = 0;
            this.gbFormat.TabStop = false;
            this.gbFormat.Text = "Image Format";
            //
            // gbByte
            //
            this.gbByte.Controls.Add(this.radFourByte);
            this.gbByte.Controls.Add(this.radTwoByte);
            this.gbByte.Controls.Add(this.radOneByte);
            this.gbByte.Controls.Add(this.radHalfByte);
            this.gbByte.Location = new System.Drawing.Point(7, 138);
            this.gbByte.Name = "gbByte";
            this.gbByte.Size = new System.Drawing.Size(207, 74);
            this.gbByte.TabIndex = 5;
            this.gbByte.TabStop = false;
            this.gbByte.Text = "Pixel Size (Quality)";
            //
            // radFourByte
            //
            this.radFourByte.AutoSize = true;
            this.radFourByte.Location = new System.Drawing.Point(113, 47);
            this.radFourByte.Name = "radFourByte";
            this.radFourByte.Size = new System.Drawing.Size(63, 20);
            this.radFourByte.TabIndex = 11;
            this.radFourByte.Text = "4 Byte";
            this.toolTip.SetToolTip(this.radFourByte, "Each pixel stored as 4 bytes");
            this.radFourByte.UseVisualStyleBackColor = true;
            //
            // radTwoByte
            //
            this.radTwoByte.AutoSize = true;
            this.radTwoByte.Checked = true;
            this.radTwoByte.Location = new System.Drawing.Point(16, 47);
            this.radTwoByte.Name = "radTwoByte";
            this.radTwoByte.Size = new System.Drawing.Size(63, 20);
            this.radTwoByte.TabIndex = 10;
            this.radTwoByte.TabStop = true;
            this.radTwoByte.Text = "2 Byte";
            this.toolTip.SetToolTip(this.radTwoByte, "Each pixel stored as 2 bytes");
            this.radTwoByte.UseVisualStyleBackColor = true;
            //
            // radOneByte
            //
            this.radOneByte.AutoSize = true;
            this.radOneByte.Location = new System.Drawing.Point(113, 21);
            this.radOneByte.Name = "radOneByte";
            this.radOneByte.Size = new System.Drawing.Size(63, 20);
            this.radOneByte.TabIndex = 9;
            this.radOneByte.Text = "1 Byte";
            this.toolTip.SetToolTip(this.radOneByte, "Each pixel stored as 1 byte");
            this.radOneByte.UseVisualStyleBackColor = true;
            //
            // radHalfByte
            //
            this.radHalfByte.AutoSize = true;
            this.radHalfByte.Location = new System.Drawing.Point(16, 21);
            this.radHalfByte.Name = "radHalfByte";
            this.radHalfByte.Size = new System.Drawing.Size(74, 20);
            this.radHalfByte.TabIndex = 8;
            this.radHalfByte.Text = "1/2 Byte";
            this.toolTip.SetToolTip(this.radHalfByte, "Each pixel stored as 1/2 byte");
            this.radHalfByte.UseVisualStyleBackColor = true;
            //
            // gbPalette
            //
            this.gbPalette.Controls.Add(this.cbMioPalette);
            this.gbPalette.Enabled = false;
            this.gbPalette.Location = new System.Drawing.Point(7, 74);
            this.gbPalette.Name = "gbPalette";
            this.gbPalette.Size = new System.Drawing.Size(207, 58);
            this.gbPalette.TabIndex = 4;
            this.gbPalette.TabStop = false;
            this.gbPalette.Text = "Palette Settings";
            //
            // cbMioPalette
            //
            this.cbMioPalette.AutoSize = true;
            this.cbMioPalette.Location = new System.Drawing.Point(14, 23);
            this.cbMioPalette.Name = "cbMioPalette";
            this.cbMioPalette.Size = new System.Drawing.Size(166, 20);
            this.cbMioPalette.TabIndex = 5;
            this.cbMioPalette.Text = "Encode Palette in MIO0";
            this.toolTip.SetToolTip(this.cbMioPalette, "Saves space, but makes the palette less editable");
            this.cbMioPalette.UseVisualStyleBackColor = true;
            //
            // radI
            //
            this.radI.AutoSize = true;
            this.radI.Location = new System.Drawing.Point(140, 48);
            this.radI.Name = "radI";
            this.radI.Size = new System.Drawing.Size(29, 20);
            this.radI.TabIndex = 3;
            this.radI.Text = "I";
            this.toolTip.SetToolTip(this.radI, "Stores greyscale images. Transparency limited to completely transparent or comple" +
        "tely opaque");
            this.radI.UseVisualStyleBackColor = true;
            this.radI.CheckedChanged += new System.EventHandler(this.radFormatChanged);
            //
            // radIA
            //
            this.radIA.AutoSize = true;
            this.radIA.Location = new System.Drawing.Point(33, 48);
            this.radIA.Name = "radIA";
            this.radIA.Size = new System.Drawing.Size(38, 20);
            this.radIA.TabIndex = 2;
            this.radIA.Text = "IA";
            this.toolTip.SetToolTip(this.radIA, "Stores greyscale images with variable transparencies");
            this.radIA.UseVisualStyleBackColor = true;
            this.radIA.CheckedChanged += new System.EventHandler(this.radFormatChanged);
            //
            // radCI
            //
            this.radCI.AutoSize = true;
            this.radCI.Location = new System.Drawing.Point(140, 22);
            this.radCI.Name = "radCI";
            this.radCI.Size = new System.Drawing.Size(38, 20);
            this.radCI.TabIndex = 1;
            this.radCI.Text = "CI";
            this.toolTip.SetToolTip(this.radCI, "Stores palette separately from texture. Saves some space, but limits unique color" +
        " count");
            this.radCI.UseVisualStyleBackColor = true;
            this.radCI.CheckedChanged += new System.EventHandler(this.radFormatChanged);
            //
            // radRGBA
            //
            this.radRGBA.AutoSize = true;
            this.radRGBA.Checked = true;
            this.radRGBA.Location = new System.Drawing.Point(33, 22);
            this.radRGBA.Name = "radRGBA";
            this.radRGBA.Size = new System.Drawing.Size(64, 20);
            this.radRGBA.TabIndex = 0;
            this.radRGBA.TabStop = true;
            this.radRGBA.Text = "RGBA";
            this.toolTip.SetToolTip(this.radRGBA, "Saves each pixel individually. Max quality for largest size");
            this.radRGBA.UseVisualStyleBackColor = true;
            this.radRGBA.CheckedChanged += new System.EventHandler(this.radFormatChanged);
            //
            // btnOK
            //
            this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnOK.Location = new System.Drawing.Point(12, 265);
            this.btnOK.Name = "btnOK";
            this.btnOK.Size = new System.Drawing.Size(126, 50);
            this.btnOK.TabIndex = 1;
            this.btnOK.Text = "Select Image/ Images...";
            this.btnOK.UseVisualStyleBackColor = true;
            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
            //
            // btnCancel
            //
            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.Location = new System.Drawing.Point(154, 265);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(86, 50);
            this.btnCancel.TabIndex = 2;
            this.btnCancel.Text = "Cancel";
            this.btnCancel.UseVisualStyleBackColor = true;
            //
            // openFileDialog
            //
            this.openFileDialog.Filter = "Image files|*.png;*.bmp|All files|*.*";
            this.openFileDialog.Multiselect = true;
            //
            // cbEncodeMIO0
            //
            this.cbEncodeMIO0.AutoSize = true;
            this.cbEncodeMIO0.Location = new System.Drawing.Point(12, 239);
            this.cbEncodeMIO0.Name = "cbEncodeMIO0";
            this.cbEncodeMIO0.Size = new System.Drawing.Size(169, 20);
            this.cbEncodeMIO0.TabIndex = 3;
            this.cbEncodeMIO0.Text = "Encode Texture in MIO0";
            this.toolTip.SetToolTip(this.cbEncodeMIO0, "Saves space, but makes the image less editable");
            this.cbEncodeMIO0.UseVisualStyleBackColor = true;
            //
            // NewMK64ImageForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(252, 327);
            this.Controls.Add(this.cbEncodeMIO0);
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.btnOK);
            this.Controls.Add(this.gbFormat);
            this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Margin = new System.Windows.Forms.Padding(4);
            this.Name = "NewMK64ImageForm";
            this.Text = "New Image Settings";
            this.gbFormat.ResumeLayout(false);
            this.gbFormat.PerformLayout();
            this.gbByte.ResumeLayout(false);
            this.gbByte.PerformLayout();
            this.gbPalette.ResumeLayout(false);
            this.gbPalette.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.GroupBox gbFormat;
        private System.Windows.Forms.Button btnOK;
        private System.Windows.Forms.Button btnCancel;
        private System.Windows.Forms.OpenFileDialog openFileDialog;
        private System.Windows.Forms.RadioButton radI;
        private System.Windows.Forms.RadioButton radIA;
        private System.Windows.Forms.RadioButton radCI;
        private System.Windows.Forms.RadioButton radRGBA;
        private System.Windows.Forms.CheckBox cbEncodeMIO0;
        private System.Windows.Forms.ToolTip toolTip;
        private System.Windows.Forms.GroupBox gbPalette;
        private System.Windows.Forms.CheckBox cbMioPalette;
        private System.Windows.Forms.GroupBox gbByte;
        private System.Windows.Forms.RadioButton radHalfByte;
        private System.Windows.Forms.RadioButton radFourByte;
        private System.Windows.Forms.RadioButton radTwoByte;
        private System.Windows.Forms.RadioButton radOneByte;
    }
}


text:
<?php

namespace Ekyna\Component\Commerce\Bridge\Doctrine\ORM\Repository;

use Ekyna\Component\Commerce\Supplier\Repository\SupplierDeliveryItemRepositoryInterface;
use Ekyna\Component\Resource\Doctrine\ORM\ResourceRepository;

/**
 * Class SupplierDeliveryItemRepository
 * @package Ekyna\Component\Commerce\Bridge\Doctrine\ORM\Repository
 * @author  Etienne Dauvergne <contact@ekyna.com>
 */
class SupplierDeliveryItemRepository extends ResourceRepository implements SupplierDeliveryItemRepositoryInterface
{

}


text:
<?php

/* StrAdminBundle:Users:edit.html.twig */
class __TwigTemplate_4beb3a8b8047c40fed41c15f8266325c extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = $this->env->loadTemplate("StrAdminBundle:Users:add.html.twig");

        $this->blocks = array(
            'pagetitle' => array($this, 'block_pagetitle'),
            'form_action' => array($this, 'block_form_action'),
        );
    }

    protected function doGetParent(array $context)
    {
        return "StrAdminBundle:Users:add.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }

    // line 2
    public function block_pagetitle($context, array $blocks = array())
    {
        echo "Редактирование пользователя";
    }

    // line 3
    public function block_form_action($context, array $blocks = array())
    {
        echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("str_admin_user_edit", array("userId" => $this->getContext($context, "userId"))), "html", null, true);
    }

    public function getTemplateName()
    {
        return "StrAdminBundle:Users:edit.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  33 => 3,  27 => 2,);
    }
}


text:
<template name="logoLayout">

			{{> Template.dynamic template=render}}

</template>